Skip to content

fix(security): weekly audit remediations for IAM, decrypt, and migrate - #113

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/repository-security-audit-2cf4
Draft

fix(security): weekly audit remediations for IAM, decrypt, and migrate#113
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/repository-security-audit-2cf4

Conversation

@cursor

@cursor cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Summary

Weekly static security audit (2026-09-07). The 2026-08-31 remediations never merged to main; this PR re-implements them and updates SECURITY_AUDIT.md.

On main this scan found: 0 Critical, 8 High, 7 Medium, 6 Low.
After this PR: 0 Critical, 3 High (operator/IAM follow-ups), 5 Medium, 5 Low.

Landed hardenings:

  • KMS: drop DisableKey from the deny (keep ScheduleKeyDeletion) so a compromised CMK can be frozen during IR
  • IAM: remove unused UpdateItem/ListBucket; scope S3 to encrypted/*; grant sts:GetCallerIdentity; encrypt the ops SNS topic with the envault CMK
  • decrypt --force and refuse overwrite before creating temp files
  • Reject DynamoDB s3_key values that are not content-addressed
  • Skip directory-symlink trees on encrypt; confine migrate paths to the import directory
  • Honor ENVAULT_AUDIT_TTL_DAYS on all event writes
  • rotate-key DescribeKey preflight; microsecond CAS tokens; dashboard last_activity paging
  • exec warns when inheriting AWS_*; close encrypt/decrypt fds if the stream fails before fdopen

Remaining (documented in SECURITY_AUDIT.md): rotation still needs a separate grant for a new CMK; old S3 versions are not a revocation primitive; --clean-env stays opt-in; state-index GSI replacement is a migration.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Chore / maintenance

Testing

  • pytest tests/unit/179 passed
  • ruff check / ruff format --check / mypy src/envault/ — clean
  • Crypto-safety and migration-safety inspectors: PASS

Checklist

  • Self-reviewed the diff
  • Added / updated tests
  • Updated documentation if needed
  • CI passes
Open in Web View Automation 

Re-implement the 2026-08-31 audit remediations that never merged, plus
fd cleanup on encrypt/decrypt temp paths. Scope S3 IAM to encrypted/*,
allow DisableKey for IR, encrypt the ops SNS topic, refuse decrypt
overwrites without --force, and confine migrate inputs to the import
directory.

Co-authored-by: Specter099 <Specter099@users.noreply.github.com>
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