Skip to content

fix(api): redact runtime env in container action responses - #1303

Merged
scttbnsn merged 3 commits into
dev/v1.7from
fix/v1.7-action-response-redaction
Oct 4, 2026
Merged

scttbnsn merged 3 commits into
dev/v1.7from
fix/v1.7-action-response-redaction

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Container start, stop and restart responses returned the stored container without runtime env redaction, so their result carried sensitive details.env values that the detail, list and update endpoints replace with [REDACTED]. The action response now goes through redactContainerRuntimeEnv like the rest.

A new test stores a container with DB_PASSWORD and LOG_LEVEL in its env and checks all three actions return the password redacted and flagged sensitive, with the plain value nowhere in the payload. I checked the other container-returning responses in app/api/ and they already redact.

🔒 Redact runtime environment values in start, stop, and restart responses with redactContainerRuntimeEnv.
✨ Add parameterized tests for all three actions. Verify sensitive values are redacted, non-sensitive values remain visible, and the original secret is absent from the response.

  • Test execution status is not available.
  • No current review findings were supplied.

@vercel

vercel Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drydock-website Ready Ready Preview Oct 4, 2026 1:14pm UTC
drydockdemo-website Ready Ready Preview Oct 4, 2026 1:14pm UTC

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
⚙️ Run configuration
  • Configuration used: Repository: CodesWhat/drydock/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15b4314b-0e29-4c01-a332-1578e6fd8d14
📥 Commits

Reviewing files that changed from the base of the PR and between d62588c and a2a79d7.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: CodesWhat/drydock/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 97a1b134-919f-41c0-9cd6-2e70b3a2a476
📥 Commits

Reviewing files that changed from the base of the PR and between d565115 and fe3f506.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (2)
  • app/api/container-actions.test.ts
  • app/api/container-actions.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

Successful start, stop, and restart responses now pass the returned container through redactContainerRuntimeEnv before including it as result. Tests verify that DB_PASSWORD is redacted and marked sensitive, LOG_LEVEL remains unchanged, and the original secret is absent from the serialized response.

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to d6258

Start, stop, and restart responses redact sensitive environment values, with tests confirming the secret is not returned. No material merge-blocking risk is established.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to fe3f5

The change reduces sensitive-value disclosure without expanding action permissions or changing container lifecycle behavior. No material security risk was found introduced or worsened in the assessed response path.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The changed disclosure boundary is the returned container result for start, stop and restart actions. New assertions cover password masking and preservation of a non-sensitive value for all three actions.

Security Findings and Attack Paths

  • observed — The inspected pre-change response exposed stored runtime environment values to callers permitted to invoke the action. Head reduces that exposure by applying the established classifier at the response sink; the comparison did not identify an introduced or worsened attack path.

Trust Boundaries and Controls

  • observed — The production container router is mounted after authentication and same-origin mutation protection. Container lookup, the feature gate and Docker trigger selection remain unchanged; response sanitization does not grant additional action authority.

Resilience and Maintainability Implications

  • inferred — Because sanitization occurs after lifecycle bookkeeping and does not write to the store, it does not introduce a new persistent transition, reservation or cleanup obligation. Existing concurrency and interruption behavior is preserved rather than strengthened.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch was successfully deployed

2 active deployments
Preview – drydockdemo-website — a2a79d7d Deployed Oct 4, 2026 by vercel[bot]
Preview – drydock-website — a2a79d7d Deployed Oct 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant