CR-SEC-009 · SECURITY, COMPLIANCE & NFR
Security, Compliance & Non-Functional Requirements
Security architecture, data protection, identity & access, audit, compliance posture, resilience and non-functional targets for Engagement & Loyalty Platform under bank-controlled deployment.
ConfidentialVersion: 1.0Date: 06 Jun 2026
Security Objectives
Protect bank and customer data with bank-controlled residency, enforce least-privilege access, guarantee the integrity of the loyalty ledger, and provide complete auditability — meeting the Bank security standards and applicable regulatory expectations.
The engagement layer inherits these guarantees end to end: inbound bank events (POST /api/v1/events) are deduplicated on a unique eventRef and scratch-card reveals post through the same immutable, exactly-once ledger — so event replay and re-scratch are safe by construction and every trigger-issued reward is fully audited.
Implementation status — target posture vs. current build. This document states the target security posture for the the Bank deployment. In the current build: request signing is HMAC-SHA256 only and feature-flagged off by default (SIGNATURE_VERIFY=off); the replay-nonce cache is in-process (a shared/Redis store is pending); and OAuth2, mTLS and admin SSO (OIDC/SAML) are the Bank-edge/deployment controls, not implemented in this repo. Encryption-at-rest, HSM/Vault, SIEM forwarding and hash-chained audit are environment-provided. Implemented today: RBAC roles & permissions, maker-checker dual control (config and campaign lifecycle), immutable append-only ledger with exactly-once idempotency, and full audit logging. Asymmetric signing (RSA/ECDSA), persistent nonce store and SSO are roadmap.
Deployment & Data Residency
- Entire platform deployed inside the the Bank-controlled environment (DC / private cloud VPC).
- All PII & transaction data remain within the boundary; only reward-catalogue, voucher-fulfilment and notification calls egress, over controlled, allow-listed endpoints.
- Network segmented into DMZ / Application / Data zones (see CR-ARC-004, Figure 4) with east-west restrictions.
Data Protection & Encryption
Encryption is layered across transport, storage and individual sensitive fields, with all key material managed centrally (Vault/KMS, optional HSM) and never embedded in code or images.
| Layer | Control | Detail |
| In transit (internal) | TLS 1.2+ / mTLS | TLS 1.2 minimum (1.3 preferred), strong cipher suites only; mTLS between zones (DMZ↔App↔Data) and between services in the mesh; certificates issued by the Bank PKI. |
| In transit (partner) | mTLS + signing | All egress to catalogue / fulfilment / notification partners over mTLS to allow-listed endpoints; payloads additionally signed (see Message Signing). |
| At rest | AES-256 | AES-256 for databases, backups, WAL/PITR archives, object storage & the secret store; transparent disk + DB-level encryption. |
| Field-level | pgcrypto | Voucher codes and other high-sensitivity fields encrypted at column level via pgcrypto (key from Vault); stored ciphertext only, decrypted in-process on authorised reveal. See CR-DBS-013. |
| Tokenisation | PAN / PII | No raw PAN/PII stored; reversible tokens held only in the bank vault; Engagement & Loyalty Platform uses opaque customer_ref / card_ref. Voucher codes exchanged with partners as tokens, never raw in transit/logs. |
| Masking | UI / logs / exports | Identifiers & voucher codes masked everywhere; full reveal gated by permission + step-up and audited. |
| Key management | Vault / KMS / HSM | Central Vault/KMS; scheduled rotation (data keys ≤ 90d, signing keys per quarter), separation of duties for key access, dual-control for export; optional HSM for root/signing keys. Envelope encryption (DEK wrapped by KEK). |
| Data minimisation | Ingest scope | Only fields required for rewards are ingested; retention & purge per DPDP. |
Identity & Access Management
- Admin SSO via the Bank IdP (OIDC/SAML); MFA per bank policy.
- RBAC with least-privilege roles & scopes (see CR-CFG-008).
- Maker-Checker segregation of duties on all financially material changes; self-approval blocked.
- Service-to-service via OAuth2 client-credentials + mTLS; short-lived scoped tokens.
- Customer access channel-issued, customer-scoped tokens; step-up (OTP) for redemption.
- Session timeout, password & lockout policies aligned to bank standards.
Message Signing & Verification
Beyond transport security and bearer tokens, value-bearing requests — reward redemptions, transaction reversals, ledger adjustments — and inbound fulfilment callbacks and settlement files are cryptographically signed and verified at the application layer. This binds each request to a known calling channel/partner, makes the payload tamper-evident, and (with nonce + timestamp + idempotency key) provides strong replay protection. The wire format, headers and worked examples are in CR-API-006.
| Aspect | Specification |
| Algorithms | HMAC-SHA256 with per-client secret (default); RSASSA-PSS (RSA-2048+) or ECDSA ES256 for high-assurance partners, selected by X-Signature-KeyId. |
| Signed scope | Canonical string covers method, path, timestamp, nonce, idempotency key and a SHA-256 of the body — so headers and body are all bound. |
| Replay protection | Timestamp ±300s window + per-client unique nonce (10-min memory) + idempotency key; reuse is rejected (NONCE_REPLAYED). |
| Responses & webhooks | Server signs responses on the redemption path; inbound webhooks verified before any side effect; mTLS + source allow-list in addition to signature. |
| Settlement files | Detached signature (.sig) over the file SHA-256; key id in the manifest; verified before ingest. |
Key management & rotation
- Provisioning: client/partner secrets and public keys registered out-of-band, stored in Vault, referenced by a versioned
KeyId (e.g. chan-axisapp-2026Q2).
- Rotation: signing keys rotate quarterly (or on suspected compromise); overlapping validity lets old and new
KeyIds be accepted during a grace window for zero-downtime rollover.
- Revocation: a compromised
KeyId is disabled immediately → all requests under it fail UNKNOWN_KEY; rotation/revocation events are audited.
- Separation of duties: HMAC secrets never leave Vault to application logs; for asymmetric keys Engagement & Loyalty Platform holds only the public key; private keys for response signing live in Vault/HSM.
Verification flow
- Resolve
KeyId → algorithm + key (reject unknown/disabled).
- Validate timestamp window, then nonce uniqueness.
- Recompute canonical string + body hash and constant-time compare the signature.
- Apply idempotency, then process; emit a signed response / advance the saga only after all checks pass.
Application Security
| Area | Control |
| Input validation | Schema validation, output encoding, parameterised queries (no SQL injection). |
| OWASP Top-10 | Controls for injection, broken access, SSRF, etc.; security tests in CI. |
| Secrets | No secrets in code/images; injected from Vault. |
| Dependency & image scanning | SCA + container scans in pipeline; block on critical findings. |
| Rate limiting & WAF | Edge throttling & WAF rules; bot/abuse protection. |
| Idempotency | Prevents replay-driven double accrual/redemption. |
Integration Readiness
Each integration is assessed for protocol, authentication, application-layer signing, encryption, retry/idempotency, delivery receipts and source allow-listing. Communication integrations emphasise signed callbacks, delivery receipts and consent; reward integrations emphasise mTLS, request signing and allow-listing. Trust boundaries are shown in CR-ARC-004, Figure 10.
| Integration | Protocol | Auth | Signing | Encryption | Retry / idempotency | Delivery receipts | Allow-list | Status |
| CBS / Card system | SFTP batch + REST | mTLS + OAuth2 | File .sig / req signature | TLS + AES-256 | Control totals; idempotent reload | Ack file / 2xx | Yes | Ready |
| Transaction switch | Queue / stream | mTLS + token | Message signature (optional) | mTLS | At-least-once + idempotency key | Offset commit | Yes | Ready |
| the Bank IdP (SSO) | OIDC / SAML | OIDC + MFA | Signed JWT / SAML assertion | TLS 1.2+ | N/A (interactive) | N/A | Yes | Ready |
| Notification GW (SMS/Email/Push/WhatsApp) | REST / webhook | mTLS + API key | Signed send + signed delivery callback | TLS 1.2+ | Retry w/ backoff; idempotent message_id | Delivery/read receipts ingested | Yes | Ready (consent-gated) |
| the Bank digital channels | REST | Channel token + mTLS | Signed redemption requests | mTLS | Idempotency key | Signed 2xx | Yes | Ready |
| Reward catalogue | REST | mTLS + OAuth2 | Signed requests | mTLS | Cache + retry; read-only | 2xx | Yes | Ready |
| Voucher fulfilment | REST + webhook | mTLS + OAuth2 | Signed request + signed webhook | mTLS + tokenised codes | Idempotency key; saga compensation | Signed fulfilment webhook | Yes | Ready (signed, allow-listed) |
| CBS credit posting | REST / batch | mTLS + OAuth2 | Signed instruction / file | TLS + AES-256 | Idempotency key; recon confirm | Credit confirmation | Yes | Ready |
Communication readiness: sends and delivery/read receipts are signed and idempotent on message_id; recipient consent (DPDP) is checked before dispatch and receipts feed audit. Rewards readiness: catalogue, fulfilment and CBS posting are mTLS, request-signed and restricted to allow-listed endpoints, with signed callbacks and saga-based compensation.
Audit & Logging
Logging spans operational observability and a separate tamper-evident audit trail for security/financial/config events. All logs and audit records carry a correlation id for end-to-end traceability.
| Aspect | Detail |
| Centralised logging | Structured JSON to a central platform (ELK/equivalent); every record carries X-Request-Id / trace context, actor, masked identifiers; no PII/secrets/raw voucher codes in logs. |
| Tamper-evident audit | Append-only, immutable audit_log (see CR-DBS-013) with hash-chaining / WORM storage so records cannot be altered or deleted; periodic integrity verification. |
| What is logged | Config events (rule/campaign/catalogue/template/RBAC change with before→after & approver); financial events (accrual, reversal, redemption, adjustment, settlement); security events (auth success/failure, signature failures, nonce replays, key rotation/revocation, privilege changes, reveal/export of sensitive data). |
| Signing-event capture | SIGNATURE_INVALID / SIGNATURE_EXPIRED / NONCE_REPLAYED / UNKNOWN_KEY are logged as security events with the offending KeyId and source for alerting. |
| Retention | Audit & approval history retained for the programme lifetime (and per regulatory minimums); operational logs per the Bank retention policy; encrypted backups of audit store. |
| SIEM forwarding | Security events forwarded to the the Bank SIEM in near-real-time for correlation, alerting and incident response. |
| Access-to-logs auditing | Read/query/export of logs & audit records is itself logged (who, what, when); access is RBAC-restricted; reveal of masked data is step-up gated and audited. |
Compliance Posture
| Area | Approach |
| Data localisation | In-country, in-bank deployment; no PII egress. |
| Card data handling | Tokenised; no PAN storage — minimises PCI-DSS scope; align to bank's PCI controls. |
| Privacy (DPDP) | Consent capture for communications; purpose limitation; data minimisation; retention controls. |
| Regulatory (RBI guidance) | Audit trail, access control, reconciliation & outsourcing-governance alignment. |
| Change governance | Maker-checker, versioning & segregation of duties. |
Specific certification scope (PCI-DSS, ISO 27001) and regulatory interpretation are confirmed jointly with the Bank Information Security & Compliance during design authority review.
Resilience, Backup & DR
| Aspect | Target / approach |
| Availability | 99.9% customer-facing & redemption services. |
| RPO | ≤ 15 minutes (ledger & config). |
| RTO | ≤ 2 hours. |
| Backups | Automated encrypted backups; periodic restore tests. |
| DR | Async replica in secondary site; documented failover runbook. |
| Degradation | Queue redemptions if fulfilment slow; batch continues independently. |
Non-Functional Targets (consolidated)
| Category | Target |
| Accrual throughput | ≥ 1,000 txn/s (batch); API posting ≤ 2s. |
| Redemption latency | ≤ 1.5s P95. |
| Scale | 10M+ cards; 50M+ txn/month. |
| Integrity | Exactly-once accrual; zero double-credit/debit. |
| Observability | Metrics, logs, traces, health, alerting. |
| Accessibility | Customer UI WCAG 2.1 AA. |
Threat Model (summary)
| Threat | Mitigation |
| Replay / double redemption | Idempotency keys, atomic ledger debit, step-up auth. |
| Privilege escalation | RBAC, least privilege, maker-checker, audited role changes. |
| Data exfiltration | In-bank residency, egress allow-list, masking, DLP-friendly logging. |
| Tampering with rules/ledger | Immutable ledger, versioned config, approval workflow, audit. |
| Partner endpoint compromise | mTLS, signed webhooks, allow-listed endpoints, circuit breakers. |
| Reward fraud / abuse | Caps, exclusions, velocity checks, anomaly reporting. |