Skip to content

14.2 Security Hardening

Sprint: Sprint 14 - Testing and Hardening
Feature ID: 14.2
Subtasks: 14.2.1, 14.2.2, 14.2.3, 14.2.4

Objective

Deliver "Security Hardening" within Sprint 14 - Testing and Hardening.

Dependencies

Aggregated from the subtasks below (prerequisite task IDs and enablers):

  • 6.2.3
  • 8.4.2
  • 13.2.1
  • 5.6.1
  • 6.3.5
  • 8.5.2
  • 9.3.1
  • Sprints 04-13

Subtasks

14.2.1 PII-at-rest encryption audit

  • ID: 14.2.1
  • Title: Verify AES-GCM encryption of all PII at rest
  • Description: Audit every service storing PII (customer TCKN, payment card data) to confirm AES-GCM encryption with keys from secrets, and that no PII column stores plaintext (NFR-06).
  • Business Purpose: Regulatory PII protection (NFR-06, KVKK/GDPR).
  • Inputs: NFR-06, ADR-011, 6.2.3.
  • Outputs: Encryption audit + fixes.
  • Acceptance Criteria:
  • A DB inspection confirms all PII columns are ciphertext; a key-rotation procedure is documented.
  • Dependencies: 6.2.3, 8.4.2
  • Complexity: M

14.2.2 PII telemetry masking audit

  • ID: 14.2.2
  • Title: Verify PII masking across logs, traces, and metrics
  • Description: Confirm the masking converter (ADR-021) redacts TCKN, card number, MSISDN, and email in all logs, trace attributes, and metric labels across every service.
  • Business Purpose: No PII leakage into observability (ADR-021, NFR-12).
  • Inputs: ADR-021, 3.2.7, 13.2.1.
  • Outputs: Masking audit + fixes.
  • Acceptance Criteria:
  • Seeded PII values never appear unmasked in Loki, Tempo, or Prometheus for any service.
  • Dependencies: 13.2.1
  • Complexity: M

14.2.3 Audit-log completeness

  • ID: 14.2.3
  • Title: Verify audit logging in identity, customer, payment, subscription
  • Description: Confirm every state-changing operation in the four mandated services writes an audit row with actor, action, entity, and correlationId (NFR-12).
  • Business Purpose: Complete regulatory audit trail (NFR-12).
  • Inputs: NFR-12, 5.6.1.
  • Outputs: Audit-coverage verification + fixes.
  • Acceptance Criteria:
  • A representative state change in each of the four services produces a correct audit row; gaps are closed.
  • Dependencies: 5.6.1, 6.3.5, 8.5.2, 9.3.1
  • Complexity: M

14.2.4 mTLS posture and security review

  • ID: 14.2.4
  • Title: Document mTLS decision and run a security review
  • Description: Document the gateway-behind-trust model and the deferred-mTLS decision for MVP (per analysis Section 13), and run a dependency/security review (token handling, rate limiting, input validation, error leakage).
  • Business Purpose: Explicit, reviewed security posture (NFR-05, ADR-011).
  • Inputs: analysis Section 13, ADR-011.
  • Outputs: Security posture doc + review findings + fixes.
  • Acceptance Criteria:
  • The mTLS deferral is documented with the production recommendation; no high-severity findings remain open; error responses never leak stack traces.
  • Dependencies: Sprints 04-13
  • Complexity: M

Acceptance Criteria

Each subtask above carries its own objective, testable acceptance criteria. This feature is complete when every subtask's acceptance criteria are met.

Deliverables

  • Encryption audit + fixes.
  • Masking audit + fixes.
  • Audit-coverage verification + fixes.
  • Security posture doc + review findings + fixes.

Definition of Done

  • All subtasks (14.2.1, 14.2.2, 14.2.3, 14.2.4) completed and their acceptance criteria verified.
  • All listed dependencies satisfied.
  • Build and tests green per the global conventions in ../README.md (Section 3).