[ECS/Fargate] [request]: ECS Exec: support AWS SSM Documents to restrict commands in ecs execute-command
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
I would like to restrict the types of commands a user can input in an AWS ECS Execute-Command session.
**Which service(s) is this request for?**
For ECS Fargate, execute-command
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Currently users can enter any command they want to run against the container, exposing the application to a wide variety. of security implications due to human errors:
- Accidental removal of files using `rm`
- Unintended database changes using `delete` or `drop` comamnds
etc
Examples of command to I want to restrict include:
- `rm`
- `ActiveRecord::Migration.drop_table(:your_table_name)`
- `rake db:rollback`
Since ECS execute-command is relying on SSM to create the secure channel, thought there's potential to actually include SSM's Documents to restrict the commands.
**Are you currently working around this issue?**
Not really. Currently I am intending to rely on the audit logs on Cloduwatch -> EventBridge to alert if worrisome commands are detected, but this is more of a detective measure then a preventive one. I am looking for a preventive one.
**Additional context**
[Using AWS SSM document to restrict commands for SSM sessions](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-restrict-command-access.html)
**Attachments**
Contributor guide
Research direction
No repository files, tests, or entry points are mentioned. Start by reading the linked AWS Systems Manager documentation and compare its command restrictions with ECS Fargate execute-command; done means defining whether and how SSM Documents can prevent the listed commands from running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100