Harden ECS task definition for Security Hub compliance#43
Merged
Conversation
- Add readonlyRootFilesystem=true to container definition (ECS.5 HIGH) - Add ephemeral /tmp volume mount so containers can still write temp files - Add non-root user default "1000" with tostring() for JSON encoding (ECS.20) - Wire container_user through registry for app.yaml override via compute.user
Terraform PlanNo changes — infrastructure is up to date. Plan output |
Alexanderamiri
added a commit
that referenced
this pull request
May 9, 2026
## Summary - **ECS.5 (HIGH)**: Add `readonlyRootFilesystem = true` to container definition + ephemeral `/tmp` volume mount so apps can still write temp files - **ECS.20 (MEDIUM)**: Add `user = "1000"` default (non-root) — apps can override via `compute.user` in app.yaml - Wire `container_user` through the module registry for expander support Triggered by Security Hub alerts on `platform-test-app:6` and `:7`. ## Test plan - [ ] Merge to main - [ ] Push trigger commit to platform-test-app — expand will regenerate service.tf with hardened defaults - [ ] Verify new task definition revision has `readonlyRootFilesystem: true`, `/tmp` mount, and `user: "1000"` - [ ] Verify Security Hub finding resolves within ~24h
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
readonlyRootFilesystem = trueto container definition + ephemeral/tmpvolume mount so apps can still write temp filesuser = "1000"default (non-root) — apps can override viacompute.userin app.yamlcontainer_userthrough the module registry for expander supportTriggered by Security Hub alerts on
platform-test-app:6and:7.Test plan
readonlyRootFilesystem: true,/tmpmount, anduser: "1000"