apply-object-lock-for-immutable-retention
Use when ransomware or a rogue operator could delete backups. Applies WORM object-lock or legal hold so backups cannot be altered or deleted inside a retention window.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- apply-object-lock-for-immutable-retention
- description
- Use when ransomware or a rogue operator could delete backups. Applies WORM object-lock or legal hold so backups cannot be altered or deleted inside a retention window.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md367 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Apply Object Lock for Immutable Retention
An attacker with delete rights owns your backups. Write-once-read-many locking makes objects unchangeable for a fixed window, so the only copy that survives a compromise is one the compromised credentials cannot touch.
Procedure
- Decide the failure you are countering: ransomware, disgruntled admin, accidental bulk delete. All require immutability, not just versioning.
- Object Lock can only be enabled at bucket creation:
aws s3api create-bucket --bucket acme-vault --object-lock-enabled-for-bucket. - Set a default retention so every write is locked without per-object work:
aws s3api put-object-lock-configuration --bucket acme-vault --object-lock-configuration '{"ObjectLockEnabled":"Enabled","Rule":{"DefaultRetention":{"Mode":"COMPLIANCE","Days":90}}}'. - Choose the mode deliberately. GOVERNANCE can be overridden with
s3:BypassGovernanceRetention; COMPLIANCE cannot be shortened by anyone, including root — set the window carefully. - For a record under litigation, apply a legal hold instead of or alongside retention; a hold has no expiry and survives until removed.
- Keep the write credential separate from the delete/read credential, in a different account or role with no retention-bypass permission.
- Verify a locked object:
aws s3api get-object-retention --bucket acme-vault --key backup.tarreturns the mode andRetainUntilDate. - Attempt a delete as the backup role and confirm it is refused:
aws s3api delete-object ...should returnAccessDenied.
Pitfalls
- Trying to enable Object Lock after the bucket exists — it cannot be added retroactively; plan the vault bucket upfront.
- COMPLIANCE mode with a too-long window set by mistake; nobody, not even support, can shorten it, so bytes are billed for the full term.
- Relying on GOVERNANCE mode without removing
BypassGovernanceRetentionfrom the backup role's policy; the lock is then advisory. - Assuming the lock protects the IAM and KMS paths; a credential that can delete the customer KMS key can still make the data unreadable.
- Forgetting that a legal hold blocks deletion even after retention expires, stalling cleanup until someone removes it.
- Locking the entire bucket including scratch areas you need to rotate, forcing a new bucket and a migration.
- Not replicating the vault to a second account, so a compromised root on the vault account can still act within what the policy allows.
Verification
aws s3api get-object-lock-configuration --bucket acme-vault
aws s3api get-object-retention --bucket acme-vault --key backup.tar
# deletion as the backup role must fail
aws s3api delete-object --bucket acme-vault --key backup.tar # expect AccessDenied
Object Lock is Enabled with the intended mode and term, a sample object reports its RetainUntilDate, and deletion by the write role is refused.
Report: "Object Lock COMPLIANCE/90d on <vault>; deletion by backup role returns AccessDenied; lock config id <id>."
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.