← DevSecOps← DevSecOps
DevSecOpsDevSecOps19 Th7, 2026Jul 19, 202626 phút đọc19 min read

Compliance, Governance & Quản lý rủi roCompliance, Governance & Risk Management

Thuộc bộ kiến thức DevSecOps Roadmap.

Tổng quan

Compliance, governance và quản lý rủi ro (thường viết tắt là GRC) là chất keo tổ chức kết nối công việc kỹ thuật security với thực tế kinh doanh, pháp lý và hợp đồng. Một đội có thể ship phần mềm được scan, ký (sign), và hardening hoàn hảo nhưng vẫn trượt audit, mất hợp đồng khách hàng, hoặc bị phạt vì không thể chứng minh — bằng bằng chứng (evidence) — rằng các control của mình tồn tại và vận hành nhất quán theo thời gian.

Trong một tổ chức truyền thống, compliance là một đợt “chữa cháy” một năm một lần: bảng tính bị bỏ xó được lôi ra, screenshot được thu thập thủ công, auditor phỏng vấn kỹ sư trong hai tuần, rồi mọi thứ trở lại “bình thường” khi chứng chỉ được cấp. Mô hình này không sống sót nổi trước tốc độ delivery của DevSecOps, nơi hạ tầng thay đổi từng giờ, deployment diễn ra hàng chục lần một ngày, và “môi trường” đang bị audit không còn đứng yên đủ lâu để một snapshot còn đúng.

Câu trả lời của DevSecOps là compliance as code: mã hóa các yêu cầu control thành policy có thể đọc bằng máy, liên tục đánh giá hạ tầng và pipeline theo các policy đó, và tự động sinh ra bằng chứng audit như một sản phẩm phụ của công việc kỹ thuật hằng ngày thay vì một dự án riêng biệt, gây gián đoạn.

Vì sao compliance quan trọng

Động lựcMô tảVí dụ
Nghĩa vụ pháp lý / regulatoryLuật và quy định bắt buộc các control cụ thểGDPR (dữ liệu cá nhân EU), HIPAA (dữ liệu y tế Mỹ), PCI DSS (thanh toán thẻ)
Nghĩa vụ hợp đồngKhách hàng/đối tác yêu cầu bằng chứng control trước khi kýKhách hàng doanh nghiệp yêu cầu báo cáo SOC 2 trước khi mua hàng
Niềm tin thị trường / khách hàngChứng chỉ đóng vai trò tín hiệu tin cậy và công cụ bán hàngChứng chỉ ISO 27001 cần thiết để đấu thầu hợp đồng doanh nghiệp/chính phủ
Giảm rủi roFramework hệ thống hóa việc nhận diện và xử lý rủi roNIST CSF giảm khả năng/tác động của breach
Khả năng bảo hiểmNhà bảo hiểm cyber-insurance yêu cầu bằng chứng chương trình securityPhí bảo hiểm thấp hơn khi chứng minh có MFA, backup, kế hoạch incident response

Từ “chữa cháy hàng năm” đến continuous compliance

Compliance truyền thốngContinuous compliance (DevSecOps)
Audit tại một thời điểm, mỗi năm một lầnGiám sát control liên tục, tự động
Thu thập evidence thủ công (screenshot, spreadsheet)Evidence tự động thu thập từ API/log/pipeline
Compliance chỉ do đội GRC/legal sở hữuĐồng sở hữu giữa engineering, security và GRC
Control chỉ được ghi trong Word/ConfluenceControl mã hóa thành policy-as-code, versioned trong git
Chữa cháy audit làm gián đoạn engineering hàng tuầnAuditor được cấp quyền đọc trực tiếp vào dashboard/evidence repo
Lệch pha giữa trạng thái tài liệu và thực tế rất phổ biếnDrift được phát hiện tự động và cảnh báo

Kiến thức nền tảng

Ba trụ cột của GRC

Ba yếu tố này phụ thuộc lẫn nhau: governance định nghĩa cách quyết định về rủi ro được đưa ra; risk management quyết định cái gì cần được kiểm soát và ở mức độ nào; compliance chứng minh rằng các control đã chọn thực sự được triển khai và vận hành.

Các loại framework

LoạiMục đíchVí dụ
Risk management frameworkCấu trúc cách nhận diện/đánh giá/xử lý rủi roNIST CSF, NIST RMF (SP 800-37), ISO 31000
Management-system standard (có thể certify)Định nghĩa hệ thống chính sách/quy trình tổ chức vận hành, được audit độc lậpISO/IEC 27001, ISO 22301 (BCM), ISO 9001
Attestation reportÝ kiến độc lập của auditor về control trong một khoảng thời gianSOC 2, SOC 1
Regulation / luậtBắt buộc theo luật, được cơ quan quản lý/tòa án thực thiGDPR, HIPAA, SOX
Industry mandateYêu cầu bởi tổ chức ngành/thanh toán, không phải luậtPCI DSS
Control catalogDanh sách control chi tiết dùng làm baseline/tham chiếuNIST SP 800-53, CIS Controls

NIST Cybersecurity Framework (CSF)

NIST CSF (phiên bản hiện tại 2.0) là một framework tự nguyện, hướng theo kết quả (outcome-based), tổ chức quanh sáu Function cốt lõi (CSF 2.0 bổ sung Govern vào năm function ban đầu):

