GoogleCloudPlatform / policy-library

A library of constraint templates and sample constraints for Constraint Framework tools
Apache License 2.0
224 stars 127 forks source link

Added support for exemptions for firewall (including exemptions mode). #340

Closed rosmo closed 4 years ago

rosmo commented 4 years ago

Added support for exemptions in the GCPRestrictedFirewallRulesConstraintV1 constraint. Also added support for exemptions_mode which allows you to match resource names exactly or by regex.

morgante commented 4 years ago

@rosmo Please make sure tests pass.

rosmo commented 4 years ago

Hey @morgante, at least the tests are passing for me locally:

data.templates.gcp.GCPRestrictedFirewallRulesConstraintV1.test_exemptions_unset: PASS (19.989345ms)
data.templates.gcp.GCPRestrictedFirewallRulesConstraintV1.test_exemptions_exact: PASS (19.147724ms)
data.templates.gcp.GCPRestrictedFirewallRulesConstraintV1.test_exemptions_regex: PASS (19.181674ms)
PASS: 399/399