Classification Framework Enforcement Skill
Purpose
This skill provides guidance for enforcing data classification across the Citizen Intelligence Agency platform. It defines classification levels, sensitivity labeling requirements, and mandatory handling controls for each level to ensure consistent data protection aligned with ISMS requirements.
When to Use This Skill
Apply this skill when:
- ✅ Designing new data models or database tables
- ✅ Implementing features that process or display data
- ✅ Reviewing code that handles user data or PII
- ✅ Configuring logging, caching, or data export
- ✅ Assessing data flows between system components
- ✅ Integrating with external data sources
- ✅ Conducting data protection impact assessments
Do NOT use for:
- ❌ Access control implementation (use access-control-policy)
- ❌ Encryption algorithm selection (use crypto-best-practices)
- ❌ Incident response procedures (use incident-response)
Classification Levels
CIA Platform Data Classification
| Level |
Label |
Description |
Examples in CIA |
| Public |
🟢 PUBLIC |
Freely available information |
Published Riksdag votes, public politician profiles, World Bank indicators |
| Internal |
🟡 INTERNAL |
For authorized users only |
Aggregated analytics, risk scores, trend analysis |
| Confidential |
🟠 CONFIDENTIAL |
Restricted access, business-sensitive |
User accounts, email addresses, session data |
| Restricted |
🔴 RESTRICTED |
Highest protection, regulatory requirements |
Passwords, API keys, encryption keys, GDPR-protected PII |
Classification Decision Tree
New Data Element
│
├─→ Is it publicly available from source?
│ ├─→ YES → Is it aggregated/analyzed by CIA?
│ │ ├─→ YES → 🟡 INTERNAL
│ │ └─→ NO → 🟢 PUBLIC
│ └─→ NO
│
├─→ Is it user-provided personal data?
│ ├─→ YES → Is it authentication/credential data?
│ │ ├─→ YES → 🔴 RESTRICTED
│ │ └─→ NO → 🟠 CONFIDENTIAL
│ └─→ NO
│
├─→ Is it a system secret (key, token, password)?
│ ├─→ YES → 🔴 RESTRICTED
│ └─→ NO
│
└─→ Is it internal analysis or derived data?
├─→ YES → 🟡 INTERNAL
└─→ NO → 🟢 PUBLIC (default to least restrictive only if certain)
Handling Controls by Classification Level
🟢 PUBLIC Data
| Control |
Requirement |
| Storage |
Standard database storage |
| Transmission |
HTTPS preferred but not mandatory for read-only |
| Logging |
Can be logged freely |
| Caching |
Can be cached without restrictions |
| Display |
No restrictions on UI display |
| Export |
Can be exported freely |
| Retention |
Follow data source policies |
| Backup |
Standard backup procedures |
🟡 INTERNAL Data
| Control |
Requirement |
| Storage |
Standard database with access controls |
| Transmission |
HTTPS required |
| Logging |
Can be logged, no sensitive aggregation details |
| Caching |
Can be cached with TTL limits |
| Display |
Requires authenticated session |
| Export |
Requires authentication |
| Retention |
1 year default, review annually |
| Backup |
Standard backup with access controls |
🟠 CONFIDENTIAL Data
| Control |
Requirement |
| Storage |
Encrypted at rest (AES-256) |
| Transmission |
TLS 1.2+ required |
| Logging |
Never log confidential field values |
| Caching |
In-memory only, short TTL, no disk cache |
| Display |
Masked by default, reveal on explicit action |
| Export |
Restricted, requires authorization |
| Retention |
Minimum necessary, max 3 years |
| Backup |
Encrypted backup, restricted access |
| Access |
Role-based, principle of least privilege |
🔴 RESTRICTED Data
| Control |
Requirement |
| Storage |
Encrypted at rest + application-level encryption |
| Transmission |
TLS 1.2+ with certificate validation |
| Logging |
Absolutely never log — not even existence |
| Caching |
Never cache |
| Display |
Never display in plaintext |
| Export |
Prohibited without explicit authorization |
| Retention |
Minimum necessary, auto-expire where possible |
| Backup |
Encrypted, separate access controls |
| Access |
Strict need-to-know, multi-factor authentication |
| Key Management |
HSM or AWS KMS, regular rotation |
Implementation Patterns
Database Column Classification
@Entity
@Table(name = "application_user")
public class ApplicationUser {
@Column(name = "username")
// Classification: CONFIDENTIAL — user-provided, non-public
private String username;
@Column(name = "email")
// Classification: CONFIDENTIAL — PII under GDPR
private String email;
@Column(name = "password_hash")
// Classification: RESTRICTED — credential data
private String passwordHash;
}
Logging Guard
// DO: Log classification-safe data only
log.info("Processing politician data for id: {}", politicianId); // PUBLIC id
// DON'T: Log CONFIDENTIAL or RESTRICTED data
// log.info("User login: email={}, password={}", email, password);
// DO: Use placeholder for CONFIDENTIAL data
log.info("User action completed for user id: {}", userId);
Caching Rules
// PUBLIC/INTERNAL: Standard caching allowed
@Cacheable(value = "politicians", key = "#id")
public Politician findPoliticianById(String id) { ... }
// CONFIDENTIAL: Short TTL, in-memory only
@Cacheable(value = "userProfiles", key = "#userId",
cacheManager = "shortLivedCacheManager")
public UserProfile findUserProfile(String userId) { ... }
// RESTRICTED: Never cache
// No @Cacheable annotation — always fetch from secure storage
public String getApiKey(String serviceId) { ... }
Data Flow Classification
CIA Platform Data Flows
External APIs (Riksdag, World Bank) ──→ Service Layer ──→ Database
🟢 PUBLIC data Classification Labeled
enforcement storage
│
▼
User Browser ◄──── Vaadin UI ◄──── Service Layer
Display Encoding Access control
controls applied enforced
Cross-Boundary Rules
| From → To |
Allowed Classifications |
Controls Required |
| External API → Service |
PUBLIC |
Input validation |
| Service → Database |
All |
Encryption for CONFIDENTIAL+ |
| Database → Service |
All |
Access control check |
| Service → UI |
PUBLIC, INTERNAL, CONFIDENTIAL |
Output encoding, masking |
| Service → Logs |
PUBLIC, INTERNAL only |
Never log CONFIDENTIAL+ |
| Service → Cache |
PUBLIC, INTERNAL, Confidential (short TTL) |
Never cache RESTRICTED |
| Any → External |
PUBLIC only |
Data export review |
Compliance Mapping
| Classification Control |
ISO 27001 |
NIST CSF |
GDPR |
| Data Classification |
A.5.12, A.5.13 |
ID.AM-5 |
Art. 5(1)(f) |
| Labeling |
A.5.13 |
PR.DS-3 |
Art. 30 |
| Access Control |
A.5.15, A.8.3 |
PR.AC-4 |
Art. 25 |
| Encryption |
A.8.24 |
PR.DS-1 |
Art. 32 |
| Logging Controls |
A.8.15 |
DE.AE-3 |
Art. 30 |
| Retention |
A.5.33 |
PR.IP-6 |
Art. 5(1)(e) |
| Data Transfer |
A.5.14 |
PR.DS-2 |
Art. 44-49 |
References
Source: Hack23/cia — distributed by TomeVault.
1---2name: classification-framework-enforcement3description: Data classification enforcement, sensitivity labeling, and handling controls per classification level for the CIA platform Use when this capability is needed.4---56# Classification Framework Enforcement Skill78## Purpose910This skill provides guidance for enforcing data classification across the Citizen Intelligence Agency platform. It defines classification levels, sensitivity labeling requirements, and mandatory handling controls for each level to ensure consistent data protection aligned with ISMS requirements.1112## When to Use This Skill1314Apply this skill when:15- ✅ Designing new data models or database tables16- ✅ Implementing features that process or display data17- ✅ Reviewing code that handles user data or PII18- ✅ Configuring logging, caching, or data export19- ✅ Assessing data flows between system components20- ✅ Integrating with external data sources21- ✅ Conducting data protection impact assessments2223Do NOT use for:24- ❌ Access control implementation (use access-control-policy)25- ❌ Encryption algorithm selection (use crypto-best-practices)26- ❌ Incident response procedures (use incident-response)2728## Classification Levels2930### CIA Platform Data Classification3132| Level | Label | Description | Examples in CIA |33|---|---|---|---|34| **Public** | 🟢 PUBLIC | Freely available information | Published Riksdag votes, public politician profiles, World Bank indicators |35| **Internal** | 🟡 INTERNAL | For authorized users only | Aggregated analytics, risk scores, trend analysis |36| **Confidential** | 🟠 CONFIDENTIAL | Restricted access, business-sensitive | User accounts, email addresses, session data |37| **Restricted** | 🔴 RESTRICTED | Highest protection, regulatory requirements | Passwords, API keys, encryption keys, GDPR-protected PII |3839### Classification Decision Tree4041```42New Data Element43 │44 ├─→ Is it publicly available from source?45 │ ├─→ YES → Is it aggregated/analyzed by CIA?46 │ │ ├─→ YES → 🟡 INTERNAL47 │ │ └─→ NO → 🟢 PUBLIC48 │ └─→ NO49 │50 ├─→ Is it user-provided personal data?51 │ ├─→ YES → Is it authentication/credential data?52 │ │ ├─→ YES → 🔴 RESTRICTED53 │ │ └─→ NO → 🟠 CONFIDENTIAL54 │ └─→ NO55 │56 ├─→ Is it a system secret (key, token, password)?57 │ ├─→ YES → 🔴 RESTRICTED58 │ └─→ NO59 │60 └─→ Is it internal analysis or derived data?61 ├─→ YES → 🟡 INTERNAL62 └─→ NO → 🟢 PUBLIC (default to least restrictive only if certain)63```6465## Handling Controls by Classification Level6667### 🟢 PUBLIC Data6869| Control | Requirement |70|---|---|71| Storage | Standard database storage |72| Transmission | HTTPS preferred but not mandatory for read-only |73| Logging | Can be logged freely |74| Caching | Can be cached without restrictions |75| Display | No restrictions on UI display |76| Export | Can be exported freely |77| Retention | Follow data source policies |78| Backup | Standard backup procedures |7980### 🟡 INTERNAL Data8182| Control | Requirement |83|---|---|84| Storage | Standard database with access controls |85| Transmission | HTTPS required |86| Logging | Can be logged, no sensitive aggregation details |87| Caching | Can be cached with TTL limits |88| Display | Requires authenticated session |89| Export | Requires authentication |90| Retention | 1 year default, review annually |91| Backup | Standard backup with access controls |9293### 🟠 CONFIDENTIAL Data9495| Control | Requirement |96|---|---|97| Storage | Encrypted at rest (AES-256) |98| Transmission | TLS 1.2+ required |99| Logging | **Never log confidential field values** |100| Caching | In-memory only, short TTL, no disk cache |101| Display | Masked by default, reveal on explicit action |102| Export | Restricted, requires authorization |103| Retention | Minimum necessary, max 3 years |104| Backup | Encrypted backup, restricted access |105| Access | Role-based, principle of least privilege |106107### 🔴 RESTRICTED Data108109| Control | Requirement |110|---|---|111| Storage | Encrypted at rest + application-level encryption |112| Transmission | TLS 1.2+ with certificate validation |113| Logging | **Absolutely never log** — not even existence |114| Caching | **Never cache** |115| Display | **Never display in plaintext** |116| Export | **Prohibited** without explicit authorization |117| Retention | Minimum necessary, auto-expire where possible |118| Backup | Encrypted, separate access controls |119| Access | Strict need-to-know, multi-factor authentication |120| Key Management | HSM or AWS KMS, regular rotation |121122## Implementation Patterns123124### Database Column Classification125126```java127@Entity128@Table(name = "application_user")129public class ApplicationUser {130131 @Column(name = "username")132 // Classification: CONFIDENTIAL — user-provided, non-public133 private String username;134135 @Column(name = "email")136 // Classification: CONFIDENTIAL — PII under GDPR137 private String email;138139 @Column(name = "password_hash")140 // Classification: RESTRICTED — credential data141 private String passwordHash;142}143```144145### Logging Guard146147```java148// DO: Log classification-safe data only149log.info("Processing politician data for id: {}", politicianId); // PUBLIC id150151// DON'T: Log CONFIDENTIAL or RESTRICTED data152// log.info("User login: email={}, password={}", email, password);153154// DO: Use placeholder for CONFIDENTIAL data155log.info("User action completed for user id: {}", userId);156```157158### Caching Rules159160```java161// PUBLIC/INTERNAL: Standard caching allowed162@Cacheable(value = "politicians", key = "#id")163public Politician findPoliticianById(String id) { ... }164165// CONFIDENTIAL: Short TTL, in-memory only166@Cacheable(value = "userProfiles", key = "#userId",167 cacheManager = "shortLivedCacheManager")168public UserProfile findUserProfile(String userId) { ... }169170// RESTRICTED: Never cache171// No @Cacheable annotation — always fetch from secure storage172public String getApiKey(String serviceId) { ... }173```174175## Data Flow Classification176177### CIA Platform Data Flows178179```180External APIs (Riksdag, World Bank) ──→ Service Layer ──→ Database181 🟢 PUBLIC data Classification Labeled182 enforcement storage183 │184 ▼185User Browser ◄──── Vaadin UI ◄──── Service Layer186 Display Encoding Access control187 controls applied enforced188```189190### Cross-Boundary Rules191192| From → To | Allowed Classifications | Controls Required |193|---|---|---|194| External API → Service | PUBLIC | Input validation |195| Service → Database | All | Encryption for CONFIDENTIAL+ |196| Database → Service | All | Access control check |197| Service → UI | PUBLIC, INTERNAL, CONFIDENTIAL | Output encoding, masking |198| Service → Logs | PUBLIC, INTERNAL only | Never log CONFIDENTIAL+ |199| Service → Cache | PUBLIC, INTERNAL, Confidential (short TTL) | Never cache RESTRICTED |200| Any → External | PUBLIC only | Data export review |201202## Compliance Mapping203204| Classification Control | ISO 27001 | NIST CSF | GDPR |205|---|---|---|---|206| Data Classification | A.5.12, A.5.13 | ID.AM-5 | Art. 5(1)(f) |207| Labeling | A.5.13 | PR.DS-3 | Art. 30 |208| Access Control | A.5.15, A.8.3 | PR.AC-4 | Art. 25 |209| Encryption | A.8.24 | PR.DS-1 | Art. 32 |210| Logging Controls | A.8.15 | DE.AE-3 | Art. 30 |211| Retention | A.5.33 | PR.IP-6 | Art. 5(1)(e) |212| Data Transfer | A.5.14 | PR.DS-2 | Art. 44-49 |213214## References215216- [ISO 27001:2022 Annex A — A.5.12-A.5.14 Information Classification](https://www.iso.org/standard/27001)217- [NIST SP 800-60 Guide for Mapping Information Types](https://csrc.nist.gov/publications/detail/sp/800-60/vol-1-rev-1/final)218- [GDPR Article 5 — Principles Relating to Processing](https://gdpr-info.eu/art-5-gdpr/)219- [Hack23 ISMS Data Classification Policy](https://github.com/Hack23/ISMS-PUBLIC)220221---222> Source: [Hack23/cia](https://github.com/Hack23/cia) — distributed by [TomeVault](https://tomevault.io).223<!-- tomevault:4.0:skill_md:2026-07-02 -->