Repository navigation
Enable ECS Exec for python_backend and pybot - #200
Conversation
Set enable_execute_command on python_backend (prod, staging) and pybot (prod) services. Add a per-service task role with ssmmessages permissions and log access, and send exec session logs to the ecslogs group via the cluster execute_command_configuration. Applying this rolls all three services (new task definitions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| # ECS Exec session logs go to the shared ECS log group | ||
| cluster_configuration = { | ||
| execute_command_configuration = { | ||
| logging = "OVERRIDE" |
There was a problem hiding this comment.
low security, confidence low, pass security
Exec session logs stored unencrypted in shared 7-day log group
Exec sessions on production containers (which hold injected secrets from Secrets Manager) are logged into the shared ecslogs group, with no KMS encryption configured for the exec channel or the log group. Session output could include secrets and is readable by anyone with access to that log group. Impact is limited because access requires existing ecs:ExecuteCommand or log-read permissions.
Model output from untrusted input. Check it before you act on it.
There was a problem hiding this comment.
Not changing this in this PR:
- CloudWatch Logs encrypts all log groups at rest by default (AWS-owned key), and the exec channel itself is TLS. A customer KMS key would add only key-policy-based access control.
- The people who can read
ecslogsare theinfrastructuregroup and the admins. They can already read the same secrets from Secrets Manager and open exec sessions themselves, so a separate key does not narrow access. - Container stdout in this group can already include the same data.
If we later want exec audit logs with their own retention or a narrower reader set, a dedicated /ecs/exec-sessions group is a small follow-up.
🤖 Generated with Claude Code
🟡 Clear to proceed: Claude of Duty logged 1 item to considerMission: Review the code. Protect the branch. Deploy the future. Note 1 finding to consider. It does not block this PR.
Run 45231806613, attempt 1 for head Claude of Duty never approves a PR. A human reviewer gives the final approval. 📋 Full review record: reasons, checks, signals, finding details, model summaries, token usageReviewed snapshot
Reasons the gate failed None. No reason applies. Checks (code, no model)
Signals (context only, never block) None. Dependency changes None. Finding details
Blocking is decided by code from category and severity, never by the model. A finding in a blocking category blocks only at high or critical severity.
The Review pass completed and reported no findings. The Supply chain pass completed and reported no findings. Model summaries
Token usage
|
Summary
python_backend_prod,python_backend_stagingandpybot_prod(enable_execute_command = true).python_backend_${env},pybot_${env}) with thessmmessagesactions and log write access. These tasks had no task role before.execute_command_configuration: loggingOVERRIDEto the existingecslogsgroup. Exec session streams are namedecs-execute-command-*.Access
Only principals with
ecs:ExecuteCommandcan open a session. Today that is theinfrastructureIAM group (AmazonECS_FullAccess) and the admins. No CI principal (GitHubActions-ECR-Push,circleci,python-backend) hasecsorssmpermissions. IAM users and groups are not managed in this repo.Already applied and verified
Applied locally (staging first, then prod). On each service the task rolled, with about 1 minute of outage (
minimumHealthyPercent=0).print(1)via exec111🤖 Generated with Claude Code