Description
Cloud Storage Object Versioning lets you recover earlier generations of production data, deployment artifacts and backups. If versioning is off, check whether soft delete or a separate backup covers the same recovery window.
Potential impact
Lifecycle expiration or deletion by an authorized user can remove a needed generation. Keeping every generation indefinitely also adds storage costs.
Remediation
- Set
versioning.enabled: truewhen you need to retain previous generations. Test restoring one to the original object name. - Review soft delete, lifecycle and retention policies together. Restrict who can delete a generation or the entire bucket.
Examples
These excerpts use the legacy Deployment Manager format. Apply the policy through a supported tool with your bucket name and the remaining required settings.
Before
yaml
resources:
- name: bucket
type: storage.v1.bucket
properties:
name: my-bucket
After
yaml
resources:
- name: bucket
type: storage.v1.bucket
properties:
name: my-bucket
versioning:
enabled: true
Explanation:
- Before: The template names the bucket and omits versioning. Check the effective policy on an existing bucket.
- After: Subsequent overwrites or deletions without a generation number retain the old live generation. Enabling the setting cannot recover data already permanently deleted.