You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add support for encrypting key pair before sending it to the user
* update permission of destructor lambda and delete ssm param upon key destruction
* add function to delete ssm parameter
* update helper script and remove template_file dependency
* multiple updates
* add helper script to decrypt cipher
* multiple updates
* fix permission and variable value type
* update github labels
* add checkov skip statements
* update readme
* update logic flow in readme and diagram
* udpate readme
* comment pull request trigger for semgrep
* modify semgrep config as per official doc
* use action rather than container for semgrep
* add semgrepignore file
Copy file name to clipboardexpand all lines: README.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -24,10 +24,10 @@ This tool generates a new IAM access key pair every X number of days and informs
24
24

25
25
26
26
- CloudWatch triggers lambda function which checks the age of access key for all the IAM users who have **IKR:EMAIL**(case-insensitive) tag attached.
27
-
- If existing access key age is greater than `ACCESS_KEY_AGE` environment variable or `IKR:ROTATE_AFTER_DAYS` tag associated to the IAM user and if the user ONLY has a single key pair associated a new key pair is generated and the same is mailed to the user via your selected mail service.
28
-
- The existing access key is than stored in DynamoDB table with user details and an expiration timestamp.
29
-
- DynamoDB stream triggers destructor lambda function which is responsible for deleting the old access key associated to IAM user if the stream event is `delete`.
30
-
- In case it fails to delete the existing key pair the entry is added back to the DynamoDB table so that the same can be picked up later for retry.
27
+
- If existing access key age is greater than `ACCESS_KEY_AGE` environment variable or `IKR:ROTATE_AFTER_DAYS` tag associated to the IAM user and if the user ONLY has a single key pair associated, a new key pair is generated and if `ENCRYPT_KEY_PAIR` environment variable is set to true the new key pair is encrypted using a symmetric key which is stored in SSM parameter (`/ikr/secret/iam/IAM_USERNAME`) before the same is mailed to the user via the selected mail service.
28
+
- The existing access key is then stored in DynamoDB table with user details and an expiration timestamp.
29
+
- DynamoDB stream triggers destructor lambda function which is responsible for deleting the old access key associated to IAM user and the SSM parameter that stores the symmetric encryption key if `ENCRYPT_KEY_PAIR` environment variable is set to true. The destruction operation is carried out only if the DynamoDB stream event is of type`delete`.
30
+
- In case the destructor function fails to delete the existing key pair, the entry is added back to the DynamoDB table for retry.
31
31
32
32
### Setup:
33
33
- Use the [terraform module](terraform) included in this repo to create all the AWS resources required to automate IAM key rotation
@@ -41,3 +41,4 @@ This tool generates a new IAM access key pair every X number of days and informs
41
41
42
42
### Helper Script:
43
43
-`tag-iam-users.py`: Tags IAM users by reading **iam-user-tags.json** file
44
+
-`decryption.py`: Decrypt cipher text using the encryption key stored in the SSM parmeter store
<mxCell id="BnlXlSoju1qgPTf3SqZH-28" value="Sends an email informing<br>IAM user that existing key<br>has been deleted" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="BnlXlSoju1qgPTf3SqZH-23" vertex="1" connectable="0">
<mxCell id="BnlXlSoju1qgPTf3SqZH-25" value="DynamoDB streams are sent<br>to destructor to delete old IAM<br>access key associated with user" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="BnlXlSoju1qgPTf3SqZH-17" vertex="1" connectable="0">
0 commit comments