askill
data-protection

data-protectionSafety 95Repository

Data classification (CIA triad), GDPR privacy by design, encryption standards, data lifecycle management

206 stars
4.1k downloads
Updated 2/22/2026

Package Files

Loading files...
SKILL.md

Data Protection Skill

Purpose

This skill provides comprehensive data protection guidance for the CIA platform, covering data classification, GDPR privacy by design, encryption standards, and data lifecycle management. It ensures political intelligence data is handled according to Hack23 ISMS classification and data protection policies.

When to Use This Skill

Apply this skill when:

  • ✅ Handling personal data of politicians or citizens
  • ✅ Designing database schemas with sensitive fields
  • ✅ Implementing data import/export functionality
  • ✅ Configuring data retention or deletion policies
  • ✅ Integrating external data sources (Riksdagen, World Bank)
  • ✅ Processing election or voting records
  • ✅ Implementing caching strategies for sensitive data

Do NOT use for:

  • ❌ Public open data with no personal information
  • ❌ Static UI component changes
  • ❌ Build system or CI/CD pipeline changes

Data Classification Framework

CIA Platform Data Categories

Classification Levels (Hack23 ISMS)
│
├─ PUBLIC
│  ├─ Parliamentary voting records
│  ├─ Published committee documents
│  ├─ Official election results
│  └─ World Bank economic indicators
│
├─ INTERNAL
│  ├─ Aggregated analysis results
│  ├─ Risk scoring algorithms
│  ├─ Platform usage analytics
│  └─ System configuration data
│
├─ CONFIDENTIAL
│  ├─ User account credentials
│  ├─ Session tokens and API keys
│  ├─ Audit logs with user actions
│  └─ Internal security assessments
│
└─ RESTRICTED
   ├─ Database credentials
   ├─ Encryption keys (KMS)
   ├─ AWS access credentials
   └─ Security incident data

Classification Decision Tree

Data Classification Decision
│
├─→ Is it publicly available from official sources?
│   ├─ YES → PUBLIC
│   └─ NO ↓
│
├─→ Does it contain personal identifiers?
│   ├─ YES → CONFIDENTIAL (minimum)
│   └─ NO ↓
│
├─→ Is it a credential, key, or secret?
│   ├─ YES → RESTRICTED
│   └─ NO ↓
│
└─→ Is it internal analysis or configuration?
    ├─ YES → INTERNAL
    └─ NO → Assess case-by-case

GDPR Privacy by Design

Seven Principles Applied to CIA Platform

  1. Proactive, not reactive — Embed privacy into political data imports
  2. Privacy as default — Minimize personal data collection
  3. Privacy embedded in design — Use pseudonymization where possible
  4. Full functionality — Privacy without sacrificing analysis quality
  5. End-to-end security — Encrypt data at rest and in transit
  6. Visibility and transparency — Document all data processing activities
  7. Respect for user privacy — Provide data access and deletion mechanisms

Data Processing Patterns

// ✅ SECURE: Minimize personal data in analysis
@Service
public class PoliticianAnalysisService {

    public PoliticianSummary analyzePolitician(String personId) {
        // Only retrieve fields needed for analysis
        PoliticianData data = repository.findPublicDataById(personId);

        // Never include unnecessary personal details
        return PoliticianSummary.builder()
            .personId(personId)
            .votingRecord(data.getVotingRecord())
            .committeeAssignments(data.getCommittees())
            .partyAffiliation(data.getParty())
            .build();
        // Excluded: personal address, phone, private email
    }
}

// ❌ INSECURE: Over-collection of personal data
public PoliticianData getAllPersonalData(String personId) {
    return repository.findById(personId); // Returns ALL fields
}

Data Subject Rights Implementation

GDPR RightCIA Platform Implementation
Right to access (Art. 15)User data export endpoint
Right to rectification (Art. 16)Profile update mechanism
Right to erasure (Art. 17)Account deletion with cascade
Right to restrict (Art. 18)Account deactivation option
Right to portability (Art. 20)JSON/CSV data export
Right to object (Art. 21)Opt-out of analytics processing

Encryption Standards

Data at Rest

Encryption Requirements by Classification
│
├─ PUBLIC → No encryption required
├─ INTERNAL → AES-256 recommended
├─ CONFIDENTIAL → AES-256 required (AWS KMS)
└─ RESTRICTED → AES-256 + envelope encryption (KMS CMK)

Data in Transit

  • TLS 1.2+ for all HTTP connections
  • Certificate pinning for external API calls
  • mTLS for internal service communication
  • HSTS headers enforced

Database Encryption

// Column-level encryption for sensitive fields
@Entity
@Table(name = "application_user")
public class ApplicationUser {

    @Column(name = "username")
    private String username; // PUBLIC - no encryption

    @Column(name = "email")
    @Convert(converter = EncryptedStringConverter.class)
    private String email; // CONFIDENTIAL - encrypted

    @Column(name = "password_hash")
    private String passwordHash; // Already hashed (bcrypt)
}

Data Lifecycle Management

Retention Policies

Data TypeRetention PeriodAction at Expiry
Voting recordsIndefiniteArchive (public record)
User sessions30 daysAutomatic deletion
Audit logs2 yearsArchive to cold storage
User accountsUntil deletion requestAnonymize + delete
API cache24 hoursAutomatic expiry
Analytics data1 yearAggregate + anonymize

Secure Deletion

// Implement secure deletion for user data
@Service
public class DataDeletionService {

    @Transactional
    public void deleteUserAccount(Long userId) {
        // 1. Remove personal data
        userRepository.anonymizeUser(userId);

        // 2. Delete session data
        sessionRepository.deleteByUserId(userId);

        // 3. Audit the deletion (GDPR compliance)
        auditService.logDeletion(userId, "GDPR erasure request");

        // 4. Remove from caches
        cacheManager.evict("user:" + userId);
    }
}

ISMS Alignment

ControlRequirementImplementation
ISO 27001 A.5.12Classification of informationData classification labels
ISO 27001 A.5.33Protection of recordsRetention policy enforcement
ISO 27001 A.8.10Information deletionSecure deletion procedures
ISO 27001 A.8.24Use of cryptographyAES-256, TLS 1.2+
NIST CSF PR.DSData securityEncryption at rest/transit
GDPR Art. 25Data protection by designPrivacy impact assessments

References

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

88/100Analyzed 2/24/2026

Highly comprehensive data protection skill with excellent structure, clear decision trees, code examples, and GDPR/encryption standards. While tied to Hack23 ISMS policies, the technical content (CIA triad classification, encryption requirements, retention policies) is accurate and reusable. Has clear When to Use section, proper tags, and substantial reference material. Minor deduction for platform-specific context but overall excellent skill.

95
90
75
90
90

Metadata

Licenseunknown
Version-
Updated2/22/2026
PublisherHack23

Tags

apici-cddatabasegithubsecurity