Book 10 · Volume I — Security Architecture · Topic 1.4
Security vs Compliance
Reducing real risk while meeting external obligations efficiently
11 min readStage 4 · Production & architecture10 interview questions
Written byMaheshFounder · Senior Technical Architect
Chapter
Chapter 1 — Security Architecture Fundamentals
Prerequisites
Topics 1.1–1.3
You will be able to
Distinguish security and compliance goals, map one set of controls to multiple frameworks, reduce compliance scope architecturally, automate evidence, handle conflicts and exceptions, and communicate both security posture and compliance status
Security is the ongoing practice of reducing risk to assets from real threats. Compliance is demonstrating adherence to requirements set by regulators, standards bodies, contracts or internal policy, usually through evidence at points in time. They overlap heavily — most compliance requirements are security controls — but they are not the same: a system can pass an audit and still be breached, and a secure system can fail an audit for lack of evidence.
Figure 1 — Security vs compliance
Figure 2 — One control, many frameworks
Vocabulary
Meaning
Control framework
Set of controls (ISO 27001 Annex A, PCI DSS)
Scope
Systems subject to a requirement (e.g. PCI CDE)
Evidence
Artefacts proving a control operates
Common control framework
Unified controls mapped to many frameworks
Table 1 — Terms
2Why It Exists
Compliance-only mindset
Security-first mindset
"Is the checkbox ticked?"
"Is the risk reduced?"
Annual audit sprint
Continuous controls and evidence
Minimum requirements
Threat-driven controls
Duplicate evidence per framework
Map once, reuse
Table 2 — Why distinguish
3Core Concepts — Frameworks and Regulations
Framework/regulation
Scope for our examples
PCI DSS 4.0
PayGrid and ShopNow card data environments
ISO/IEC 27001:2022
Organisation-wide ISMS (all three)
SOC 2
PayGrid for enterprise merchants
RBI cyber security framework, IT outsourcing directions
4How It Works Internally — Common Control Framework
Step
Practice
Inventory requirements
Per framework and regulation
Define unified controls
E.g. "CTL-ENC-01: encrypt data at rest with managed keys"
Map
Each control to framework clauses
Implement as code
SCPs, Config rules, IaC modules, app libraries
Collect evidence automatically
Audit Manager, Config, Security Hub, Git history
Test controls
Continuous checks + periodic sampling
Report
Per framework from the same data
Table 4 — Map once, prove many times
Figure 3 — Continuous compliance
4ADeep Dive — Scope Reduction by Architecture
Technique
Effect
Tokenise card data at entry
Most services out of PCI scope
Isolate CDE in separate accounts/VPCs
Smaller audited surface
Hosted payment fields / iframes
Merchant pages out of scope
Data minimisation
Fewer DPDP obligations for unused data
Region locks
Residency compliance by construction
Table 5 — Architecture is the cheapest compliance tool
4BDeep Dive — Where Security Goes Beyond Compliance
Area
Compliance minimum
Security practice
Vulnerability scans
Quarterly (PCI)
Continuous scanning, fix SLAs
Pen tests
Annual
Plus red teams, bug bounty
Access reviews
Periodic
JIT, continuous unused-access analysis
Logging
Retain logs
Detect and respond in minutes
Threat modeling
Rarely required explicitly
Every significant change
Table 6 — Beyond the checklist
4CDeep Dive — When They Conflict
Conflict
Resolution
Mandated password rotation vs NIST guidance (rotate on compromise)
Satisfy requirement where binding; argue with evidence for modern controls (passkeys)
Log everything vs data minimisation
Log security events, mask personal data
Retention requirement vs deletion rights
Legal basis hierarchy; documented
Prescriptive control vs better alternative
Compensating control with documentation (PCI customised approach)
Table 7 — Navigate, don't ignore
4DDeep Dive — Risk Acceptance and Exceptions
Element
Practice
Risk register
Risks, owners, treatment
Exceptions
Time-bound, compensating controls, approver
Review
Quarterly
Evidence
Exception records for auditors
Table 8 — Transparent residual risk
4EDeep Dive — Roles and Metrics
Role
Responsibility
CISO
Security strategy and risk
GRC team
Frameworks, audits, evidence
Security architects
Controls in design
Engineering
Implement and operate controls
Internal audit
Independent assurance
Table 9 — Organisation
Metric
Use
Control pass rate (automated)
Compliance posture
Audit findings
Assurance quality
Incidents, MTTR, open criticals
Security outcomes
Table 10 — Measure both
5APIs / Features / Syntax
YAML
# Unified control definition mapped to multiple frameworks (GRC repo)id: CTL-ENC-01statement: "Data at rest encrypted with customer-managed KMS keys"mappings: pci_dss_4: ["3.5.1"] iso27001_2022: ["A.8.24"] rbi_csf: ["Data security - encryption"] soc2: ["CC6.1"]implementation: - scp-deny-unencrypted-volumes - config-rule-rds-encrypted - tf-module-defaultsevidence: [aws-config:rds-storage-encrypted, audit-manager:pci-framework]owner: platform-security
BASH
# Audit Manager: create an assessment from a standard framework and list evidence foldersaws auditmanager create-assessment --name "PCI-DSS-2026" \ --framework-id "$PCI_FRAMEWORK_ID" --scope file://pci-scope.json \ --assessment-reports-destination destinationType=S3,destination=s3://grc-reports \ --roles roleType=PROCESS_OWNER,roleArn="$GRC_ROLE_ARN"
JAVA
// Data minimisation for DPDP: log security events without personal datalog.atInfo() .addKeyValue("event", "LOGIN_FAILED") .addKeyValue("userRef", pseudonymise(userId)) // no name/phone/email .addKeyValue("reason", reason) .log("authentication failure");
6Practical Examples
6.1 Compliant but breached (industry lesson)
Many publicised breaches involved organisations that had passed audits; attackers used unpatched components or stolen credentials between assessments. ShopNow uses this to justify continuous controls beyond audit cycles.
6.2 PCI scope reduction
PayGrid tokenises card numbers at the edge of its CDE; only 4 services and 2 data stores remain in PCI scope, versus 60+ before redesign.
6.3 Evidence automation
NovaBank's evidence collection for its annual RBI and ISO audits dropped from 6 weeks to 1 week with Audit Manager, Config conformance packs and Git-based change records.
"Security reduces real risk continuously; compliance proves adherence to requirements. Design threat-driven controls, then map to frameworks via a common control framework; implement as code; automate evidence (Config, Security Hub, Audit Manager, Git); reduce scope architecturally (tokenisation, isolation, minimisation, region locks); go beyond minimums (continuous scanning, threat modeling, detection); handle conflicts with compensating controls and documented risk acceptance; measure both control pass rates and security outcomes."
Table 14 — Structured answer
6.8 Worked example — PayGrid SOC 2
Evidence
Source
Change management
PR approvals, pipeline logs
Access reviews
Identity Center exports
Table 15 — Same controls, another framework
6.9 Worked example — anti-patterns
Anti-pattern
Effect
Audit sprints
Controls lapse between audits
Framework silos
Duplicate work
Checkbox controls
No risk reduction
Undocumented exceptions
Audit findings
Table 16 — Common mistakes
6.10 Worked example — DPDP Act impacts
Obligation
Architectural impact
Consent and purpose
Consent service, purpose tags
Deletion on withdrawal
Data inventory, deletion workflows
Table 17 — Privacy compliance by design
6.11 Worked example — control testing
Control
Test
Encryption at rest
Config rule continuous
Access review
Sample quarterly
Table 18 — Continuous + sampling
6.12 Worked example — auditor collaboration
Practice
Detail
Read-only dashboards for auditors
Faster fieldwork
Table 19 — Transparency
6.13 Worked example — policy hierarchy
Level
Example
Policy
"Protect customer data"
Standard
"Encrypt with CMKs"
Control
CTL-ENC-01
Table 20 — Traceability
6.14 Worked example — board reporting
Section
Content
Compliance status
Frameworks, findings
Security posture
Incidents, risks, trends
Table 21 — Both views
6.15 Worked example — GDPR for EU plane
Requirement
Implementation
Data in EU
Region SCPs
DPIA
For new processing
Table 22 — Jurisdiction-specific
6.16 Worked example — interview follow-ups
Follow-up
Answer
"Can you be compliant but insecure?"
Yes — controls may be minimal or lapse between audits
"Cheapest way to reduce PCI effort?"
Reduce scope via tokenisation and isolation
Table 23 — Common probes
6.17 Worked example — checklist
Item
✔
Frameworks inventoried
✔
Common controls mapped
✔
Controls as code
✔
Evidence automated
✔
Scope minimised
✔
Exceptions governed
✔
Table 24 — Baseline
6.18 Worked example — vendor compliance
Vendor
Evidence required
SaaS processing PII
SOC 2/ISO, DPA, residency
Table 25 — Third-party obligations
6.19 Worked example — security beyond compliance budget
Investment
Reason
Bug bounty
Not required; finds real issues
Table 26 — Risk-driven spend
6.20 Worked example — compliance as code in CI
Check
Framework link
No public buckets (Checkov)
PCI 1.3, ISO A.8.20
Table 27 — Shift-left compliance
6.21 Worked example — interview scenario
Question
Answer
"Regulator requirement conflicts with best practice"
Comply where binding, document, propose compensating/modern controls
Table 28 — Pragmatic handling
6.22 Worked example — evidence retention
Evidence
Retention
Audit artefacts
7 years
Table 29 — Future audits
6.23 Worked example — PCI customised approach
Use
Detail
Demonstrate objective met differently
Risk analysis + targeted testing
Table 30 — Flexibility in PCI 4.0
6.24 Worked example — continuous monitoring dashboard
Panel
Content
Control pass rate by framework
Daily
Table 31 — Always audit-ready
6.25 Worked example — breach notification
Regulation
Timeline
CERT-In
6 hours
DPDP
As prescribed to Board and affected principals
Table 32 — Operational readiness
6.26 Worked example — maturity goal
Stage
Characteristic
Target
Continuous compliance as by-product of secure engineering
Table 33 — End state
7Common Problems & Mistakes
Mistake
Fix
Compliance-driven design
Risk-driven
Siloed frameworks
Common controls
Manual evidence
Automation
Large scope
Architecture
Table 34 — Mistakes and fixes
The most expensive mistake is treating the audit as the goal. Teams run an audit sprint every spring, collect screenshots, close findings and then let controls drift for eleven months, so the organisation is compliant on one day a year and exposed on the rest. Siloed framework programmes are the second trap: PCI, ISO 27001, SOC 2 and RBI teams each ask engineering for the same encryption or access-review evidence in different formats, which burns goodwill and hides gaps. Scope is often accepted rather than designed, so card numbers or personal data leak into logs, analytics and test environments and pull dozens of services into audit. Finally, exceptions granted under deadline pressure are rarely time-bound, and auditors find them years later without an owner or compensating control.
8Performance & Production Considerations
Consideration
Practice
Control overhead
Automate
Evidence storage
Organised, retained
Audit disruption
Read-only access
Table 35 — Operating compliance
Run compliance as a production system rather than a project. Controls implemented as SCPs, Config rules and IaC modules should report continuously into Security Hub and Audit Manager, with failing controls raised as tickets that carry the same severity and service-level targets as security findings. Evidence needs an owner, a naming scheme and a retention policy, typically seven years in an immutable, versioned S3 bucket with Object Lock, so an auditor's request is a query rather than a search through inboxes. Give auditors read-only dashboards and sampled evidence packs so fieldwork does not interrupt engineers. Watch the operational cost too: noisy Config rules and excessive logging of personal data create cost and privacy risk, so tune rules and mask fields before they reach the log pipeline.
9Architecture & Design Considerations
Guideline
Detail
Security first
Threat-driven
Scope by design
Isolation, tokenisation
Evidence by design
Automation
Table 36 — Design guidance
10Interview Questions & Answers
Q1L1 · BasicConcept
What is the difference between security and compliance?
Security is about reducing real risk to assets from real threats, continuously; compliance is about demonstrating that you meet requirements set by regulators, standards or contracts, usually through evidence at a point in time. Security is risk-driven and outcome-focused, so it asks whether an attacker can actually reach customer data. Compliance is requirement-driven and evidence-focused, so it asks whether the control in PCI DSS 3.5.1 exists and can be proven. They overlap heavily because most compliance clauses are security controls, but they are not interchangeable. The practical rule is to design threat-driven controls first, then map them to frameworks and automate the evidence, rather than designing to the checklist.
Q2L1 · BasicTricky
Can a compliant system be insecure?
Yes, and it happens regularly. An audit samples controls at a point in time against a minimum baseline, so a system can pass while still having weaknesses the framework does not cover, or controls that lapse the week after fieldwork. Attackers exploit the gap: an unpatched library released between quarterly scans, a stolen credential for an account that passed its annual access review, or a business-logic flaw no checklist mentions. Many publicised breaches hit organisations holding a current PCI or ISO certificate. That is why ShopNow runs continuous scanning, threat modeling and detection beyond audit cycles. Treat a clean audit as evidence of discipline, not as proof of security.
Q3L2 · IntermediateConcept
What is a common control framework?
A common control framework is a single, organisation-wide set of controls, each mapped to the clauses of every framework and regulation that applies. Instead of separate PCI, ISO 27001, SOC 2 and RBI programmes, you define a control once, such as CTL-ENC-01 for encryption at rest with customer-managed KMS keys, and record that it satisfies PCI 3.5.1, ISO A.8.24, SOC 2 CC6.1 and the RBI data security requirement. The control has one owner, one implementation as code and one evidence stream. Reports for each framework are generated from the same data. The payoff is less duplicated effort, consistent controls across teams and much faster onboarding of a new framework.
Q4L2 · IntermediateDesign
How do you reduce PCI scope?
Reduce PCI scope by keeping card data out of as many systems as possible, because scope covers everything that stores, processes or transmits card numbers and everything connected to it. Tokenise the PAN at the earliest point, ideally with hosted payment fields or an iframe from the PSP so card data never touches your pages. Isolate the remaining cardholder data environment in dedicated AWS accounts and VPCs with tightly controlled connectivity. Make sure logs, analytics, backups and test data never contain PANs, using masking and data discovery tools. PayGrid's redesign cut scope from more than sixty services to four services and two data stores, which shrank audit effort dramatically.
Q5L3 · Senior EngineerInternals
How is compliance evidence automated?
Automate evidence by making the controls themselves produce it continuously. AWS Config rules and conformance packs record whether resources such as RDS instances or S3 buckets are encrypted and private, and Security Hub aggregates findings against standards such as PCI DSS and CIS. Audit Manager maps those signals to framework controls and assembles evidence folders for an assessment. Change management evidence comes from Git: pull request approvals, pipeline logs and signed artefacts show who changed what and who approved it. Access reviews come from Identity Center exports. Manual sampling remains for human processes. NovaBank cut evidence collection for its annual audits from six weeks to one this way.
Q6L3 · Senior EngineerConcept
What is a compensating control?
A compensating control is an alternative control that meets the objective of a requirement when the stated control cannot be implemented for a legitimate technical or business reason. It must address the same risk at least as well, go beyond other controls already required, and be documented with a risk analysis, an owner and a review date. For example, a legacy system that cannot support MFA might be isolated on its own network segment, reachable only through AWS Verified Access with strong authentication, with every session recorded. PCI DSS 4.0 formalises this through compensating control worksheets and its customised approach. Auditors accept them when the reasoning and testing are clearly evidenced.
Q7L4 · Technical ArchitectConcept
Which Indian regulations affect design?
Three shape most designs in India. The RBI cyber security framework and IT outsourcing directions govern banks and payment operators like NovaBank, covering board-approved security policy, outsourcing and cloud risk, audit rights over vendors and incident reporting. The Digital Personal Data Protection Act 2023 requires a lawful purpose and consent, data minimisation, honouring withdrawal and deletion, and breach notification, which drives consent services and data inventories. CERT-In directions require reporting cyber incidents within six hours and keeping logs for 180 days within India. RBI's payment data storage rule also requires payment system data to be stored only in India, which drives region locks such as ap-south-1.
Q8L4 · Technical ArchitectScenario
How do you handle conflicting requirements?
Comply where the requirement is legally or contractually binding, document the conflict, and propose a better control through the formal route rather than ignoring either side. For a mandated ninety-day password rotation that contradicts NIST guidance, satisfy it where binding while arguing with evidence for passkeys and compromise-based rotation. For logging everything versus data minimisation, log security events but mask or pseudonymise personal data. For retention versus deletion rights, apply the legal-basis hierarchy and record the decision. Where PCI allows it, use a compensating control or the customised approach. Record each resolution in an ADR with GRC and legal sign-off, so it is defensible at audit.
Q9L5 · Solution ArchitectDesign
What metrics show both views?
Report two families of metrics side by side, because each hides what the other shows. Compliance posture comes from automated control pass rates by framework, open and overdue audit findings, the number and age of exceptions, and time to produce evidence. Security outcomes come from incidents and their impact, mean time to detect and respond, open critical vulnerabilities against fix SLAs, and the trend in top risks on the register. A board pack showing ninety-eight percent control pass rate alongside rising critical vulnerabilities tells a very different story from the pass rate alone. Trends over quarters matter more than any single number, so present direction as well as value.
Q10L5 · Solution ArchitectConcept
What is the target maturity?
The target is continuous compliance as a by-product of secure engineering. Controls are defined once in a common control framework, implemented as code in SCPs, Config rules, IaC modules and application libraries, and checked in CI and in production every day. Evidence is collected automatically and retained, so the organisation is audit-ready at any moment and audit preparation takes days, not weeks. Scope is minimised by architecture, exceptions are time-bound and owned, and security work goes beyond the minimum through threat modeling, red teaming and detection. At that point the GRC team spends its time on risk judgement and new regulations rather than chasing screenshots from engineers.