mukul975/privacy-data-protection-skills

cloud-retention-config

- Configures cloud storage retention policies across AWS S3, Azure Blob Storage, and Google Cloud Storage.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill cloud-retention-config

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Cloud Storage Retention Configuration

Overview

Cloud storage platforms provide native retention and lifecycle management features that can enforce data retention schedules at the infrastructure level. Proper configuration ensures that personal data stored in cloud environments is automatically transitioned, archived, or deleted according to retention policies, while legal hold and object lock features prevent premature deletion of data subject to regulatory or litigation requirements. This skill covers configuration for the three major cloud platforms: AWS S3, Microsoft Azure Blob Storage, and Google Cloud Storage.

Legal Context

GDPR Article 5(1)(e) — Storage Limitation

Cloud storage retention policies are a technical implementation of the storage limitation principle, ensuring data is not retained beyond the period necessary for processing purposes.

GDPR Article 32 — Security of Processing

Retention configuration must include appropriate security measures, including encryption at rest, access controls, and audit logging for all retention-related operations.

GDPR Article 25 — Data Protection by Design and by Default

Cloud retention policies should be configured as default settings on all storage resources, rather than applied retroactively.

AWS S3 Lifecycle and Retention Configuration

S3 Lifecycle Rules

S3 Lifecycle rules automate transitions between storage classes and object expiration:

Lifecycle Rule Configuration for Orion Data Vault Corp

Rule NamePrefix/Tag FilterTransitionExpirationPurpose
customer-data-lifecycleprefix: customer-data/90 days → S3 Glacier Instant Retrieval; 365 days → S3 Glacier Deep Archive2,190 days (6 years)Customer transaction records — HMRC retention
marketing-data-lifecycletag: data-category=marketing180 days → S3 Intelligent-Tiering730 days (2 years)Marketing contact data — consent-based retention
analytics-data-lifecycleprefix: analytics/90 days → S3 Glacier Instant Retrieval790 days (26 months)Website analytics — ICO/CNIL recommended period
cctv-footage-lifecycleprefix: cctv/None30 daysCCTV footage — ICO CCTV Code of Practice
applicant-data-lifecycleprefix: recruitment/None180 days (6 months)Unsuccessful job applicant data
financial-records-lifecycleprefix: finance/365 days → S3 Glacier Deep Archive2,190 days (6 years)Financial and tax records — Companies Act 2006
employee-records-lifecycletag: data-category=employee730 days → S3 Glacier Deep ArchiveControlled by HR system (employment + 6 years)Employee HR records

S3 Lifecycle Rule — JSON Configuration Example

json
{
  "Rules": [
    {
      "ID": "customer-data-lifecycle",
      "Filter": {
        "Prefix": "customer-data/"
      },
      "Status": "Enabled",
      "Transitions": [
        {
          "Days": 90,
          "StorageClass": "GLACIER_IR"
        },
        {
          "Days": 365,
          "StorageClass": "DEEP_ARCHIVE"
        }
      ],
      "Expiration": {
        "Days": 2190
      },
      "NoncurrentVersionTransitions": [
        {
          "NoncurrentDays": 30,
          "StorageClass": "GLACIER_IR"
        }
      ],
      "NoncurrentVersionExpiration": {
        "NoncurrentDays": 2190
      }
    }
  ]
}

S3 Object Lock

S3 Object Lock prevents objects from being deleted or overwritten for a fixed retention period or indefinitely. It operates in two modes:

ModeBehaviourUse Case at Orion Data Vault Corp
Governance ModePrevents deletion by most users; users with s3:BypassGovernanceRetention permission can overrideStandard retention enforcement — allows DPO-approved early deletion for valid Art. 17 requests
Compliance ModePrevents deletion by ALL users, including root account, for the entire retention periodRegulatory records where deletion before expiry is legally prohibited (e.g., AML records under MLR 2017)

Object Lock Configuration

json
{
  "ObjectLockConfiguration": {
    "ObjectLockEnabled": "Enabled",
    "Rule": {
      "DefaultRetention": {
        "Mode": "GOVERNANCE",
        "Days": 2190
      }
    }
  }
}

Critical consideration for GDPR erasure: If using Compliance Mode, data subject erasure requests under Art. 17 cannot be fulfilled until the retention period expires. Use Governance Mode for data categories where erasure requests are possible, and reserve Compliance Mode only for data with mandatory statutory retention that overrides the right to erasure under Art. 17(3)(b).

S3 Legal Hold

Legal hold is an independent, on/off flag that prevents object deletion regardless of retention settings:

aws s3api put-object-legal-hold \
  --bucket orion-data-vault-regulated \
  --key customer-data/2024/transaction-batch-0142.parquet \
  --legal-hold Status=ON