FunctionMục đíchHoạt động tiêu biểu
Govern (mới trong CSF 2.0)Thiết lập và giám sát chiến lược quản lý rủi ro, vai trò và chính sách của tổ chứcXác định risk appetite, phân công vai trò, đặt chính sách rủi ro chuỗi cung ứng
IdentifyHiểu asset, rủi ro và bối cảnh kinh doanhKiểm kê asset, đánh giá rủi ro, phân loại dữ liệu
ProtectTriển khai biện pháp bảo vệ để giới hạn/ngăn chặn tác độngAccess control, mã hóa, đào tạo security, secure SDLC
DetectPhát hiện sự kiện security kịp thờiLogging/monitoring, phát hiện bất thường, quét vulnerability
RespondHành động khi phát hiện incidentKế hoạch incident response, truyền thông, giảm nhẹ
RecoverKhôi phục năng lực/dịch vụ bị ảnh hưởng bởi incidentBackup/restore, disaster recovery, review sau incident

CSF không phải là checklist để “pass” — tổ chức dùng Tiers (Partial → Risk Informed → Repeatable → Adaptive) để mô tả độ trưởng thành của chương trình và Profiles (Current vs. Target) để lập kế hoạch cải tiến, khiến nó phù hợp tự nhiên với cải tiến lặp lại kiểu DevSecOps hơn là một cuộc audit một lần.

NIST SP 800-53 nhìn tổng quan

SP 800-53 là một catalog chi tiết các control về security và privacy, tổ chức thành các họ control (control family), được sử dụng nhiều bởi các cơ quan liên bang Mỹ (qua FedRAMP/FISMA) và được áp dụng rộng rãi như một baseline control ở nơi khác.

Họ control (ví dụ)Trọng tâm
AC — Access ControlLeast privilege, quản lý tài khoản, kiểm soát session
AU — Audit and AccountabilityLogging, review log, lưu trữ audit record
CM — Configuration ManagementBaseline config, kiểm soát thay đổi, drift của IaC
IA — Identification and AuthenticationMFA, xác minh danh tính
IR — Incident ResponseLập kế hoạch, xử lý, báo cáo incident
RA — Risk AssessmentQuét vulnerability, tần suất đánh giá rủi ro
SA — System and Services AcquisitionSecure SDLC, chuỗi cung ứng, rủi ro bên thứ ba
SC — System and Communications ProtectionMã hóa in-transit/at-rest, phân đoạn mạng
SI — System and Information IntegrityQuản lý patch, chống mã độc, kiểm tra SBOM/integrity

Control được tùy chỉnh thành các baseline (Low/Moderate/High impact) dựa trên tác động tiềm tàng của một vụ breach (theo FIPS 199), nên một trang web marketing công khai và một hệ thống chứa dữ liệu y tế được quản lý sẽ dùng bộ control rất khác nhau dù cùng dựa trên một catalog.

ISO/IEC 27001 và ISMS

ISO/IEC 27001 chứng nhận không phải một phần mềm mà là một Information Security Management System (ISMS): quy trình quản lý liên tục, có tài liệu mà tổ chức vận hành để nhận diện rủi ro bảo mật thông tin và xử lý chúng.

Chu trình PDCA (động cơ cải tiến liên tục kinh điển làm nền cho ISMS, vẫn là mô hình tư duy thực tiễn dù bản sửa đổi 2022 ánh xạ nó vào các điều khoản “cấu trúc bậc cao” hài hòa của ISO):

Giai đoạnHoạt động
Plan (Lập kế hoạch)Xác định phạm vi ISMS, phương pháp đánh giá rủi ro, kế hoạch xử lý rủi ro, Statement of Applicability (SoA)
Do (Thực hiện)Triển khai control, đào tạo/nâng cao nhận thức, vận hành ISMS hàng ngày
Check (Kiểm tra)Audit nội bộ, review của ban lãnh đạo, giám sát/đo lường hiệu quả control
Act (Hành động)Hành động khắc phục, cải tiến liên tục, cập nhật xử lý rủi ro dựa trên phát hiện

Annex A controls: Annex A của ISO/IEC 27001:2022 tái cấu trúc 14 domain trước đó thành 4 chủ đề (theme) và 93 control:

ThemeControl ví dụ
Organizational (37 control)Chính sách bảo mật thông tin, quan hệ nhà cung cấp, ICT continuity, threat intelligence
People (8 control)Sàng lọc nhân sự, điều khoản lao động, nâng cao nhận thức security, quy trình kỷ luật
Physical (14 control)Kiểm soát ra vào vật lý, bảo trì thiết bị, tiêu hủy an toàn
Technological (34 control)Access control, mã hóa, secure coding, logging, DLP, backup

