一键导入
classification-policy
// Risk-based data and asset classification framework: PUBLIC, INTERNAL, CONFIDENTIAL, RESTRICTED aligned with ISO 27001 A.5.12 and CIA triad
// Risk-based data and asset classification framework: PUBLIC, INTERNAL, CONFIDENTIAL, RESTRICTED aligned with ISO 27001 A.5.12 and CIA triad
Identity and access management: RBAC, least privilege, MFA, quarterly reviews per ISO 27001 A.5.15, A.8.2, A.8.3
Business continuity and disaster recovery: 30-day retention, quarterly restore tests, RTO/RPO targets per ISO 27001 A.17
Political psychology, cognitive biases, group dynamics, leadership analysis, decision-making patterns for Swedish political intelligence
Unified compliance verification across ISO 27001, NIST CSF, CIS Controls, NIS2, EU CRA, GDPR, SOC 2, PCI DSS, and HIPAA for cybersecurity consulting
Cryptographic controls implementation: TLS 1.3, AES-256-GCM, bcrypt, RSA-4096, key management per NIST FIPS 140-2 and ISO 27001 A.8.24
Security incident detection, analysis, containment, eradication, recovery, and lessons learned per NIST SP 800-61r2 and ISO 27035
| name | classification-policy |
| description | Risk-based data and asset classification framework: PUBLIC, INTERNAL, CONFIDENTIAL, RESTRICTED aligned with ISO 27001 A.5.12 and CIA triad |
This skill provides systematic guidance for implementing risk-based data and asset classification within the CIA platform, ensuring proper protection controls align with information sensitivity, business impact, and regulatory requirements per ISO 27001 A.5.12, A.5.13, and A.8.10.
Apply this skill when:
Do NOT skip for:
graph TD
subgraph Classification["🏷️ Classification Tiers"]
RESTRICTED["🔴 RESTRICTED<br/>Extreme Confidentiality<br/>National Security Level"]
CONFIDENTIAL["🟠 CONFIDENTIAL<br/>High Confidentiality<br/>Business Sensitive"]
INTERNAL["🟡 INTERNAL<br/>Moderate Confidentiality<br/>Company Use Only"]
PUBLIC["🟢 PUBLIC<br/>No Confidentiality<br/>Publicly Accessible"]
end
subgraph CIA["🛡️ CIA Triad Mapping"]
CONF["🔒 Confidentiality<br/>Data Secrecy"]
INT["✅ Integrity<br/>Data Accuracy"]
AVAIL["⏱️ Availability<br/>Data Access"]
end
subgraph Controls["🔐 Security Controls"]
ENCRYPTION["🔐 Encryption Requirements"]
ACCESS["🚪 Access Controls"]
AUDIT["📊 Audit Logging"]
RETENTION["📅 Retention Policy"]
end
RESTRICTED --> CONF
RESTRICTED --> INT
RESTRICTED --> AVAIL
CONFIDENTIAL --> CONF
CONFIDENTIAL --> INT
CONFIDENTIAL --> AVAIL
INTERNAL --> INT
INTERNAL --> AVAIL
PUBLIC --> AVAIL
CONF --> ENCRYPTION
CONF --> ACCESS
INT --> AUDIT
AVAIL --> RETENTION
style Classification fill:#1565C0
style CIA fill:#4CAF50
style Controls fill:#FF9800
Definition: Information requiring maximum protection due to severe business, legal, or regulatory consequences if disclosed.
CIA Triad Mapping:
Examples in CIA Platform:
Mandatory Security Controls:
| Control Type | Requirement | Implementation |
|---|---|---|
| Encryption at Rest | AES-256 or stronger | AWS KMS, encrypted EBS volumes |
| Encryption in Transit | TLS 1.3 minimum | HTTPS only, HSTS enabled |
| Access Control | Zero-trust, MFA required | RBAC, least privilege principle |
| Audit Logging | All access logged with retention | CloudWatch Logs, 1-year retention |
| Labeling | Explicit marking required | Code comments, doc headers |
| Retention | Minimum required, immediate disposal | Automated purging after expiry |
Java Implementation Example:
/**
* CLASSIFICATION: RESTRICTED
* Contains database credentials - never log or expose
*
* @see <a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md">Classification Policy</a>
* @see <a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/Cryptography_Policy.md">Cryptography Policy</a>
*/
@Configuration
public class DatabaseConfig {
// RESTRICTED: Database password from encrypted secrets manager
@Value("${spring.datasource.password}")
private String databasePassword;
@Bean
public DataSource dataSource() {
HikariConfig config = new HikariConfig();
config.setJdbcUrl(System.getenv("DB_URL"));
config.setUsername(System.getenv("DB_USERNAME"));
// NEVER log or print RESTRICTED data
config.setPassword(databasePassword);
// Enable connection encryption (TLS 1.3)
config.addDataSourceProperty("ssl", "true");
config.addDataSourceProperty("sslmode", "verify-full");
return new HikariDataSource(config);
}
@Override
public String toString() {
return "DatabaseConfig{password=***REDACTED***}";
}
}
Handling Requirements:
Definition: Business-sensitive information with significant financial, operational, or competitive impact if disclosed.
CIA Triad Mapping:
Examples in CIA Platform:
Mandatory Security Controls:
| Control Type | Requirement | Implementation |
|---|---|---|
| Encryption at Rest | AES-256 recommended | Database encryption, encrypted backups |
| Encryption in Transit | TLS 1.2 minimum | HTTPS, secure API calls |
| Access Control | RBAC with quarterly reviews | Spring Security, user roles |
| Audit Logging | Access events logged | Application logs, 90-day retention |
| Labeling | Classification marking recommended | Document headers, metadata |
| Retention | Business-driven retention | 7 years for financial data |
Java Implementation Example:
/**
* CLASSIFICATION: CONFIDENTIAL
* Contains business-sensitive political party financial data
*
* Access restricted to authenticated users with PARTY_ANALYST role
* All access logged per ISO 27001 A.8.15
*/
@Entity
@Table(name = "party_financial_record")
public class PartyFinancialRecord {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "party_id", nullable = false)
private String partyId;
// CONFIDENTIAL: Detailed budget breakdown
@Column(name = "budget_json", columnDefinition = "jsonb")
@Convert(converter = JsonConverter.class)
private Map<String, BigDecimal> detailedBudget;
@Column(name = "fiscal_year")
private Integer fiscalYear;
@CreatedDate
@Column(name = "created_at", nullable = false)
private LocalDateTime createdAt;
@CreatedBy
@Column(name = "created_by")
private String createdBy;
}
@Service
public class PartyFinancialService {
private final AuditLogger auditLogger;
@PreAuthorize("hasRole('PARTY_ANALYST') or hasRole('ADMIN')")
@Audited(message = "Access to CONFIDENTIAL party financial data")
public PartyFinancialRecord getFinancialRecord(Long recordId, String userId) {
// Log access to CONFIDENTIAL data
auditLogger.logDataAccess(
"CONFIDENTIAL",
"party_financial_record",
recordId,
userId
);
return financialRepository.findById(recordId)
.orElseThrow(() -> new ResourceNotFoundException("Record not found"));
}
}
Handling Requirements:
Definition: Information intended for internal use only, with moderate business impact if disclosed externally.
CIA Triad Mapping:
Examples in CIA Platform:
Security Controls:
| Control Type | Requirement | Implementation |
|---|---|---|
| Encryption at Rest | Recommended for sensitive subsets | Database encryption optional |
| Encryption in Transit | TLS 1.2 for external access | HTTPS for web interfaces |
| Access Control | Authentication required | Standard user accounts |
| Audit Logging | Significant events logged | Basic application logs |
| Labeling | Classification marking optional | File metadata preferred |
| Retention | Standard business retention | 3 years typical |
Java Implementation Example:
/**
* CLASSIFICATION: INTERNAL
* System performance metrics for internal monitoring
*
* Access requires authentication
*/
@Entity
@Table(name = "system_metrics")
public class SystemMetrics {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "metric_name")
private String metricName;
@Column(name = "metric_value")
private Double metricValue;
@Column(name = "timestamp")
private LocalDateTime timestamp;
@Column(name = "server_id")
private String serverId;
}
@RestController
@RequestMapping("/api/internal/metrics")
public class MetricsController {
// INTERNAL: Requires authenticated user
@GetMapping
@PreAuthorize("isAuthenticated()")
public ResponseEntity<List<SystemMetrics>> getMetrics(
@RequestParam LocalDateTime startTime,
@RequestParam LocalDateTime endTime) {
List<SystemMetrics> metrics = metricsService.findByTimeRange(startTime, endTime);
return ResponseEntity.ok(metrics);
}
}
Handling Requirements:
Definition: Information approved for public disclosure with no confidentiality requirements.
CIA Triad Mapping:
Examples in CIA Platform:
Security Controls:
| Control Type | Requirement | Implementation |
|---|---|---|
| Encryption at Rest | Not required | Standard storage |
| Encryption in Transit | Recommended for integrity | HTTPS for web content |
| Access Control | None required | Public access allowed |
| Audit Logging | Optional | Basic web server logs |
| Labeling | Classification marking optional | Metadata optional |
| Retention | Indefinite or business need | Standard retention |
Java Implementation Example:
/**
* CLASSIFICATION: PUBLIC
* Published voting records from Swedish Riksdagen
*
* Data already public via Riksdagen API
* No access restrictions required
*/
@Entity
@Table(name = "voting_record")
public class VotingRecord {
@Id
private String votingId;
@Column(name = "politician_id")
private String politicianId;
@Column(name = "vote")
@Enumerated(EnumType.STRING)
private VoteType voteType; // YES, NO, ABSTAIN, ABSENT
@Column(name = "voting_date")
private LocalDate votingDate;
@Column(name = "document_id")
private String documentId;
}
@RestController
@RequestMapping("/api/public/voting-records")
public class VotingRecordController {
// PUBLIC: No authentication required
@GetMapping
public ResponseEntity<List<VotingRecord>> getVotingRecords(
@RequestParam(required = false) String politicianId,
@RequestParam(required = false) LocalDate startDate,
@RequestParam(required = false) LocalDate endDate) {
List<VotingRecord> records = votingService.findPublicRecords(
politicianId, startDate, endDate
);
return ResponseEntity.ok(records);
}
}
Handling Requirements:
Use this decision tree to classify information:
graph TD
START["🏷️ Start Classification"] --> Q1{"Contains credentials,<br/>encryption keys,<br/>or PII?"}
Q1 -->|Yes| RESTRICTED["🔴 RESTRICTED"]
Q1 -->|No| Q2{Business-sensitive or<br/>competitive advantage<br/>if disclosed?}
Q2 -->|Yes| Q3{Significant financial<br/>or legal impact<br/>if disclosed?}
Q2 -->|No| Q4{Already publicly<br/>available or<br/>approved for release?}
Q3 -->|Yes| CONFIDENTIAL["🟠 CONFIDENTIAL"]
Q3 -->|No| INTERNAL["🟡 INTERNAL"]
Q4 -->|Yes| PUBLIC["🟢 PUBLIC"]
Q4 -->|No| INTERNAL
RESTRICTED --> R_CONTROLS["🔐 Maximum Security:<br/>• AES-256 encryption<br/>• MFA required<br/>• Never log<br/>• Immediate disposal"]
CONFIDENTIAL --> C_CONTROLS["🛡️ High Security:<br/>• Encryption recommended<br/>• RBAC enforced<br/>• Access logging<br/>• Quarterly reviews"]
INTERNAL --> I_CONTROLS["🚪 Standard Security:<br/>• Authentication required<br/>• Internal use only<br/>• Standard retention<br/>• Basic logging"]
PUBLIC --> P_CONTROLS["🌐 Public Access:<br/>• No restrictions<br/>• Integrity focus<br/>• High availability<br/>• Public distribution OK"]
style RESTRICTED fill:#D32F2F
style CONFIDENTIAL fill:#FF9800
style INTERNAL fill:#FDD835
style PUBLIC fill:#4CAF50
style START fill:#1565C0
JavaDoc Comments:
/**
* CLASSIFICATION: RESTRICTED
*
* Contains authentication tokens and encrypted credentials.
*
* Security Requirements:
* - Never log token values
* - Rotate tokens every 90 days
* - Immediate revocation on compromise
*
* @see <a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/CLASSIFICATION.md">Classification Policy</a>
* @see <a href="https://github.com/Hack23/ISMS-PUBLIC/blob/main/Secrets_Management_Policy.md">Secrets Management</a>
*/
public class AuthenticationToken {
// Implementation
}
SQL Table Comments:
-- CLASSIFICATION: CONFIDENTIAL
-- Party financial data with business-sensitive budget details
-- Access requires PARTY_ANALYST role
COMMENT ON TABLE party_financial_record IS
'CLASSIFICATION: CONFIDENTIAL - Party financial data requiring access control';
COMMENT ON COLUMN party_financial_record.budget_json IS
'Detailed budget breakdown - business sensitive';
Markdown Header:
---
title: Security Vulnerability Assessment
classification: CONFIDENTIAL
date: 2025-02-10
author: Security Team
retention: 7 years
---
# CONFIDENTIAL: Security Vulnerability Assessment
**Classification**: CONFIDENTIAL
**Audience**: Internal Security Team Only
**Distribution**: Do not forward externally
Configuration Files:
# CLASSIFICATION: INTERNAL
# Application configuration - internal use only
spring:
application:
name: citizen-intelligence-agency
# ... configuration
Definition: Sensitive personal data requiring explicit consent and enhanced protection.
Examples:
Classification Mapping:
| GDPR Category | Classification | Rationale |
|---|---|---|
| Political opinions | CONFIDENTIAL minimum | Business-sensitive + GDPR Art. 9 |
| Health data | RESTRICTED | Special category + high risk |
| Biometric data | RESTRICTED | Unique identifier + irreversible |
CIA Platform Handling:
/**
* CLASSIFICATION: CONFIDENTIAL
* GDPR: Special Category Personal Data (Art. 9.1.a - Political Opinions)
*
* Political party membership requires:
* - Explicit consent (GDPR Art. 9.2.a)
* - Legal basis documentation
* - Enhanced security controls
* - Privacy by design
*/
@Entity
@Table(name = "politician_party_membership")
public class PoliticianPartyMembership {
@Id
private String membershipId;
@Column(name = "politician_id", nullable = false)
private String politicianId;
// GDPR Art. 9 - Political opinion (special category)
@Column(name = "party_id", nullable = false)
private String partyId;
@Column(name = "membership_start")
private LocalDate membershipStart;
@Column(name = "membership_end")
private LocalDate membershipEnd;
// GDPR compliance: Track consent basis
@Column(name = "legal_basis")
@Enumerated(EnumType.STRING)
private GdprLegalBasis legalBasis; // PUBLIC_OFFICIAL, LEGITIMATE_INTEREST
@Column(name = "data_source")
private String dataSource; // "Riksdagen Public API"
}
| Data Type | GDPR Classification | Platform Classification | Security Controls |
|---|---|---|---|
| Direct Identifiers (name, SSN) | Personal Data | RESTRICTED | Encryption + MFA |
| Political Opinions | Special Category | CONFIDENTIAL | Enhanced access controls |
| Contact Information (email, phone) | Personal Data | CONFIDENTIAL | Access logging |
| IP Addresses | Personal Data | INTERNAL | Standard security |
| Aggregated Analytics | Anonymized | PUBLIC | Ensure irreversible anonymization |
Control Objective: Ensure appropriate level of protection based on importance to organization.
Implementation in CIA Platform:
Verification:
# Search for classification labels in codebase
grep -r "CLASSIFICATION:" --include="*.java" --include="*.sql" citizen-intelligence-agency/
# Verify database column comments include classification
psql -d cia_database -c "\
SELECT table_name, column_name, col_description(attrelid, attnum) \
FROM information_schema.columns \
JOIN pg_class ON relname = table_name \
JOIN pg_attribute ON attrelid = pg_class.oid AND attname = column_name \
WHERE table_schema = 'public' \
AND col_description(attrelid, attnum) LIKE '%CLASSIFICATION%';"
Control Objective: Ensure information assets receive appropriate level of protection.
Implementation:
Control Objective: Information deleted when no longer required.
Retention by Classification:
/**
* Automated data retention enforcement
*/
@Component
@Scheduled(cron = "0 0 2 * * *") // Daily at 2 AM
public class DataRetentionEnforcer {
private final AuditLogger auditLogger;
public void enforceRetention() {
// RESTRICTED: Immediate disposal after expiry
deleteExpiredRestrictedData();
// CONFIDENTIAL: 7-year retention (financial data)
deleteExpiredConfidentialData(Period.ofYears(7));
// INTERNAL: 3-year retention (operational data)
deleteExpiredInternalData(Period.ofYears(3));
// PUBLIC: Indefinite retention (no automatic deletion)
}
private void deleteExpiredRestrictedData() {
List<RestrictedData> expired = restrictedRepo.findExpired(LocalDateTime.now());
for (RestrictedData data : expired) {
// Secure deletion with audit trail
auditLogger.logDataDeletion("RESTRICTED", data.getId(), "RETENTION_EXPIRED");
restrictedRepo.secureDelete(data);
}
}
}
PR.DS-2: Data-in-transit is protected
PR.DS-5: Protections against data leaks are implemented
CIS Control 3: Data Protection
Problem: Classifying all data as RESTRICTED/CONFIDENTIAL unnecessarily
Impact: Excessive security overhead, reduced operational efficiency
Solution: Use decision tree, classify based on actual business impact
Problem: Classifying sensitive data as PUBLIC/INTERNAL
Impact: Inadequate protection, compliance violations, data breaches
Solution: When uncertain, classify higher and review with security team
Problem: Leaving data unclassified
Impact: No clear security controls, inconsistent protection
Solution: Mandate classification for all new data models via PR reviews
Problem: Same data classified differently across systems
Impact: Confusion, control gaps, audit findings
Solution: Centralized classification authority, regular reviews
# CloudFormation template for classified S3 bucket
Resources:
ConfidentialDataBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: cia-confidential-party-data
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: aws:kms
KMSMasterKeyID: !Ref DataEncryptionKey
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
VersioningConfiguration:
Status: Enabled
LifecycleConfiguration:
Rules:
- Id: CONFIDENTIAL-7year-retention
Status: Enabled
ExpirationInDays: 2555 # 7 years
NoncurrentVersionExpirationInDays: 30
Tags:
- Key: Classification
Value: CONFIDENTIAL
- Key: DataOwner
Value: PartyAnalysisTeam
- Key: GDPRCategory
Value: BusinessSensitive
ConfidentialDatabase:
Type: AWS::RDS::DBInstance
Properties:
DBInstanceIdentifier: cia-confidential-db
Engine: postgres
EngineVersion: "18.3"
DBInstanceClass: db.t3.medium
StorageEncrypted: true
KmsKeyId: !Ref DataEncryptionKey
BackupRetentionPeriod: 30
EnableCloudwatchLogsExports:
- postgresql
DeletionProtection: true
Tags:
- Key: Classification
Value: CONFIDENTIAL
- Key: DataType
Value: PoliticalFinancialRecords
- Key: RetentionYears
Value: "7"