Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into multiple-keyring-pa…
Browse files Browse the repository at this point in the history
…sswords
  • Loading branch information
ldeflandre committed Jun 29, 2022
2 parents 02fb5ee + 9606411 commit 9fff0d6
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ WORKDIR /opt/gimme-aws-creds

COPY . .

RUN apk --update add libgcc

ENV PACKAGES="gcc musl-dev python3-dev libffi-dev openssl-dev cargo"

RUN apk --update add $PACKAGES \
&& pip install --upgrade pip setuptools-rust \
&& pip install futures \
&& python setup.py install \
&& apk del --purge $PACKAGES

Expand Down
2 changes: 1 addition & 1 deletion gimme_aws_creds/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__all__ = ['config', 'okta', 'main', 'ui']
version = '2.4.3'
version = '2.4.4'
32 changes: 31 additions & 1 deletion gimme_aws_creds/okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,8 +1032,38 @@ def _introspect_factors(self, state_token):
@staticmethod
def _extract_state_token_from_http_response(http_res):
saml_soup = BeautifulSoup(http_res.text, "html.parser")

mfa_string = (
'Dodatečné ověření',
'Ekstra verificering',
'Zusätzliche Bestätigung',
'Πρόσθετη επαλήθευση',
'Extra Verification',
'Verificación adicional',
'Lisätodennus',
'Vérification supplémentaire',
'Extra ellenőrzés',
'Verifikasi Tambahan',
'Verifica aggiuntiva',
'追加認証',
'추가 확인',
'Penentusahan Tambahan',
'Ekstra verifisering',
'Extra verificatie',
'Dodatkowa weryfikacja',
'Verificação extra',
'Verificare suplimentară',
'Дополнительная проверка',
'Extra verifiering',
'การตรวจสอบพิเศษ',
'Ekstra Doğrulama',
'Додаткова верифікація',
'Xác minh bổ sung',
'额外验证',
'額外驗證'
)

if hasattr(saml_soup.title, 'string') and re.match(".* - Extra Verification$", saml_soup.title.string):
if hasattr(saml_soup.title, 'string') and saml_soup.title.string.endswith(mfa_string):
# extract the stateToken from the Javascript code in the page and step up to MFA
# noinspection PyTypeChecker
state_token = decode(re.search(r"var stateToken = '(.*)';", http_res.text).group(1), "unicode-escape")
Expand Down
1 change: 0 additions & 1 deletion lambda/lambda_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,5 @@ def main():
}
}

print(aws_account_info(event, {}))

if __name__ == "__main__": main()
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
boto3>=1.7.70,<2.0.0
python-dateutil<=2.8.1
beautifulsoup4>=4.6.0,<5.0.0
configparser>=3.5.0,<4.0.0
keyring>=21.4.0
Expand Down

0 comments on commit 9fff0d6

Please sign in to comment.