-
Notifications
You must be signed in to change notification settings - Fork 132
MFTF AWS Secrets Manager - CI Use #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial set of comments.
docs/credentials.md
Outdated
#### Use AWS Secrets Manager from other AWS account | ||
|
||
- AWS account ID where the AWS Secrets Manager service is hosted | ||
- IAM User or Role with appropriate access permission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe elaborate on what access permission is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
docs/credentials.md
Outdated
```conf | ||
# Secret name for carriers_usps_userid | ||
mftf/magento/carriers_usps_userid | ||
`Secrets Value` in plaintext format can be any content you want to secure. `Secrets Value` in key/value pairs format, however, the `key` must be same as the `Secret Name` with `mftf/<VENDOR>/` part removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe reword to -
Secret Value
can be stored in two different formats: plaintext (AWS CLI) or key/value pairs (AWS Console).
For plaintext format,Secret Value
can be any string you want to secure.
For key/value pairs format,
Secret Value
is a key/value pair withkey
same as<YOUR/SECRET/KEY>
ofSecret Name
andvalue
can be any string you want to secure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
docs/credentials.md
Outdated
|
||
Full AWS KMS ([Key Management Service][]) key ARN ([Amazon Resource Name][]) is required when accessing secrets stored in other AWS account. | ||
If this is the case, you will also need to set `CREDENTIAL_AWS_ACCOUNT_ID` environment variable so that MFTF can construct the full ARN. | ||
This is also commonly used in CI system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe remove this line since we have hyperlinks to KMS
and ARN
, if we need more information on them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reword it a bit. I actual think this is indeed most used for CI/CD.
docs/credentials.md
Outdated
@@ -186,6 +208,16 @@ CREDENTIAL_AWS_SECRETS_MANAGER_REGION=us-east-1 | |||
CREDENTIAL_AWS_SECRETS_MANAGER_PROFILE=default | |||
``` | |||
|
|||
### Optionally set CREDENTIAL_AWS_ACCOUNT_ID environment variable | |||
|
|||
Full AWS KMS ([Key Management Service][]) key ARN ([Amazon Resource Name][]) is required when accessing secrets stored in other AWS account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other AWS account seems a little vague. Needs to be reworded to specify the type of account configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded
etc/config/.env.example
Outdated
@@ -37,8 +37,6 @@ BROWSER=chrome | |||
#*** To use AWS Secrets Manager to manage _CREDS secrets, uncomment and set region, profile is optional, when omitted, AWS default credential provider chain will be used ***# | |||
#CREDENTIAL_AWS_SECRETS_MANAGER_PROFILE=default | |||
#CREDENTIAL_AWS_SECRETS_MANAGER_REGION=us-east-1 | |||
#*** If using non-default AWS account ***# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to #*** For cross AWS account use ***#
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments added, may need more elaborate documentation on local use, focusing on setting up .aws credentials file with IAM user access key id, aws_access_key_id, aws_secret_access_key and region
docs/credentials.md
Outdated
#### Use AWS Secrets Manager from your own AWS account | ||
|
||
- AWS account with Secrets Manager service available | ||
- IAM User or Role is created with appropriate AWS Secrets Manger access permission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spell check on Manger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
...FunctionalTestingFramework/DataGenerator/Handlers/SecretStorage/AwsSecretsManagerStorage.php
Show resolved
Hide resolved
Hi @dobooth, there are some dev doc change in this PR. Please take a look. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style looks on point, was a little concerned about some changes in return value around decrypting (value or false
return) but you seem to have caught all uses of it.
Code change in this ticket exposed an old problem in decryption. The fix is to show the calling function when things go wrong instead of hiding the underlying problem. |
@jilu1 I figured there was a good reason for changing the function 👍 |
Description
Fixed Issues (if relevant)
Contribution checklist