How do you ensure your IaC scripts are secure before deploying to production?
Implement scan_iac(resources) to perform a deterministic security scan on IaC resource objects. Return violation strings in input order, with each resource's violations reported in this order: PUBLIC_NETWORK, PLAINTEXT_SECRET, UNENCRYPTED_STORAGE, PRIVILEGED_CONTAINER.
Each resource has an id, type, and optional security fields. Use the exact output format "<id>:<violation>".
def scan_iac(resources):