Compliance and Governance
Frameworks and operational guidance for SOC 2, ISO 27001, GDPR, and accessibility compliance.
Core principle: Compliance built into daily operations beats point-in-time audit preparation. Automate evidence collection before you need it.
When to Use
- Enterprise customer requires SOC 2 report
- Entering a regulated industry (healthcare, finance, government)
- GDPR obligations triggered by EU user data
- Preparing for ISO 27001 certification
- Conducting gap analysis against a compliance framework
- Building automated evidence collection
When NOT to Use
- Security vulnerability remediation (use security-hardening skill)
- WCAG implementation in UI components (use ui-components skill)
- Internal policy writing without compliance framework context
SOC 2
Type I vs Type II
| Aspect |
Type I |
Type II |
| What it tests |
Control design at a point in time |
Design AND operation over 6-12 months |
| Timeline |
4-6 weeks prep + audit |
6-12 month observation + audit |
| Cost |
$20K-$50K |
$30K-$100K+ |
| Use when |
First compliance milestone, fast enterprise sales |
Mature orgs, stringent customer requirements |
Trust Service Criteria (TSC)
Security (CC1-CC9) is mandatory. Others optional but often requested.
| Criteria Group |
Focus |
| CC1 Control Environment |
Integrity, ethics, org structure |
| CC2 Communication |
Info quality, internal/external comms |
| CC3 Risk Assessment |
Risk ID, fraud risk, change impact |
| CC4 Monitoring |
Ongoing monitoring, deficiency evaluation |
| CC5 Control Activities |
Policies, procedures, tech controls |
| CC6 Logical & Physical Access |
Auth, provisioning, encryption |
| CC7 System Operations |
Vulnerability mgmt, incident response |
| CC8 Change Management |
Change authorization, testing, approval |
| CC9 Risk Mitigation |
Vendor/partner risk management |
Optional: Availability (A1), Confidentiality (C1), Processing Integrity (PI1), Privacy (P1-P8).
Control Matrix
Every control needs:
Control ID: SEC-001
TSC Mapping: CC6.1, CC6.2
Description: MFA is required for all privileged access
Type: Preventive
Owner: Security Engineering
Frequency: Continuous
Evidence: IAM policy config, MFA enforcement logs
Testing Procedure: Auditor verifies MFA required via identity provider config
Evidence Automation
| Control Area |
Evidence |
Automation |
| Access reviews |
Quarterly user access reports |
Scheduled IAM exports + email workflow |
| Change management |
PR history, deployment logs |
Git + CI/CD pipeline logs |
| Vulnerability management |
Scan reports, patch SLA tracking |
Scheduled scans, automated reports |
| Incident response |
Incident tickets, postmortems |
Alert system → ticket creation |
| Encryption |
Config screenshots, key rotation logs |
IaC snapshots, HSM audit logs |
| Employee training |
Completion records |
LMS export, e-signature tracking |
| Vendor assessments |
SOC 2 reports, questionnaires |
Vendor registry with renewal reminders |
Pre-Audit Readiness (4-6 Weeks Before)
ISO 27001
ISMS Lifecycle
Plan → Define scope, risk assessment, security policy, controls
Do → Implement controls, security awareness training
Check → Internal audit, incident analysis, metrics review
Act → Corrective actions, management review, continuous improvement
Risk Assessment
1. Asset inventory (systems, data, services)
2. Threat analysis (unauthorized access, malware, outages, human error)
3. Vulnerability assessment (unpatched systems, weak config, training gaps)
4. Risk score = Likelihood (1-5) × Impact (1-5)
5. Risk treatment: Accept | Mitigate | Transfer | Avoid
| Score |
Treatment |
Timeline |
| 20-25 (Critical) |
Immediate mitigation |
<2 weeks |
| 15-19 (High) |
Planned remediation |
<30 days |
| 10-14 (Medium) |
Scheduled work |
<90 days |
| <10 (Low) |
Accept or monitor |
Next cycle |
Statement of Applicability (SoA)
Document which ISO 27002 controls apply and why:
Control A.8.1 Access Control Policy
Applicable: Yes
Justification: Required to manage user access to production systems
Implementation: IAM policies enforced via Okta + AWS IAM
Mark non-applicable controls with clear justification (e.g., "Physical security outsourced to cloud provider").
Certification Stages
- Stage 1 (Documentation): ISMS scope, risk assessment, SoA, policy reviewed
- Stage 2 (Implementation, 6+ months operation required): Controls verified operational, evidence reviewed
- Annual surveillance: Focused review of key controls, corrective actions
GDPR
Legal Bases (Must document for EVERY processing activity)
| Basis |
When |
Example |
| Consent (6.1.a) |
Explicit opt-in obtained |
Marketing emails, analytics |
| Contract (6.1.b) |
Necessary to perform service |
Order fulfillment, billing |
| Legal Obligation (6.1.c) |
Law requires it |
Tax records, employment |
| Legitimate Interests (6.1.f) |
Org interest + balancing test |
Fraud prevention, security |
Data Subject Rights (30-day response, extendable to 90)
| Right |
Article |
Obligation |
| Access |
15 |
Provide copy of personal data + processing info |
| Rectification |
16 |
Correct inaccurate data |
| Erasure |
17 |
Delete data (with legal obligation exceptions) |
| Portability |
20 |
Provide data in machine-readable format |
| Objection |
21 |
Stop processing based on legitimate interests |
Build a process: Intake form → identity verification → 30-day clock → fulfillment.
Records of Processing Activities (RoPA — Art. 30)
For each processing activity document:
- Purpose, legal basis, categories of personal data
- Who has access (internal teams, vendors)
- Retention period
- Security measures
Breach Notification (Art. 33-34)
| Timeline |
Action |
| Without undue delay (72hr target) |
Notify supervisory authority if risk to individuals |
| Without undue delay |
Notify affected data subjects if high risk |
| 30 days |
Final investigation report to regulator |
Log ALL breaches even if not reportable.
DPIA Required When
- Systematic monitoring at scale
- Large-scale processing of special categories (health, biometric)
- Automated decisions with legal/significant effect
- New technology with unclear privacy implications
Gap Analysis Methodology
Four-Step Process
- Document current controls — inventory all policies, procedures, technical controls
- Map to requirements — align each control to SOC 2 TSC, ISO 27001 Annex A, GDPR articles
- Identify gaps — missing, design gaps, operating gaps, partial implementation
- Prioritize remediation — Critical (<2 weeks), High (<30 days), Medium (<90 days), Low (next cycle)
Gap Types
| Type |
Definition |
Auditor Impact |
| Missing control |
No control exists for criterion |
Critical finding |
| Design gap |
Control doesn't adequately address criterion |
Major finding |
| Operating gap |
Control designed right but not consistently executed |
Major finding |
| Partial |
Control exists but evidence is incomplete |
Minor finding |
Continuous Compliance
From Point-in-Time to Ongoing
| Aspect |
Point-in-Time |
Continuous |
| Evidence |
Manual before audit |
Automated, always available |
| Detection |
Found during audit |
Real-time drift alerts |
| Prep burden |
4-8 week scramble |
Always ready |
Implementation
1. Automate evidence: cron exports, IaC snapshots, API integrations
2. Centralize: evidence repository with timestamps (evidence/access/, evidence/change/, etc.)
3. Alert on drift: notify when controls fall out of compliance
4. Review cadence: monthly control owner check-in, quarterly steering review
Vendor Management
| Tier |
Data Access |
Assessment Frequency |
| Critical |
Processes customer data |
Annual + continuous monitoring |
| High |
Accesses customer environment |
Annual |
| Medium |
Indirect access |
Annual |
| Low |
No data access |
Biennial |
Maintain a vendor registry with risk tier, last assessment date, and SOC 2 report status.
Common Anti-Patterns
| Anti-Pattern |
Fix |
| Annual scramble for audit evidence |
Automate evidence collection continuously |
| Copy-pasted generic policies |
Tailor to actual technology and processes |
| SOC 2 treated as a project |
Build compliance into daily operations |
| Vendor assessments missing |
Maintain vendor registry with renewal dates |
| RLS/security theater (controls on paper only) |
Verify operating effectiveness |
| GDPR rights process undocumented |
Build intake form + 30-day tracking workflow |
Verification Checklist
SOC 2:
ISO 27001:
GDPR:
General:
1---2name: compliance-and-governance3description: Use when preparing for SOC 2 Type I or Type II audits, implementing ISO 27001 ISMS, achieving GDPR compliance, conducting gap analysis against compliance frameworks, mapping controls to audit criteria, collecting and automating audit evidence, designing continuous compliance monitoring, or managing vendor risk assessments. Apply to SaaS companies, regulated industries, or any organization requiring third-party security or privacy assurance.4---56# Compliance and Governance78Frameworks and operational guidance for SOC 2, ISO 27001, GDPR, and accessibility compliance.910**Core principle:** Compliance built into daily operations beats point-in-time audit preparation. Automate evidence collection before you need it.1112## When to Use1314- Enterprise customer requires SOC 2 report15- Entering a regulated industry (healthcare, finance, government)16- GDPR obligations triggered by EU user data17- Preparing for ISO 27001 certification18- Conducting gap analysis against a compliance framework19- Building automated evidence collection2021## When NOT to Use2223- Security vulnerability remediation (use security-hardening skill)24- WCAG implementation in UI components (use ui-components skill)25- Internal policy writing without compliance framework context2627---2829## SOC 23031### Type I vs Type II3233| Aspect | Type I | Type II |34|--------|--------|---------|35| What it tests | Control design at a point in time | Design AND operation over 6-12 months |36| Timeline | 4-6 weeks prep + audit | 6-12 month observation + audit |37| Cost | $20K-$50K | $30K-$100K+ |38| Use when | First compliance milestone, fast enterprise sales | Mature orgs, stringent customer requirements |3940### Trust Service Criteria (TSC)4142**Security (CC1-CC9) is mandatory.** Others optional but often requested.4344| Criteria Group | Focus |45|---------------|-------|46| **CC1** Control Environment | Integrity, ethics, org structure |47| **CC2** Communication | Info quality, internal/external comms |48| **CC3** Risk Assessment | Risk ID, fraud risk, change impact |49| **CC4** Monitoring | Ongoing monitoring, deficiency evaluation |50| **CC5** Control Activities | Policies, procedures, tech controls |51| **CC6** Logical & Physical Access | Auth, provisioning, encryption |52| **CC7** System Operations | Vulnerability mgmt, incident response |53| **CC8** Change Management | Change authorization, testing, approval |54| **CC9** Risk Mitigation | Vendor/partner risk management |5556Optional: Availability (A1), Confidentiality (C1), Processing Integrity (PI1), Privacy (P1-P8).5758### Control Matrix5960Every control needs:6162```63Control ID: SEC-00164TSC Mapping: CC6.1, CC6.265Description: MFA is required for all privileged access66Type: Preventive67Owner: Security Engineering68Frequency: Continuous69Evidence: IAM policy config, MFA enforcement logs70Testing Procedure: Auditor verifies MFA required via identity provider config71```7273### Evidence Automation7475| Control Area | Evidence | Automation |76|---|---|---|77| Access reviews | Quarterly user access reports | Scheduled IAM exports + email workflow |78| Change management | PR history, deployment logs | Git + CI/CD pipeline logs |79| Vulnerability management | Scan reports, patch SLA tracking | Scheduled scans, automated reports |80| Incident response | Incident tickets, postmortems | Alert system → ticket creation |81| Encryption | Config screenshots, key rotation logs | IaC snapshots, HSM audit logs |82| Employee training | Completion records | LMS export, e-signature tracking |83| Vendor assessments | SOC 2 reports, questionnaires | Vendor registry with renewal reminders |8485### Pre-Audit Readiness (4-6 Weeks Before)8687- [ ] All controls documented with owner, frequency, evidence type88- [ ] Evidence collected for full observation period (Type II)89- [ ] Gaps remediated90- [ ] Policies signed within last 12 months91- [ ] Access reviews completed per scheduled frequency92- [ ] Critical/high vulnerabilities patched per SLA93- [ ] Incident response plan tested within last 12 months94- [ ] DR/BCP tested and documented95- [ ] All vendor assessments current9697---9899## ISO 27001100101### ISMS Lifecycle102103```104Plan → Define scope, risk assessment, security policy, controls105Do → Implement controls, security awareness training106Check → Internal audit, incident analysis, metrics review107Act → Corrective actions, management review, continuous improvement108```109110### Risk Assessment111112```1131. Asset inventory (systems, data, services)1142. Threat analysis (unauthorized access, malware, outages, human error)1153. Vulnerability assessment (unpatched systems, weak config, training gaps)1164. Risk score = Likelihood (1-5) × Impact (1-5)1175. Risk treatment: Accept | Mitigate | Transfer | Avoid118```119120| Score | Treatment | Timeline |121|-------|-----------|---------|122| 20-25 (Critical) | Immediate mitigation | <2 weeks |123| 15-19 (High) | Planned remediation | <30 days |124| 10-14 (Medium) | Scheduled work | <90 days |125| <10 (Low) | Accept or monitor | Next cycle |126127### Statement of Applicability (SoA)128129Document which ISO 27002 controls apply and why:130131```132Control A.8.1 Access Control Policy133 Applicable: Yes134 Justification: Required to manage user access to production systems135 Implementation: IAM policies enforced via Okta + AWS IAM136```137138Mark non-applicable controls with clear justification (e.g., "Physical security outsourced to cloud provider").139140### Certification Stages141142- **Stage 1 (Documentation):** ISMS scope, risk assessment, SoA, policy reviewed143- **Stage 2 (Implementation, 6+ months operation required):** Controls verified operational, evidence reviewed144- **Annual surveillance:** Focused review of key controls, corrective actions145146---147148## GDPR149150### Legal Bases (Must document for EVERY processing activity)151152| Basis | When | Example |153|-------|------|---------|154| Consent (6.1.a) | Explicit opt-in obtained | Marketing emails, analytics |155| Contract (6.1.b) | Necessary to perform service | Order fulfillment, billing |156| Legal Obligation (6.1.c) | Law requires it | Tax records, employment |157| Legitimate Interests (6.1.f) | Org interest + balancing test | Fraud prevention, security |158159### Data Subject Rights (30-day response, extendable to 90)160161| Right | Article | Obligation |162|-------|---------|-----------|163| Access | 15 | Provide copy of personal data + processing info |164| Rectification | 16 | Correct inaccurate data |165| Erasure | 17 | Delete data (with legal obligation exceptions) |166| Portability | 20 | Provide data in machine-readable format |167| Objection | 21 | Stop processing based on legitimate interests |168169**Build a process:** Intake form → identity verification → 30-day clock → fulfillment.170171### Records of Processing Activities (RoPA — Art. 30)172173For each processing activity document:174- Purpose, legal basis, categories of personal data175- Who has access (internal teams, vendors)176- Retention period177- Security measures178179### Breach Notification (Art. 33-34)180181| Timeline | Action |182|----------|--------|183| Without undue delay (72hr target) | Notify supervisory authority if risk to individuals |184| Without undue delay | Notify affected data subjects if high risk |185| 30 days | Final investigation report to regulator |186187Log ALL breaches even if not reportable.188189### DPIA Required When190191- Systematic monitoring at scale192- Large-scale processing of special categories (health, biometric)193- Automated decisions with legal/significant effect194- New technology with unclear privacy implications195196---197198## Gap Analysis Methodology199200### Four-Step Process2012021. **Document current controls** — inventory all policies, procedures, technical controls2032. **Map to requirements** — align each control to SOC 2 TSC, ISO 27001 Annex A, GDPR articles2043. **Identify gaps** — missing, design gaps, operating gaps, partial implementation2054. **Prioritize remediation** — Critical (<2 weeks), High (<30 days), Medium (<90 days), Low (next cycle)206207### Gap Types208209| Type | Definition | Auditor Impact |210|------|-----------|----------------|211| Missing control | No control exists for criterion | Critical finding |212| Design gap | Control doesn't adequately address criterion | Major finding |213| Operating gap | Control designed right but not consistently executed | Major finding |214| Partial | Control exists but evidence is incomplete | Minor finding |215216---217218## Continuous Compliance219220### From Point-in-Time to Ongoing221222| Aspect | Point-in-Time | Continuous |223|--------|--------------|-----------|224| Evidence | Manual before audit | Automated, always available |225| Detection | Found during audit | Real-time drift alerts |226| Prep burden | 4-8 week scramble | Always ready |227228### Implementation229230```2311. Automate evidence: cron exports, IaC snapshots, API integrations2322. Centralize: evidence repository with timestamps (evidence/access/, evidence/change/, etc.)2333. Alert on drift: notify when controls fall out of compliance2344. Review cadence: monthly control owner check-in, quarterly steering review235```236237### Vendor Management238239| Tier | Data Access | Assessment Frequency |240|------|-------------|---------------------|241| Critical | Processes customer data | Annual + continuous monitoring |242| High | Accesses customer environment | Annual |243| Medium | Indirect access | Annual |244| Low | No data access | Biennial |245246Maintain a vendor registry with risk tier, last assessment date, and SOC 2 report status.247248---249250## Common Anti-Patterns251252| Anti-Pattern | Fix |253|---|---|254| Annual scramble for audit evidence | Automate evidence collection continuously |255| Copy-pasted generic policies | Tailor to actual technology and processes |256| SOC 2 treated as a project | Build compliance into daily operations |257| Vendor assessments missing | Maintain vendor registry with renewal dates |258| RLS/security theater (controls on paper only) | Verify operating effectiveness |259| GDPR rights process undocumented | Build intake form + 30-day tracking workflow |260261## Verification Checklist262263**SOC 2:**264- [ ] Control matrix complete (owner, frequency, evidence for each criterion)265- [ ] Evidence automated and centralized266- [ ] Access reviews executed per schedule267- [ ] Vendor assessments current for all critical/high vendors268- [ ] Incident response plan tested within 12 months269270**ISO 27001:**271- [ ] Risk assessment complete and dated272- [ ] Statement of Applicability reviewed273- [ ] ISMS scope documented274- [ ] Internal audit completed275- [ ] Management review conducted276277**GDPR:**278- [ ] RoPA complete for all processing activities279- [ ] Legal basis documented for each activity280- [ ] Data subject rights process documented and tested281- [ ] DPIAs completed for high-risk processing282- [ ] Breach response process documented283- [ ] Vendor DPAs signed284285**General:**286- [ ] Continuous evidence collection automated287- [ ] Compliance dashboard visible to security/engineering leadership288- [ ] Quarterly compliance review scheduled