r/learnprogramming • u/GojosBizarreVenture • 22d ago
DevSecOps - Policy as code?
What is Policy as code?
For stuff like Wiz platforms etc, is it IaC or something else?
Does it transfer to software dev?
I'm new to tech jobs
2
Upvotes
1
u/Dapper-Situation-864 22d ago
Policy as code means writing your security and compliance rules as machine-readable code instead of a checklist in a document, so a tool can enforce them automatically. For example, a rule like "no storage bucket may be publicly readable" or "every container must run as non-root" is written in a policy language (Open Policy Agent's Rego is a common one) and checked against your Terraform plans, Kubernetes manifests or cloud config in the CI pipeline. If a change violates the rule, the build fails before it reaches production. It is related to IaC but not the same thing: IaC describes the infrastructure you want, policy as code checks whether that infrastructure is allowed. Platforms like Wiz mostly ship built-in policies and let you add custom ones. It does carry over to software dev, e.g. blocking dependencies with known vulnerabilities or requiring reviews before deploy.