Legal hold must be:

  • Applied immediately upon receipt of a litigation hold notice
  • Tracked in the litigation hold management register (cross-reference: litigation-hold-mgmt skill)
  • Removed only upon written authorization from Legal counsel
  • Auditable — all legal hold changes logged via CloudTrail

Microsoft Azure Blob Storage Retention

Immutability Policies

Azure Blob Storage supports immutability policies at the container level:

Policy TypeBehaviourConfiguration
Time-based retentionPrevents modification and deletion for a specified intervalSet retention interval in days; can be locked (irreversible) or unlocked
Legal holdPrevents modification and deletion until all legal hold tags are clearedApply named legal hold tags; multiple holds can coexist

Time-Based Retention Policy Configuration

json
{
  "properties": {
    "immutabilityPeriodSinceCreationInDays": 2190,
    "allowProtectedAppendWrites": true,
    "allowProtectedAppendWritesAll": false
  }
}

Azure Lifecycle Management Rules

json
{
  "rules": [
    {
      "enabled": true,
      "name": "customer-data-retention",
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": ["blockBlob"],
          "prefixMatch": ["customer-data/"]
        },
        "actions": {
          "baseBlob": {
            "tierToCool": {
              "daysAfterModificationGreaterThan": 90
            },
            "tierToArchive": {
              "daysAfterModificationGreaterThan": 365
            },
            "delete": {
              "daysAfterModificationGreaterThan": 2190
            }
          },
          "snapshot": {
            "delete": {
              "daysAfterCreationGreaterThan": 2190
            }
          }
        }
      }
    },
    {
      "enabled": true,
      "name": "analytics-data-retention",
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": ["blockBlob"],
          "prefixMatch": ["analytics/"]
        },
        "actions": {
          "baseBlob": {
            "tierToCool": {
              "daysAfterModificationGreaterThan": 90
            },
            "delete": {
              "daysAfterModificationGreaterThan": 790
            }
          }
        }
      }
    }
  ]
}

Azure Legal Hold

az storage container legal-hold set \
  --account-name oriondatavault \
  --container-name regulated-data \
  --tags "litigation-2026-001" "regulatory-investigation-2026-003"

Azure Versioning and Soft Delete Interaction

When configuring retention, account for Azure's soft delete and versioning features:

FeatureRetention ImpactRecommended Setting
Blob soft deleteDeleted blobs retained for recovery periodSet to 14 days — ensure actual deletion occurs after soft delete period
Container soft deleteDeleted containers retained for recoverySet to 14 days
Blob versioningPrevious versions retainedApply lifecycle rules to versions; ensure expired versions are deleted

Google Cloud Storage Retention

Bucket-Level Retention Policy

GCP applies retention policies at the bucket level. Objects cannot be deleted or overwritten until the retention period expires:

json
{
  "retentionPolicy": {
    "retentionPeriod": "189216000",
    "isLocked": false
  }
}

The retentionPeriod is specified in seconds. Common values:

Retention PeriodSecondsUse Case
30 days2,592,000CCTV footage
6 months15,552,000Unsuccessful applicant data
26 months68,256,000Analytics data
2 years63,072,000Marketing data
6 years189,216,000Financial/tax records
7 years220,752,000Audit records

Locking a Retention Policy

gcloud storage buckets update gs://orion-regulated-finance \
  --lock-retention-policy

Warning: Locking a retention policy is IRREVERSIBLE. Once locked, the retention period cannot be reduced or removed. The bucket cannot be deleted until every object in it has met its retention period. Only lock policies for data categories with absolute statutory retention requirements that override Art. 17 rights.

GCP Object Hold

Hold TypeBehaviourUse Case
Temporary holdPrevents deletion; can be removed at any timeArt. 17 request pauses (assessment period); temporary preservation
Event-based holdPrevents deletion until the hold is released; retention period begins on hold releaseData where retention period starts from a future event (e.g., contract termination)
gcloud storage objects update gs://orion-regulated-data/customer-data/batch-0142.parquet \
  --temporary-hold

GCP Lifecycle Rules

json
{
  "lifecycle": {
    "rule": [
      {
        "action": {
          "type": "SetStorageClass",
          "storageClass": "NEARLINE"
        },
        "condition": {
          "age": 90,
          "matchesPrefix": ["customer-data/"]
        }
      },
      {
        "action": {
          "type": "SetStorageClass",
          "storageClass": "ARCHIVE"
        },
        "condition": {
          "age": 365,
          "matchesPrefix": ["customer-data/"]
        }
      },
      {
        "action": {
          "type": "Delete"
        },
        "condition": {
          "age": 2190,
          "matchesPrefix": ["customer-data/"]
        }
      }
    ]
  }
}

