Scope down S3 IAM permissions to least-privilege (#371)#425
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
=======================================
Coverage 95.78% 95.79%
=======================================
Files 42 42
Lines 2183 2186 +3
=======================================
+ Hits 2091 2094 +3
Misses 92 92 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #371
Replaces
AmazonS3FullAccesswith per-Lambda IAM roles scoped to the exact S3 prefixes each function needs:ttc_lambda_role):s3:GetObject/s3:HeadObjectoneCRMessageV2/andValidationResponseV2/;s3:PutObjectonTTCAugmentationMetadataV2/andTTCMetadataV2/; plus OpenSearch accessindex_lambda_role): OpenSearch access only — no S3 permissions (it doesn't use S3)augmentation_lambda_role):s3:PutObjectonAugmentationEICRV2/andAugmentationMetadataV2/only — no OpenSearch accessUses
movedblocks for the TTC role rename so existing deployments won't see a destroy/recreate cycle.Changes
terraform/main.tf— Split sharedlambda_roleinto 3 separate roles with scoped inline S3 policies; updated Lambda function role refs and OpenSearch domain access policyterraform/_outputs.tf— Replaced singlelambda_role_arnoutput with per-Lambda outputsterraform/README.md— Updated IAM docs, removed S3 scoping TODO