Quy trình chứng nhận nhìn tổng quan:

  1. Gap analysis — đánh giá trạng thái hiện tại so với yêu cầu Annex A / ISMS.
  2. Xác định phạm vi (scope) — quyết định các đơn vị kinh doanh, hệ thống và địa điểm nào ISMS bao phủ.
  3. Đánh giá & xử lý rủi ro — nhận diện rủi ro, chọn phương án xử lý, tạo SoA (control nào áp dụng/loại trừ và tại sao).
  4. Triển khai — rollout chính sách, control, đào tạo trong một khoảng thời gian (thường 3–12 tháng).
  5. Audit nội bộ & review lãnh đạo — tự kiểm tra mức độ sẵn sàng trước audit bên ngoài.
  6. Stage 1 audit (bên ngoài) — review tài liệu; auditor xác nhận ISMS được thiết kế đúng.
  7. Stage 2 audit (bên ngoài) — audit dựa trên bằng chứng rằng ISMS vận hành hiệu quả trong thực tế.
  8. Chứng nhận — có hiệu lực 3 năm, kèm surveillance audit hàng năm và recertification audit vào năm thứ 3.

SOC 2

SOC 2 (“System and Organization Controls 2”) là một báo cáo attestation được định nghĩa bởi AICPA, cực kỳ phổ biến trong giới B2B SaaS bán cho doanh nghiệp. Khác với ISO 27001 (chứng nhận theo một standard), SOC 2 là ý kiến của một auditor độc lập, dựa trên Trust Services Criteria (TSC) của AICPA.

Trust Services Criteria:

Tiêu chíBắt buộc?Trọng tâm
Security (the “Common Criteria”)Luôn bắt buộcBảo vệ chống truy cập trái phép — baseline cho mọi báo cáo SOC 2
AvailabilityTùy chọnHệ thống sẵn sàng vận hành/sử dụng như cam kết
ConfidentialityTùy chọnThông tin được đánh dấu là bảo mật được bảo vệ
Processing IntegrityTùy chọnXử lý của hệ thống hoàn chỉnh, hợp lệ, chính xác, kịp thời, được phê duyệt
PrivacyTùy chọnThông tin cá nhân được thu thập/sử dụng/lưu trữ/tiết lộ theo cam kết

Hầu hết công ty theo đuổi Security cộng với Availability và/hoặc Confidentiality; Privacy ít được đưa vào hơn vì tuân thủ GDPR/CCPA thường được xử lý riêng.

Type I vs. Type II:

Type IType II
Đánh giá gìThiết kế của control tại một thời điểmThiết kế hiệu quả vận hành của control trong một khoảng thời gian
Khoảng thời gian điển hìnhSnapshot (tại một ngày)3–12 tháng (thường 6 hoặc 12)
Nỗ lựcThấp hơn — “control có được thiết kế đúng không”Cao hơn — auditor lấy mẫu evidence xuyên suốt kỳ
Cảm nhận của khách hàngTín hiệu yếu hơn — thường là bước đệmTín hiệu mạnh — thứ enterprise procurement thường yêu cầu
Dùng phổ biếnBáo cáo lần đầu cho công ty giai đoạn đầuBáo cáo thường niên khi chương trình đã trưởng thành

Vì sao công ty SaaS theo đuổi SOC 2: khách hàng doanh nghiệp gần như luôn yêu cầu nó (hoặc ISO 27001) trong quá trình review security khi mua hàng; nó thay thế việc khách hàng tự audit vendor; và khác với ISO 27001, nó khớp tự nhiên với các quy trình bán hàng doanh nghiệp mang tính Mỹ hóa.

Khái niệm chính

Ánh xạ control (control mapping) và sự chồng lấn framework

Các tổ chức thực tế hiếm khi chỉ tuân thủ một framework — một công ty SaaS bán cho doanh nghiệp và chính phủ có thể cần đồng thời SOC 2, ISO 27001, và NIST 800-53 (qua FedRAMP), cộng thêm PCI DSS nếu xử lý thanh toán thẻ. Xây dựng lại một bộ control và quy trình evidence riêng cho mỗi framework là lãng phí và thiếu nhất quán.

Control mapping tận dụng thực tế rằng hầu hết các framework mô tả cùng những thực hành security cơ bản bằng ngôn từ và mức độ chi tiết khác nhau. Một control kỹ thuật có thể thỏa mãn nhiều yêu cầu framework cùng lúc:

Control kỹ thuậtNIST 800-53ISO 27001 Annex ASOC 2 TSC
Bắt buộc MFA cho truy cập đặc quyềnIA-28.5 (Secure authentication)CC6.1
Audit logging tập trung, chống giả mạoAU-2, AU-68.15 (Logging)CC7.2
Quét vulnerability tự độngRA-58.8 (Management of technical vulnerabilities)CC7.1
Kế hoạch incident response có tài liệu + diễn tậpIR-4, IR-85.24–5.26 (Incident management)CC7.3, CC7.4
Mã hóa dữ liệu at-rest và in-transitSC-13, SC-288.24 (Cryptography)CC6.7
Review quyền truy cập least-privilege (hàng quý)AC-2, AC-65.15, 5.18 (Access control)CC6.2, CC6.3

Các tổ chức chính thức hóa điều này bằng một unified control framework (UCF) hoặc common control framework (CCF): một ID control nội bộ cho mỗi thực hành, được ánh xạ (“mapped”) chéo tới điều khoản/số control của từng framework bên ngoài. Công cụ GRC (Vanta, Drata, Secureframe, OneTrust, ServiceNow GRC, hoặc một spreadsheet/mô hình OSCAL tự xây dựng) duy trì mapping này để một mẩu evidence duy nhất — ví dụ, một bản export chính sách IAM cho thấy MFA được bắt buộc — được tái sử dụng cho mọi audit cần nó, thay vì phải thu thập N lần.

