13.2 Data Integrity Protection: Object Lock, Vault Lock & Code Signing
Key Takeaways
S3 Object Lock enforces Write Once, Read Many (WORM) storage at the individual object version level, requiring S3 Versioning and preventing deletion or modification under Governance Mode or Compliance Mode.
Governance Mode permits privileged IAM principals with s3:BypassGovernanceRetention and the bypass header to alter retention periods or delete locked object versions, whereas Compliance Mode strictly prohibits alteration or deletion by any principal—including the AWS account root user—until retention expires.
S3 Legal Holds apply an indefinite, non-expiring lock on specific object versions independently of retention dates, requiring the s3:PutObjectLegalHold permission to place or remove.
Glacier Vault Lock (in the original vault-based Amazon Glacier service, closed to new customers since December 15, 2025) locks a vault policy through a two-step process with a 24-hour test window, after which it is irreversible.
AWS Signer provides managed cryptographic signing for Lambda functions and container images; Lambda Code Signing Configurations enforce supply chain integrity by warning or blocking deployment of unsigned or untrusted code.
13.2 Data Integrity Protection: Object Lock, Vault Lock & Code Signing
In mission-critical enterprise environments, preventing unauthorized data modification, tampering, and deletion is just as critical as enforcing confidentiality. Regulated sectors—such as financial institutions governed by SEC Rule 17a-4(f), FINRA Rule 4511, and CFTC 1.31, healthcare systems governed by HIPAA, and government organizations following NIST SP 800-53—mandate Write Once, Read Many (WORM) storage guarantees. Under WORM compliance, records committed to storage must remain strictly immutable, tamper-evident, and protected against deletion for mandated retention periods.
AWS provides native, certifiable WORM storage across hot and cold storage tiers through Amazon S3 Object Lock and Amazon S3 Glacier Vault Lock. Furthermore, to extend cryptographic integrity guarantees into the application execution tier, AWS Signer coordinates with AWS Lambda Code Signing Configurations (CSC) and container registries to ensure that only verified, cryptographically signed binaries execute in production.
Amazon S3 Object Lock Architecture & WORM Storage
Amazon S3 Object Lock implements immutable WORM storage for objects residing within standard S3 storage classes. It prevents objects from being deleted or overwritten for a fixed retention period or indefinitely via legal holds.
Mandatory Architectural Prerequisites
- S3 Versioning Mandatory: S3 Object Lock operates exclusively on object versions. S3 Versioning is automatically enabled and permanently locked when Object Lock is enabled on a bucket. S3 Versioning cannot be suspended on an Object Lock-enabled bucket.
- Bucket-Level Activation: Object Lock can be enabled when a bucket is created or, for an existing bucket, with
PutObjectLockConfiguration(console, CLI, or API) once Versioning is enabled; no AWS Support request is needed. Objects already in the bucket are not locked automatically, so apply retention to them with S3 Batch Operations if required. Once enabled on a bucket, Object Lock cannot be disabled. - Granular Version Locking: When an application writes an object to an Object Lock-enabled bucket, the lock configuration applies to that specific version ID. If a client uploads a new object with the identical key name, S3 does not overwrite the locked version; it simply creates a newer, distinct version ID, keeping the older locked version completely intact.
Retention Modes: Governance Mode vs. Compliance Mode
S3 Object Lock provides two distinct retention modes that establish the operational strength of the WORM boundary:
1. Governance Mode
In Governance Mode, object versions are shielded against deletion, overwriting, and retention period truncation by standard IAM users and roles.
- Privileged Override (
s3:BypassGovernanceRetention): A user possessing the specific IAM permissions3:BypassGovernanceRetentioncan override Governance Mode. To delete a locked version or reduce its retention period, the caller must explicitly pass the request headerx-amz-bypass-governance-retention: truein their API request. - Use Case: Protecting critical records against accidental deletion or rogue user actions while preserving administrative flexibility for authorized compliance officers to purge data if business requirements change.
2. Compliance Mode
In Compliance Mode, object versions are protected by an absolute, non-negotiable cryptographic lock.
- Inviolable by Any Principal: Nobody—including the AWS account root user, organization administrators, or AWS Support engineers—can overwrite or delete a locked object version during its retention period.
- Unshortenable Retention Period: The retention period cannot be decreased under any circumstances. It can only be extended to a later date.
- Bucket Deletion Barrier: An S3 bucket containing objects locked under active Compliance Mode cannot be deleted, even by the root user, until all retention periods on all object versions have fully expired.
- Regulatory Adherence: Fully vetted and certified for SEC 17a-4(f), FINRA 4511, and CFTC 1.31 compliance.
Comparison: Governance Mode vs. Compliance Mode
| Operational Characteristic | Governance Mode | Compliance Mode |
|---|---|---|
| Root User Can Delete? | Yes (If passing bypass header) | NO (Strictly blocked) |
| IAM Administrator Can Delete? | Yes (Requires s3:BypassGovernanceRetention) | NO (Strictly blocked) |
| Can Retention Period Be Shortened? | Yes (With bypass permission) | NO (Can only be extended) |
| Can Mode Be Converted? | Can convert to Compliance Mode | Cannot convert to Governance Mode |
| Primary Threat Model | Accidental internal deletion / Operator error | Ransomware / Rogue admin / Legal discovery |
| Regulatory Certification | Internal organizational governance | SEC Rule 17a-4(f), FINRA, CFTC |
S3 Legal Holds: Mechanics & Operational Governance
While retention periods enforce immutability based on deterministic calendar timestamps (e.g., retain for 7 years), legal discovery and regulatory audits frequently demand immediate, open-ended data preservation pending the resolution of litigation or investigations.
- Indefinite Duration: An S3 Legal Hold does not have an expiration timestamp. Once placed on an object version, it remains locked until explicitly removed.
- Binary Status: A Legal Hold is either
ONorOFF. It is applied via thePutObjectLegalHoldAPI. - Decoupled from Retention Periods: Legal Holds operate independently of Governance and Compliance retention modes. An object version can have both a retention period and a Legal Hold simultaneously. If a 3-year Compliance retention period expires but a Legal Hold remains
ON, the object remains strictly undeletable. - IAM Authorization: Placing or removing a legal hold requires the explicit IAM permission
s3:PutObjectLegalHold. Organizations typically restrict this action to legal and corporate compliance roles.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RestrictLegalHoldManagementToComplianceOfficer",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:role/ChiefComplianceOfficer"
},
"Action": [
"s3:PutObjectLegalHold",
"s3:GetObjectLegalHold"
],
"Resource": "arn:aws:s3:::litigation-hold-records/*"
}
]
}
Amazon S3 Glacier Vault Lock Architecture
Note
The original vault-based Amazon Glacier service (separate from the S3 Glacier storage classes) stopped accepting new customers on December 15, 2025. Existing vault users keep full access, including Vault Lock. For new archives, use the S3 Glacier storage classes with S3 Object Lock, or AWS Backup Vault Lock.
For long-term archival storage, Amazon S3 Glacier Vault Lock allows security engineers to deploy and lock compliance policies directly on individual S3 Glacier vaults. Vault Lock enforces compliance controls (such as denying deletion of archives before a mandatory 10-year holding period) that cannot be altered or overwritten once locked.
The Two-Step Locking Workflow & 24-Hour Window
To prevent administrative lockouts caused by syntax errors or accidental policy misconfigurations, Glacier Vault Lock implements an ironclad two-step workflow:
- Step 1:
InitiateVaultLock:- The administrator attaches a proposed Vault Lock policy document to the target vault.
- Glacier places the policy in an
InProgressstate and generates a uniqueLockId. - Glacier initiates a mandatory 24-hour testing countdown.
- Step 2: Testing & Validation:
- During the 24-hour window, the policy is enforced, allowing the administrator to test compliance rules against test archives.
- If the policy contains an error, the administrator can call
AbortVaultLockusing theLockId, which immediately terminates the lock process and purges the in-progress policy.
- Step 3:
CompleteVaultLock:- Within 24 hours of initiation, the administrator must call
CompleteVaultLockspecifying the exactLockId. - Once completed, the vault lock transitions to the
Lockedstate. - Permanent Immutability: Once in the
Lockedstate, the Vault Lock policy cannot be modified, deleted, or overridden by anyone—including the AWS account root user. - Timeout Expiration: If 24 hours elapse without calling
CompleteVaultLock, the lock state expires automatically, and the in-progress policy is purged.
- Within 24 hours of initiation, the administrator must call
Glacier Vault Lock Policy Example
The following policy locks an Amazon S3 Glacier vault to deny the deletion of any archive that has been stored for less than 3,650 days (10 years):
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyPrematureArchiveDeletion",
"Effect": "Deny",
"Principal": "*",
"Action": "glacier:DeleteArchive",
"Resource": "arn:aws:glacier:us-east-1:123456789012:vaults/legal-archive-vault",
"Condition": {
"NumericLessThan": {
"glacier:ArchiveAgeInDays": "3650"
}
}
}
]
}
AWS Signer: Code Signing, Container Integrity & Platform Enforcement
Data integrity extends beyond static storage into the software supply chain. Malicious actors frequently attempt to inject tampered code into continuous integration/continuous deployment (CI/CD) pipelines or deploy backdoored container images. AWS Signer is a fully managed code-signing service that establishes cryptographic authenticity, integrity, and non-repudiation for code artifacts.
Key Concepts of AWS Signer
- Signing Profile: A template that defines cryptographic parameters, including the target platform (e.g.,
AWSLambda-SHA384-ECDSA,Notation-OCI-SHA384-ECDSA), signing key validity period, and signature validity period (default 135 months or custom). - Signing Job: The automated operation where AWS Signer takes an unsigned payload from Amazon S3 or a container registry, applies a digital signature using the managed private key associated with the signing profile, and writes the signed artifact and signature metadata to the target destination.
- Revocation: If a signing profile's integrity is questioned, administrators can revoke the profile. AWS Signer supports setting an effective revocation date, allowing signatures created before a specific timestamp to remain valid while immediately invalidating signatures generated after the compromise.
AWS Lambda Code Signing Configurations (CSC)
To enforce that only verified code runs in AWS Lambda, security teams attach a Code Signing Configuration (CSC) to the Lambda function. The CSC specifies two critical parameters:
- Allowed Signing Profiles: A list of up to 20 AWS Signer signing profile ARNs that are authorized to sign code for the function.
- Signature Validation Policy (Untrusted Artifact Action):
Warn: If a deployment package is unsigned, has an invalid signature, or was signed by an unauthorized profile, Lambda logs a warning metric to Amazon CloudWatch and allows the deployment to proceed. (Primarily used for testing/auditing).Enforce: If the deployment package fails signature verification or lacks a valid signature from an allowed profile, Lambda blocks the deployment immediately, returning anInvalidCodeSignatureException.
{
"CodeSigningConfig": {
"CodeSigningConfigArn": "arn:aws:lambda:us-east-1:123456789012:code-signing-config:csc-0123456789abcdef0",
"CodeSigningConfigId": "csc-0123456789abcdef0",
"AllowedPublishers": {
"SigningProfileVersionArns": [
"arn:aws:signer:us-east-1:123456789012:/signing-profiles/ProductionReleaseProfile/v1"
]
},
"CodeSigningPolicies": {
"UntrustedArtifactOnDeployment": "Enforce"
}
}
}
Comparison: S3 Object Lock vs. Glacier Vault Lock vs. AWS Backup Vault Lock
| Capability | S3 Object Lock | S3 Glacier Vault Lock | AWS Backup Vault Lock |
|---|---|---|---|
| Target Resource | S3 Object Versions (Hot/Warm) | Glacier Vault Archives (Cold) | AWS Backup Recovery Points (EBS, RDS, EFS, S3, etc.) |
| Prerequisites | S3 Versioning must be enabled | S3 Glacier Vault creation | AWS Backup Vault creation |
| Modes Supported | Governance & Compliance | Compliance (Once locked) | Governance & Compliance |
| Test / Abort Window | None (Direct application) | 24-hour test window | Min 3-day (72h) grace period (Compliance mode) |
| Root User Inviolability | Yes (Under Compliance Mode) | Yes (Under Locked state) | Yes (Under Compliance Mode) |
| Legal Hold Support | Yes (Indefinite binary flag) | No (Handled via policy dates) | No (Handled via retention dates) |
| Retention Limits | Days or Years | Days or Years | Min and Max Retention Days |
Specialty Exam Pitfalls & Architectural Traps
- Attempting Object Lock on Suspended Versioning: Assuming Object Lock can function on an S3 bucket with versioning suspended or disabled. S3 Object Lock binds cryptographic immutability directly to specific object version IDs. Enabling Object Lock permanently enforces Versioning.
- The Root User Compliance Override Myth: Believing that the AWS account root user or a support ticket to AWS Support can delete an object locked under S3 Object Lock Compliance Mode or an archive under a locked Glacier Vault Lock. Neither the root user nor AWS engineering possesses a backdoor mechanism to bypass Compliance mode locks.
- Glacier Vault Lock 24-Hour Expiration: Forgetting to call
CompleteVaultLockwithin 24 hours of callingInitiateVaultLock. If the 24-hour window lapses without completion, the lock state expires, and the proposed compliance policy is discarded completely. - Lambda Code Signing Configured with
Warn: Assuming that creating a Code Signing Configuration automatically prevents unsigned code from deploying. If the untrusted artifact action is set toWarn, untrusted or tampered code will still deploy and execute in production. High-security environments must explicitly configureEnforce.
A financial brokerage must retain customer trade confirmations in an Amazon S3 bucket for exactly seven years to satisfy SEC Rule 17a-4(f). The compliance policy dictates that during this seven-year window, records must never be overwritten, modified, or deleted by any individual, including systems administrators and the AWS account root user. Furthermore, the firm must ensure that even if an administrator account is compromised by ransomware, the data cannot be destroyed. Which configuration satisfies these regulatory requirements?
Enable S3 Object Lock in Governance Mode with a 7-year default retention period and require MFA Delete on the S3 bucket.
Enable S3 Object Lock in Compliance Mode with a 7-year retention period applied to all uploaded trade confirmation objects.
Configure an S3 bucket policy denying s3:DeleteObject and s3:DeleteObjectVersion to all principals except the AWS account root user.
Create an Amazon S3 Glacier vault with a standard vault access policy denying glacier:DeleteArchive for 2,555 days.
A security engineer is configuring Amazon S3 Glacier Vault Lock on a legal archive vault to enforce a 10-year retention rule. The engineer successfully calls the InitiateVaultLock API with the compliance policy document. Two days later, after completing operational testing, the engineer attempts to lock the vault permanently by calling the CompleteVaultLock API with the original LockId, but the API returns an InvalidParameterValueException error. What is the reason for this failure?
The Vault Lock policy must be reviewed and signed by an AWS Support representative before calling CompleteVaultLock.
The engineer's IAM execution role lacked the glacier:CompleteVaultLock permission in the vault's access policy.
The mandatory 24-hour testing window expired, causing the in-progress vault lock and LockId to be discarded automatically.
Glacier Vault Lock requires Versioning to be enabled on the vault before completing the lock sequence.
A cybersecurity firm requires that all AWS Lambda functions deployed to its production AWS accounts run only verified code that has passed automated vulnerability scans and static analysis in its CI/CD pipeline. The security team uses AWS Signer to sign approved deployment packages. What combination of configurations enforces this requirement so that unauthorized or tampered code cannot execute under any circumstances?
Configure an Amazon S3 bucket policy denying s3:PutObject for Lambda deployment ZIP files unless encrypted with SSE-C.
Create an AWS Config rule that monitors Lambda function deployments and invokes an automated remediation Lambda function to delete non-compliant functions after launch.
Attach a Lambda execution role with an IAM condition checking aws:PrincipalTag against the CI/CD pipeline role.
Create a Lambda Code Signing Configuration specifying the approved AWS Signer signing profile ARNs, set the untrusted artifact action to Enforce, and attach this configuration to all production Lambda functions.
During an ongoing federal anti-fraud investigation, the SEC issues a subpoena for electronic communications stored in an Amazon S3 bucket. The target S3 objects are currently protected under S3 Object Lock Compliance Mode, but their 5-year retention period is scheduled to expire in 10 days. The legal team must ensure that the subpoenaed records are preserved indefinitely until the investigation formally concludes, without altering the existing 5-year Compliance Mode retention configuration on the rest of the bucket. What is the most operationally effective action?
Place an S3 Legal Hold on each of the specific subpoenaed object versions using the PutObjectLegalHold API.
Execute the PutObjectRetention API to switch the bucket's retention mode from Compliance Mode to Governance Mode.
Download all subpoenaed objects to an on-premises NAS server and delete the original objects from Amazon S3.
Disable S3 Versioning on the target S3 bucket to freeze all current object versions in place.
Sections you finish are checked off in the contents.