Repository navigation
Restrict submissions to S3 role permissions - #2324
Merged
Merged
Conversation
The runner assumes this role only to put submission files into a department's bucket and to copy uploaded files there from our file upload bucket. It does not need any other S3 actions. Deleting uploaded files afterwards uses the runner task role, not this one. Departments choose the destination bucket and grant us s3:PutObject in their bucket policy, so PutObject has to stay open to every bucket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The permissions match the described delivery operations, with no unresolved findings.
0 open findings
What changed in this PR
Narrows the runner’s S3 submission role permissions to the operations needed for delivery.
Changes:
- Replaces
s3:*withs3:PutObjectfor department-selected destinations. - Limits
s3:GetObjectto the file upload bucket for copying uploaded files.
| File | Description |
|---|---|
| infra/modules/forms-runner/submissions-to-s3.tf | Restricts the submission role’s S3 actions and read scope. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
stephencdaly
requested changes
Oct 16, 2026
stephencdaly
approved these changes
Oct 16, 2026
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.
What problem does this pull request solve?
The runner assumes the
govuk-forms-submissions-to-s3-<env>role to deliver submissions to a department's S3 bucket. The role's policy alloweds3:*on every bucket, but the runner only uses it for two calls inS3SubmissionService:put_objectwrites the submission CSV or JSON to the department's bucketcopy_objectcopies uploaded files from our file upload bucket into the department's bucketThis change replaces the wildcard with
s3:PutObjecton any object, ands3:GetObjecton objects in our file upload bucket only. Deleting uploaded files afterwards uses the runner task role, so this role doesn't need delete permissions.PutObjectstill has to apply to every bucket because departments choose the destination bucket. Their bucket policy grants us onlys3:PutObject, as described in the wiki guide on setting up S3 submissions.Tested this in dev - and the file upload and submission to S3 still work.