Tự động hóa thu thập evidence

Thu thập evidence thủ công (ai đó chụp screenshot IAM console mỗi quý một lần) chậm, dễ sai và đã lỗi thời ngay khi được chụp. Continuous compliance tự động hóa việc này:

Chương trình quản lý rủi ro

Quản lý rủi ro là xương sống phân tích quyết định control nào quan trọng và đầu tư bao nhiêu công sức cho chúng; xem thêm ./06-threat-modeling-and-risk-assessment.md cho khía cạnh kỹ thuật, cấp hệ thống của cùng kỷ luật này.

Các thành phần cốt lõi:

Các phương án xử lý rủi ro (“4 chữ T”):

Xử lýMô tảVí dụ
Accept (chấp nhận)Ghi nhận rủi ro và không hành động thêm (có tài liệu, có phê duyệt) vì chi phí xử lý vượt lợi ích hoặc tác động nhỏChấp nhận một finding mức độ thấp trên một công cụ nội bộ, không nhạy cảm
Mitigate (giảm thiểu)Triển khai control để giảm khả năng xảy ra và/hoặc tác độngThêm rule WAF và rate limiting để giảm rủi ro DoS
Transfer (chuyển giao)Chuyển một phần tác động tài chính/vận hành cho bên thứ baBảo hiểm cyber-insurance, outsource cho vendor có trách nhiệm hợp đồng
Avoid (né tránh)Loại bỏ rủi ro bằng cách không thực hiện hoạt động rủi ro đóTừ chối lưu trữ dữ liệu thẻ, dùng payment processor tokenized thay thế

Đánh giá rủi ro vừa mang tính định kỳ (ví dụ: đánh giá rủi ro doanh nghiệp hàng năm, threat modeling theo từng dự án) vừa liên tục trong DevSecOps: mỗi service, dependency, hoặc thay đổi kiến trúc mới nên kích hoạt một đợt đánh giá lại rủi ro nhẹ, cập nhật lại risk register thay vì chờ chu kỳ hàng năm tiếp theo.

Cấu trúc governance

Cấp độBắt buộc?Chủ sở hữuTần suất thay đổi
PolicyBan lãnh đạo điều hành / CISOHiếm (review hàng năm)
StandardĐội security/architectureThỉnh thoảng (khi công nghệ đổi)
GuidelineKhông (khuyến nghị)Đội security/engineeringThường xuyên
Procedure/runbookCó (cho task nó bao phủ)Đội vận hànhThường xuyên

Security steering committee (ban chỉ đạo security): một nhóm chức năng chéo, họp định kỳ (thường gồm CISO/trưởng security, lãnh đạo engineering, legal/privacy, và stakeholder kinh doanh) review risk register, phê duyệt thay đổi policy, ưu tiên đầu tư security, và phê duyệt các risk acceptance vượt ngưỡng ủy quyền. Đây là diễn đàn nơi các quyết định governance thực sự được đưa ra và ghi nhận.

Vai trò và trách nhiệm (RACI) làm rõ ai Responsible (thực hiện), Accountable (chịu trách nhiệm cuối), Consulted (được tham vấn), và Informed (được thông báo) cho mỗi control/hoạt động — thiết yếu một khi “ai cũng sở hữu security” va chạm với thực tế rằng quyền sở hữu không rõ ràng đồng nghĩa không việc gì được hoàn thành.

Hoạt độngEngineeringSecurity/DevSecOpsGRC/ComplianceĐiều hành/CISO
Triển khai control kỹ thuật (vd MFA)RAII
Định nghĩa yêu cầu control/standardCR/ACI
Thu thập & xác thực evidence auditCRAI
Chấp nhận rủi ro (vượt ngưỡng)ICCA/R
Đầu mối liên hệ audit bên ngoàiICR/AI
Phê duyệt policyICCA/R
Thực thi incident responseRAII

(R = Responsible, A = Accountable, C = Consulted, I = Informed)

Best Practices