Cross-Region Replication Retention Alignment

When data is replicated across regions for availability or disaster recovery, retention policies must be aligned:

Alignment Requirements

  1. Identical retention periods: Replicated data in the destination region must have the same retention period as the source.
  2. Synchronized lifecycle rules: Lifecycle transitions and expirations must be configured identically on source and destination buckets/containers.
  3. Legal hold propagation: Legal holds applied in the source must also be applied in the destination. Configure automated propagation.
  4. Deletion propagation: When an object expires or is deleted in the source, the replica must also be deleted. Configure replication to handle delete markers.
  5. Jurisdictional considerations: If the destination region is in a different jurisdiction, confirm that the applicable retention requirements in that jurisdiction do not conflict with the source retention period.

Cross-Region Configuration Checklist

CheckAWSAzureGCP
Lifecycle rules match sourceApply identical S3 lifecycle rules to destination bucketApply identical lifecycle management policy to destination containerApply identical lifecycle rules to destination bucket
Retention/lock settings matchConfigure identical Object Lock settings on destinationApply identical immutability policy to destinationApply identical retention policy to destination
Delete marker replicationEnable DeleteMarkerReplication in replication configEnable blob change feed and handle deletesConfigure bucket notifications for deletion events
Legal hold synchronizationUse Lambda triggered by CloudTrail to propagate legal holdsUse Event Grid + Azure Function to propagate legal holdsUse Cloud Functions triggered by audit logs to propagate holds
MonitoringCloudWatch metrics on replication lagAzure Monitor replication metricsCloud Monitoring replication metrics

Compliance Monitoring

Monthly Cloud Retention Audit

  1. Policy drift detection: Compare active lifecycle rules and retention policies against the approved retention schedule. Flag any discrepancies.
  2. Coverage verification: Confirm that all storage buckets/containers holding personal data have applicable retention policies.
  3. Legal hold inventory: List all active legal holds across all cloud platforms. Cross-reference with the litigation hold register to identify holds that should have been released.
  4. Expiration verification: Sample recently expired objects to confirm they were actually deleted (not just transitioned or soft-deleted).
  5. Cross-region consistency: Verify that replicated buckets/containers maintain identical retention configuration.

Alert Configuration

AlertConditionAction
Policy removedRetention policy or lifecycle rule deleted from a regulated bucketImmediate alert to Cloud Security + DPO
Object lock bypasss3:BypassGovernanceRetention usedAlert to DPO; verify authorized deletion
Legal hold changeLegal hold applied or removedLog to litigation hold register; alert Legal
Retention policy unlock attemptAttempt to modify locked retention policyAlert to Cloud Security (should fail — investigate)
Replication lag > 24hCross-region replication behind by more than 24 hoursAlert IT Operations — potential retention gap in DR region

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
mukul975
커뮤니티

applying-privacy-design-patterns

- Systematic application of the eight privacy design patterns per Hoepman: minimize, hide, separate, abstract, inform, control, enforce, and demonstrate. Covers pattern selection methodology per processing activity, mapping to GDPR principles, and practical implementation guidance for privacy-by-design system architecture.

설치 수
1
GitHub Stars
315
업데이트
3월 16일
mukul975
커뮤니티

brazil-lgpd

- Guides compliance with Brazil's Lei Geral de Proteção de Dados (LGPD, Lei 13.709/2018). Covers the 10 lawful bases under Art. 7, DPO appointment, ANPD enforcement, data subject rights under Arts. 17-22, and international transfer mechanisms. Keywords: LGPD, Brazil data protection, ANPD, lawful bases, data subject rights, international transfers.

설치 수
1
GitHub Stars
315
업데이트
3월 16일
mukul975
커뮤니티

adequacy-assessment

- Guides assessment of third-country adequacy decisions under GDPR Article 45 for international data transfers. Covers the current EC adequacy decisions list, adequacy assessment criteria, partial adequacy handling, and monitoring of adequacy decision reviews. Keywords: adequacy decision, Article 45, third country, adequate protection, EC adequacy list.

설치 수
1
GitHub Stars
295
업데이트
3월 16일
mukul975
커뮤니티

age-gating-services

- Implements age-gating mechanisms for online services to restrict access based on user age. Covers hard gates versus soft gates, neutral age prompts, re-verification triggers, circumvention prevention, and regulatory requirements under GDPR, COPPA, UK Online Safety Act, and DSA. Keywords: age gate, age restriction, neutral prompt, children, online services, access control.

설치 수
1
GitHub Stars
295
업데이트
3월 16일