-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Limiting read-only access to root file systems in ECS (#523)
Limiting read-only access for ECS tasks deployed by data.all, reasoning detailed in: #426 Out of the 7 ECS tasks that gets deployed, only CDKProxy performs multiple write operations to the root filesystem. The workaround is to mount [bind volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html) to the proper paths in the filesystem: - **/dataall:** required for cdk deploy write operations (cdk.out, cdk.context.json) and further file write operations invoked through dataa.all business logic like archiving objects for the Glue profiling job - **/tmp:** required since by upon importing aws_cdk libraries a write operation happens to the /tmp folder Since the [currently used CDK class](https://docs.aws.amazon.com/cdk/api/v1/python/aws_cdk.aws_ecs/FargateTaskDefinition.html) for the Fargate task definition doesn't allow the definition of mount points, I had to replace the it with the [CFN-style class.](https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ecs/CfnTaskDefinition.html) **[Testing]** I've created 2 environments and a dataset, and performed the sharing of the dataset between the 2 environments. I've verified, that: - the newly created CDKProxy task definition has the same attributes as the old one (with the further addition of the ReadOnlyRootFileSystem=True flag and the 2 new bind volumes) - the other 6 task definitions have ReadOnlyRootFileSystem=True enabled - all 7 tasks were executed without failure with the new setting - the security alert in security hub got archived By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
Showing
4 changed files
with
86 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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