Xây dựng pipeline compliance-as-code

  1. Bắt đầu từ một control mapping, không phải danh sách framework. Xây một catalog control nội bộ và map mọi điều khoản framework áp dụng vào đó, để framework mới chỉ là bổ sung, không phải xây lại từ đầu.
  2. Mã hóa control thành policy-as-code khi có thể. Dùng OPA/Rego, Sentinel, hoặc policy engine gốc của cloud để việc kiểm tra control được tự động hóa, versioned và test được như bất kỳ code nào khác.
  3. Kết nối thu thập evidence vào pipeline hiện có. Tái sử dụng dữ liệu SBOM, SAST/DAST/SCA, và phê duyệt deployment mà CI/CD đã sinh ra sẵn (xem ./12-cicd-and-supply-chain-security.md) thay vì tạo ra một quy trình evidence song song.
  4. Fail nhanh khi có drift. Xử lý một vi phạm control compliance (vd một S3 bucket mất mã hóa) giống như một test fail: cảnh báo ngay lập tức, đừng chờ đến chu kỳ audit tiếp theo mới phát hiện ra.
  5. Duy trì một kho evidence sẵn sàng audit quanh năm. Cấp cho auditor quyền truy cập đọc, giới hạn phạm vi và thời gian vào dashboard/kho evidence thay vì một đợt “chạy nước rút” thu thập evidence thủ công trước mỗi audit.
  6. Version và diff policy như code. Lưu policy-as-code và định nghĩa control trong git, yêu cầu review khi thay đổi, và giữ changelog — bản thân điều này trở thành evidence cho change management.
  7. Gắn item trong risk register với công việc backlog. Mỗi rủi ro được chấp nhận/giảm thiểu nên có ticket, owner và ngày đến hạn tương ứng được theo dõi trong cùng hệ thống mà kỹ sư đã dùng, không phải một spreadsheet riêng không ai mở.
  8. Tự động hóa các review định kỳ. Review quyền truy cập hàng quý, đánh giá lại rủi ro vendor, và chu kỳ review policy nên được lên lịch và theo dõi bằng nhắc nhở/tự động hóa, không phải dựa vào trí nhớ.
  9. Chọn đúng số lượng framework cần thiết. Đừng theo đuổi mọi chứng chỉ có sẵn — chọn framework dựa trên yêu cầu thực tế của khách hàng/pháp lý, và sắp xếp thứ tự (ví dụ: SOC 2 Type I → Type II → ISO 27001) thay vì cố làm mọi thứ cùng lúc.
  10. Làm cho quyết định governance minh bạch và truy vết được. Ghi lại quyết định của steering committee, chấp nhận rủi ro, và ngoại lệ policy kèm owner, lý do, và ngày hết hạn — ngoại lệ không được ghi chép là một trong những finding audit phổ biến nhất.
  11. Xử lý compliance ở quy mô lớn một cách chủ động. Khi tổ chức và dấu chân cloud phát triển, công cụ compliance và quy trình governance cũng phải mở rộng theo — xem ./17-enterprise-security-at-scale.md để biết GRC tiến hóa thế nào qua nhiều đội, đơn vị kinh doanh, và tài khoản cloud.
  12. Đừng nhầm lẫn “compliant” với “an toàn”. Vượt qua một audit chứng minh sự tuân thủ với một baseline đã chọn, không phải sự vắng mặt của rủi ro — đưa threat intelligence thực tế và bài học từ incident quay trở lại cả risk register lẫn bộ control.

So sánh NIST CSF vs. ISO/IEC 27001 vs. SOC 2

Khía cạnhNIST CSFISO/IEC 27001SOC 2
LoạiFramework/hướng dẫn tự nguyệnStandard hệ thống quản lý có thể certifyBáo cáo attestation của auditor độc lập
Cơ quan ban hànhNIST (chính phủ Mỹ)ISO/IEC (quốc tế)AICPA (Mỹ)
Có thể certify?Không — tự đánh giá độ trưởng thành (Tiers)Có — tổ chức chứng nhận được công nhận cấp chứng chỉKhông có chứng chỉ — phát hành một báo cáo audit (ý kiến)
Phạm viQuản lý rủi ro cybersecurity toàn tổ chứcPhạm vi ISMS do tổ chức tự định nghĩa (có thể là một phần)Hệ thống/dịch vụ cụ thể trong phạm vi, theo Trust Services Criteria đã chọn
Cấu trúc cốt lõi6 Function (Govern, Identify, Protect, Detect, Respond, Recover)Chu trình PDCA + Annex A (93 control, 4 theme)Trust Services Criteria (Security bắt buộc + các hạng mục tùy chọn)
Hiệu lựcKhông áp dụng (mô hình tự cải tiến liên tục)3 năm, kèm surveillance audit hàng nămBáo cáo bao phủ một khoảng thời gian (Type II) hoặc một ngày (Type I); tái phát hành hàng năm
Đối tượng điển hìnhCơ quan liên bang Mỹ, hạ tầng trọng yếu, mọi tổ chức muốn có baseline quản lý rủi roDoanh nghiệp toàn cầu, đặc biệt cần công nhận quốc tếB2B SaaS mang tính Mỹ hóa bán cho khách hàng doanh nghiệp
Use case chínhCấu trúc hóa và truyền đạt một chương trình quản lý rủi ro cybersecurityChứng nhận chính thức chứng minh một ISMS đang vận hànhChứng minh cho khách hàng rằng các control cụ thể vận hành hiệu quả
Chi phí/nỗ lực tương đốiThấp đến trung bình (tự thực hiện)Cao (audit + vận hành ISMS liên tục)Trung bình đến cao (Type II cần evidence liên tục)

Tài liệu tham khảo

Part of the DevSecOps Roadmap knowledge base.

Overview

Compliance, governance, and risk management (often abbreviated GRC) are the organizational glue that connects security engineering work to business, legal, and contractual reality. A team can ship perfectly scanned, signed, and hardened software and still fail an audit, lose a customer contract, or face regulatory fines if it cannot prove — with evidence — that its controls exist and operate consistently over time.

In a traditional organization, compliance is a once-a-year fire drill: a spreadsheet is dusted off, screenshots are manually collected, auditors interview engineers for two weeks, and everyone goes back to “normal” once the certificate is issued. This model does not survive contact with DevSecOps-speed delivery, where infrastructure changes hourly, deployments happen dozens of times a day, and the “environment” being audited no longer sits still long enough for a snapshot to remain true.

The DevSecOps answer is compliance as code: encode control requirements as machine-readable policies, continuously evaluate infrastructure and pipelines against them, and generate audit evidence automatically as a byproduct of normal engineering work rather than as a separate, disruptive project.

