aws-mfa-enforce
aws-mfa-enforce copied to clipboard
Change the logic to find IAM roles with programmatic access
Currently the implementation is : https://github.com/Chan9390/aws-mfa-enforce/blob/master/handler.js#L43
It checks for the PasswordLastUsed parameter and determines if the user has management console.
But it fails in the following scenario:
- IAM user given both Management Console and Programmatic access
- The Management Console access is then removed
- This policy adds that IAM user with only Programmatic access to the MFAGroup since the
PasswordLastUsedparam is still present.