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
1---2name: classification-framework-enforcement3description: Data classification enforcement, sensitivity labeling, and handling controls per classification level for the CIA platform4license: Apache-2.05---67# Classification Framework Enforcement Skill89## Purpose1011This 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.1213## When to Use This Skill1415Apply this skill when:16- ✅ Designing new data models or database tables17- ✅ Implementing features that process or display data18- ✅ Reviewing code that handles user data or PII19- ✅ Configuring logging, caching, or data export20- ✅ Assessing data flows between system components21- ✅ Integrating with external data sources22- ✅ Conducting data protection impact assessments2324Do NOT use for:25- ❌ Access control implementation (use access-control-policy)26- ❌ Encryption algorithm selection (use crypto-best-practices)27- ❌ Incident response procedures (use incident-response)2829## Classification Levels3031### CIA Platform Data Classification3233| Level | Label | Description | Examples in CIA |34|---|---|---|---|35| **Public** | 🟢 PUBLIC | Freely available information | Published Riksdag votes, public politician profiles, World Bank indicators |36| **Internal** | 🟡 INTERNAL | For authorized users only | Aggregated analytics, risk scores, trend analysis |37| **Confidential** | 🟠 CONFIDENTIAL | Restricted access, business-sensitive | User accounts, email addresses, session data |38| **Restricted** | 🔴 RESTRICTED | Highest protection, regulatory requirements | Passwords, API keys, encryption keys, GDPR-protected PII |3940### Classification Decision Tree4142```43New Data Element44 │45 ├─→ Is it publicly available from source?46 │ ├─→ YES → Is it aggregated/analyzed by CIA?47 │ │ ├─→ YES → 🟡 INTERNAL48 │ │ └─→ NO → 🟢 PUBLIC49 │ └─→ NO50 │51 ├─→ Is it user-provided personal data?52 │ ├─→ YES → Is it authentication/credential data?53 │ │ ├─→ YES → 🔴 RESTRICTED54 │ │ └─→ NO → 🟠 CONFIDENTIAL55 │ └─→ NO56 │57 ├─→ Is it a system secret (key, token, password)?58 │ ├─→ YES → 🔴 RESTRICTED59 │ └─→ NO60 │61 └─→ Is it internal analysis or derived data?62 ├─→ YES → 🟡 INTERNAL63 └─→ NO → 🟢 PUBLIC (default to least restrictive only if certain)64```6566## Handling Controls by Classification Level6768### 🟢 PUBLIC Data6970| Control | Requirement |71|---|---|72| Storage | Standard database storage |73| Transmission | HTTPS preferred but not mandatory for read-only |74| Logging | Can be logged freely |75| Caching | Can be cached without restrictions |76| Display | No restrictions on UI display |77| Export | Can be exported freely |78| Retention | Follow data source policies |79| Backup | Standard backup procedures |8081### 🟡 INTERNAL Data8283| Control | Requirement |84|---|---|85| Storage | Standard database with access controls |86| Transmission | HTTPS required |87| Logging | Can be logged, no sensitive aggregation details |88| Caching | Can be cached with TTL limits |89| Display | Requires authenticated session |90| Export | Requires authentication |91| Retention | 1 year default, review annually |92| Backup | Standard backup with access controls |9394### 🟠 CONFIDENTIAL Data9596| Control | Requirement |97|---|---|98| Storage | Encrypted at rest (AES-256) |99| Transmission | TLS 1.2+ required |100| Logging | **Never log confidential field values** |101| Caching | In-memory only, short TTL, no disk cache |102| Display | Masked by default, reveal on explicit action |103| Export | Restricted, requires authorization |104| Retention | Minimum necessary, max 3 years |105| Backup | Encrypted backup, restricted access |106| Access | Role-based, principle of least privilege |107108### 🔴 RESTRICTED Data109110| Control | Requirement |111|---|---|112| Storage | Encrypted at rest + application-level encryption |113| Transmission | TLS 1.2+ with certificate validation |114| Logging | **Absolutely never log** — not even existence |115| Caching | **Never cache** |116| Display | **Never display in plaintext** |117| Export | **Prohibited** without explicit authorization |118| Retention | Minimum necessary, auto-expire where possible |119| Backup | Encrypted, separate access controls |120| Access | Strict need-to-know, multi-factor authentication |121| Key Management | HSM or AWS KMS, regular rotation |122123## Implementation Patterns124125### Database Column Classification126127```java128@Entity129@Table(name = "application_user")130public class ApplicationUser {131132 @Column(name = "username")133 // Classification: CONFIDENTIAL — user-provided, non-public134 private String username;135136 @Column(name = "email")137 // Classification: CONFIDENTIAL — PII under GDPR138 private String email;139140 @Column(name = "password_hash")141 // Classification: RESTRICTED — credential data142 private String passwordHash;143}144```145146### Logging Guard147148```java149// DO: Log classification-safe data only150log.info("Processing politician data for id: {}", politicianId); // PUBLIC id151152// DON'T: Log CONFIDENTIAL or RESTRICTED data153// log.info("User login: email={}, password={}", email, password);154155// DO: Use placeholder for CONFIDENTIAL data156log.info("User action completed for user id: {}", userId);157```158159### Caching Rules160161```java162// PUBLIC/INTERNAL: Standard caching allowed163@Cacheable(value = "politicians", key = "#id")164public Politician findPoliticianById(String id) { ... }165166// CONFIDENTIAL: Short TTL, in-memory only167@Cacheable(value = "userProfiles", key = "#userId",168 cacheManager = "shortLivedCacheManager")169public UserProfile findUserProfile(String userId) { ... }170171// RESTRICTED: Never cache172// No @Cacheable annotation — always fetch from secure storage173public String getApiKey(String serviceId) { ... }174```175176## Data Flow Classification177178### CIA Platform Data Flows179180```181External APIs (Riksdag, World Bank) ──→ Service Layer ──→ Database182 🟢 PUBLIC data Classification Labeled183 enforcement storage184 │185 ▼186User Browser ◄──── Vaadin UI ◄──── Service Layer187 Display Encoding Access control188 controls applied enforced189```190191### Cross-Boundary Rules192193| From → To | Allowed Classifications | Controls Required |194|---|---|---|195| External API → Service | PUBLIC | Input validation |196| Service → Database | All | Encryption for CONFIDENTIAL+ |197| Database → Service | All | Access control check |198| Service → UI | PUBLIC, INTERNAL, CONFIDENTIAL | Output encoding, masking |199| Service → Logs | PUBLIC, INTERNAL only | Never log CONFIDENTIAL+ |200| Service → Cache | PUBLIC, INTERNAL, Confidential (short TTL) | Never cache RESTRICTED |201| Any → External | PUBLIC only | Data export review |202203## Compliance Mapping204205| Classification Control | ISO 27001 | NIST CSF | GDPR |206|---|---|---|---|207| Data Classification | A.5.12, A.5.13 | ID.AM-5 | Art. 5(1)(f) |208| Labeling | A.5.13 | PR.DS-3 | Art. 30 |209| Access Control | A.5.15, A.8.3 | PR.AC-4 | Art. 25 |210| Encryption | A.8.24 | PR.DS-1 | Art. 32 |211| Logging Controls | A.8.15 | DE.AE-3 | Art. 30 |212| Retention | A.5.33 | PR.IP-6 | Art. 5(1)(e) |213| Data Transfer | A.5.14 | PR.DS-2 | Art. 44-49 |214215## References216217- [ISO 27001:2022 Annex A — A.5.12-A.5.14 Information Classification](https://www.iso.org/standard/27001)218- [NIST SP 800-60 Guide for Mapping Information Types](https://csrc.nist.gov/publications/detail/sp/800-60/vol-1-rev-1/final)219- [GDPR Article 5 — Principles Relating to Processing](https://gdpr-info.eu/art-5-gdpr/)220- [Hack23 ISMS Data Classification Policy](https://github.com/Hack23/ISMS-PUBLIC)