Why compliance matters

DriverDescriptionExample
Legal / regulatory obligationLaws and regulations mandate specific controlsGDPR (EU personal data), HIPAA (US health data), PCI DSS (card payments)
Contractual obligationCustomers/partners require proof of controls before signingEnterprise customers demanding a SOC 2 report before procurement
Customer trust / market accessCertifications act as a trust signal and sales enablerISO 27001 certificate required to bid on enterprise or government contracts
Risk reductionFrameworks systematize the identification and treatment of riskNIST CSF reducing likelihood/impact of breaches
InsurabilityCyber-insurance underwriters require evidence of a security programLower premiums with demonstrated MFA, backups, incident response plan

From annual scramble to continuous compliance

Traditional complianceContinuous compliance (DevSecOps)
Annual point-in-time auditContinuous, automated control monitoring
Manual evidence collection (screenshots, spreadsheets)Evidence auto-collected from APIs/logs/pipelines
Compliance owned solely by GRC/legal teamShared ownership between engineering, security, and GRC
Controls documented in Word/Confluence onlyControls encoded as policy-as-code, versioned in git
Audit fire-drill disrupts engineering for weeksAuditors get read access to live dashboards/evidence repos
Drift between documented and actual state is commonDrift detected automatically and alerted on

Fundamentals

The three pillars of GRC

These three are interdependent: governance defines how decisions about risk are made; risk management decides what needs to be controlled and to what degree; compliance proves that the controls chosen are actually implemented and operating.

Types of frameworks

TypePurposeExamples
Risk management frameworkStructures how to identify/assess/treat riskNIST CSF, NIST RMF (SP 800-37), ISO 31000
Management-system standard (certifiable)Defines a system of policies/processes an organization runs, independently auditedISO/IEC 27001, ISO 22301 (BCM), ISO 9001
Attestation reportIndependent auditor opinion on controls over a periodSOC 2, SOC 1
Regulation / lawLegally mandated, enforced by regulators/courtsGDPR, HIPAA, SOX
Industry mandateRequired by a payment/industry body, not a lawPCI DSS
Control catalogA detailed list of controls used as a baseline/referenceNIST SP 800-53, CIS Controls

NIST Cybersecurity Framework (CSF)

The NIST CSF (current version 2.0) is a voluntary, outcome-based framework organized around six core Functions (2.0 added Govern to the original five):

FunctionPurposeRepresentative activities
Govern (new in CSF 2.0)Establish and monitor the organization’s risk management strategy, roles, and policyDefine risk appetite, assign roles, set supply-chain risk policy
IdentifyUnderstand assets, risks, and business contextAsset inventory, risk assessment, data classification
ProtectImplement safeguards to limit/contain impactAccess control, encryption, security training, secure SDLC
DetectDiscover security events in a timely mannerLogging/monitoring, anomaly detection, vulnerability scanning
RespondTake action on a detected incidentIncident response plan, communications, mitigation
RecoverRestore capabilities/services impaired by an incidentBackup/restore, disaster recovery, post-incident review

The CSF is not a checklist to “pass” — organizations use Tiers (Partial → Risk Informed → Repeatable → Adaptive) to describe program maturity and Profiles (Current vs. Target) to plan improvement, making it a natural fit for iterative, DevSecOps-style improvement rather than a one-time audit.

NIST SP 800-53 at a glance

SP 800-53 is a detailed catalog of security and privacy controls, organized into control families, used heavily by US federal agencies (via FedRAMP/FISMA) and widely adopted as a control baseline elsewhere.

Control family (examples)Focus
AC — Access ControlLeast privilege, account management, session control
AU — Audit and AccountabilityLogging, log review, audit record retention
CM — Configuration ManagementBaseline configs, change control, IaC drift
IA — Identification and AuthenticationMFA, identity proofing
IR — Incident ResponseIR planning, handling, reporting
RA — Risk AssessmentVulnerability scanning, risk assessment cadence
SA — System and Services AcquisitionSecure SDLC, supply chain, third-party risk
SC — System and Communications ProtectionEncryption in transit/at rest, network segmentation
SI — System and Information IntegrityPatch management, malware protection, SBOM/integrity checks

Controls are tailored into baselines (Low/Moderate/High impact) based on the potential impact of a breach (per FIPS 199), so a public marketing site and a system holding regulated health data will draw from very different control sets even under the same catalog.

ISO/IEC 27001 and the ISMS

ISO/IEC 27001 certifies not a piece of software but an Information Security Management System (ISMS): the ongoing, documented management process an organization runs to identify information security risks and treat them.

PDCA cycle (the classic continual-improvement engine underlying the ISMS, still the practical mental model even though the 2022 revision maps it onto ISO’s harmonized “high-level structure” clauses):

PhaseActivities
PlanDefine ISMS scope, risk assessment methodology, risk treatment plan, Statement of Applicability (SoA)
DoImplement controls, run training/awareness, operate the ISMS day to day
CheckInternal audits, management review, monitoring/measurement of control effectiveness
ActCorrective actions, continual improvement, update risk treatment based on findings

Annex A controls: ISO/IEC 27001:2022’s Annex A restructured the previous 14 domains into 4 themes and 93 controls:

ThemeExample controls
Organizational (37 controls)Policies for information security, supplier relationships, ICT continuity, threat intelligence
People (8 controls)Screening, terms of employment, security awareness, disciplinary process
Physical (14 controls)Physical entry, equipment maintenance, secure disposal
Technological (34 controls)Access control, cryptography, secure coding, logging, DLP, backup

Certification process at a glance:

  1. Gap analysis — assess current state vs. Annex A / ISMS requirements.
  2. Scope definition — decide which business units, systems, and locations the ISMS covers.
  3. Risk assessment & treatment — identify risks, choose treatments, produce the SoA (which controls are applicable/excluded and why).
  4. Implementation — roll out policies, controls, training over a period (commonly 3–12 months).
  5. Internal audit & management review — self-check readiness before the external audit.
  6. Stage 1 audit (external) — documentation review; auditor confirms the ISMS is designed correctly.
  7. Stage 2 audit (external) — evidence-based audit that the ISMS operates effectively in practice.
  8. Certification — valid 3 years, with annual surveillance audits and a recertification audit in year 3.

SOC 2

SOC 2 (“System and Organization Controls 2”) is an attestation report defined by the AICPA, extremely common among B2B SaaS vendors selling to enterprises. Unlike ISO 27001 (a certification against a standard), SOC 2 is an independent auditor’s opinion, based on the AICPA’s Trust Services Criteria (TSC).

Trust Services Criteria:

CriterionMandatory?Focus
Security (the “Common Criteria”)Always requiredProtection against unauthorized access — baseline for all SOC 2 reports
AvailabilityOptionalSystem is available for operation/use as committed
ConfidentialityOptionalInformation designated confidential is protected
Processing IntegrityOptionalSystem processing is complete, valid, accurate, timely, authorized
PrivacyOptionalPersonal information is collected/used/retained/disclosed per commitments

Most companies pursue Security plus Availability and/or Confidentiality; Privacy is less commonly included since GDPR/CCPA compliance is usually handled separately.

Type I vs. Type II:

Type IType II
What it assessesDesign of controls at a single point in timeDesign and operating effectiveness of controls over a period
Typical periodSnapshot (as of a date)3–12 months (commonly 6 or 12)
EffortLower — “were controls designed correctly”Higher — auditor samples evidence throughout the period
Customer perceptionWeaker signal — often a stepping stoneStrong signal — what enterprise procurement usually requires
Common useFirst-time report for an early-stage companyOngoing annual report once program matures

Why SaaS companies pursue SOC 2: enterprise customers almost universally require it (or ISO 27001) during procurement/security review; it substitutes for customers running their own audits of a vendor; and, unlike ISO 27001, it maps naturally onto US-centric enterprise sales motions.

Key Concepts

Control mapping and framework overlap

Real organizations rarely comply with only one framework — a SaaS company selling into enterprise and government might simultaneously need SOC 2, ISO 27001, and NIST 800-53 (via FedRAMP), plus PCI DSS if it touches card payments. Rebuilding a separate control set and evidence process for each is wasteful and inconsistent.

Control mapping exploits the fact that most frameworks describe the same underlying security practices in different words and different levels of granularity. A single technical control can satisfy multiple framework requirements simultaneously:

Technical controlNIST 800-53ISO 27001 Annex ASOC 2 TSC
Enforce MFA for privileged accessIA-28.5 (Secure authentication)CC6.1
Centralized, tamper-evident audit loggingAU-2, AU-68.15 (Logging)CC7.2
Automated vulnerability scanningRA-58.8 (Management of technical vulnerabilities)CC7.1
Documented incident response plan + drillsIR-4, IR-85.24–5.26 (Incident management)CC7.3, CC7.4
Encrypt data at rest and in transitSC-13, SC-288.24 (Cryptography)CC6.7
Least-privilege access review (quarterly)AC-2, AC-65.15, 5.18 (Access control)CC6.2, CC6.3

Organizations formalize this with a unified control framework (UCF) or common control framework (CCF): one internal control ID per practice, cross-referenced (“mapped”) to every external framework’s clause/control number. GRC tooling (Vanta, Drata, Secureframe, OneTrust, ServiceNow GRC, or a home-grown spreadsheet/OSCAL model) maintains this mapping so a single piece of evidence — e.g., an IAM policy export showing MFA enforcement — gets reused across every audit that needs it, instead of being collected N times.

Evidence collection automation

Manual evidence collection (someone taking a screenshot of an IAM console once a quarter) is slow, error-prone, and stale the moment it’s captured. Continuous compliance automates this:

Risk management program

Risk management is the analytical backbone that decides which controls matter and how much effort to invest in them; see also ./06-threat-modeling-and-risk-assessment.md for the technical, system-level side of this same discipline.

Core building blocks:

Risk treatment options (“the four T’s”):

TreatmentDescriptionExample
AcceptAcknowledge the risk and take no further action (documented, with sign-off) because cost of treatment exceeds benefit or impact is minorAccepting a low-severity finding on an internal, non-sensitive tool
Mitigate (reduce)Implement controls to lower likelihood and/or impactAdding WAF rules and rate limiting to reduce DoS risk
Transfer (share)Shift some financial/operational impact to a third partyCyber insurance, outsourcing to a vendor with contractual liability
AvoidEliminate the risk by not performing the risky activityDeclining to store card data at all, using a tokenized payment processor instead

Risk assessments are periodic (e.g., annual enterprise risk assessment, per-project threat modeling) and continuous in DevSecOps: every new service, dependency, or architecture change should trigger a lightweight risk re-evaluation, feeding back into the risk register rather than waiting for the next annual cycle.

Governance structures

LevelMandatory?OwnerChange frequency
PolicyYesExecutive leadership / CISORare (annual review)
StandardYesSecurity/architecture teamsOccasional (as tech changes)
GuidelineNo (recommended)Security/engineering teamsFrequent
Procedure/runbookYes (for the task it covers)Operational teamsFrequent

Security steering committee: a recurring, cross-functional body (typically including the CISO/security lead, engineering leadership, legal/privacy, and business stakeholders) that reviews the risk register, approves policy changes, prioritizes security investment, and approves risk acceptances above a delegated authority threshold. It is the forum where governance decisions actually get made and recorded.

Roles and responsibilities (RACI) clarify who is Responsible, Accountable, Consulted, and Informed for each control/activity — essential once “everyone owns security” collides with the reality that unclear ownership means nothing gets done.

ActivityEngineeringSecurity/DevSecOpsGRC/ComplianceExecutive/CISO
Implement technical control (e.g., MFA)RAII
Define control requirement/standardCR/ACI
Collect & validate audit evidenceCRAI
Risk acceptance (above threshold)ICCA/R
External audit liaisonICR/AI
Policy approvalICCA/R
Incident response executionRAII

(R = Responsible, A = Accountable, C = Consulted, I = Informed)

Best Practices

Building a compliance-as-code pipeline

  1. Start from a control mapping, not a framework list. Build one internal control catalog and map every applicable framework’s clauses onto it, so new frameworks are additive, not a rebuild.
  2. Encode controls as policy-as-code where possible. Use OPA/Rego, Sentinel, or native cloud policy engines to make control checks automated, versioned, and testable like any other code.
  3. Wire evidence collection into existing pipelines. Reuse SBOM, SAST/DAST/SCA, and deployment-approval data that CI/CD already produces (see ./12-cicd-and-supply-chain-security.md) rather than inventing a parallel evidence process.
  4. Fail fast on drift. Treat a compliance control violation (e.g., an S3 bucket losing encryption) the same way as a failed test: alert immediately, do not wait for the next audit cycle to discover it.
  5. Keep an audit-ready evidence repository year-round. Give auditors scoped, read-only, time-boxed access to dashboards/evidence stores instead of a manual evidence-gathering sprint before each audit.
  6. Version and diff policies like code. Store policy-as-code and control definitions in git, require review for changes, and keep a changelog — this itself becomes evidence of change management.
  7. Tie risk register items to backlog work. Every accepted/mitigated risk should have a corresponding ticket, owner, and due date tracked in the same system engineers already use, not a separate spreadsheet nobody opens.
  8. Automate recurring reviews. Quarterly access reviews, vendor risk reassessments, and policy review cycles should be scheduled and tracked with reminders/automation, not left to memory.
  9. Right-size the framework set. Don’t pursue every certification available — choose frameworks driven by actual customer/regulatory/legal requirements, and sequence them (e.g., SOC 2 Type I → Type II → ISO 27001) rather than attempting everything simultaneously.
  10. Make governance decisions visible and traceable. Record steering committee decisions, risk acceptances, and policy exceptions with owner, rationale, and expiry date — undocumented exceptions are one of the most common audit findings.
  11. Treat compliance for scale deliberately. As the organization and its cloud footprint grow, compliance tooling and governance processes must scale too — see ./17-enterprise-security-at-scale.md for how GRC evolves across many teams, business units, and cloud accounts.
  12. Don’t confuse compliant with secure. Passing an audit demonstrates conformance to a chosen baseline, not the absence of risk — feed real threat intelligence and incident learnings back into both the risk register and the control set.

NIST CSF vs. ISO/IEC 27001 vs. SOC 2 — comparison

AspectNIST CSFISO/IEC 27001SOC 2
TypeVoluntary framework/guidanceCertifiable management-system standardIndependent auditor attestation report
Issuing bodyNIST (US government)ISO/IEC (international)AICPA (US)
Certifiable?No — self-assessed maturity (Tiers)Yes — accredited certification body issues certificateNo certificate — issues an audit report (opinion)
ScopeOrganization-wide cybersecurity risk managementISMS scope defined by the organization (can be a subset)Specific system/service in scope, per selected Trust Services Criteria
Core structure6 Functions (Govern, Identify, Protect, Detect, Respond, Recover)PDCA cycle + Annex A (93 controls, 4 themes)Trust Services Criteria (Security mandatory + optional categories)
ValidityN/A (continuous self-improvement model)3 years, with annual surveillance auditsReport covers a period (Type II) or a date (Type I); reissued annually
Typical audienceUS federal agencies, critical infrastructure, any org wanting a risk-management baselineGlobal enterprises, especially those needing international recognitionUS-centric B2B SaaS selling to enterprise customers
Primary use caseStructuring and communicating a cybersecurity risk programFormal certification proving an operating ISMSProving to customers that specific controls operate effectively
Relative cost/effortLow-to-moderate (self-driven)High (audit + ongoing ISMS operation)Moderate-to-high (Type II requires sustained evidence)

References