Last active
May 25, 2024 08:47
-
-
Save anderseknert/623ccd082f2c4ed69fa552ea23a10222 to your computer and use it in GitHub Desktop.
Terrascan DB settings policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package accurics | |
import rego.v1 | |
violations contains db_instance.id if { | |
some db_instance in input.google_sql_database_instance | |
some setting in db_instance.config.settings | |
invalid_db_instance_setting(setting) | |
} | |
invalid_db_instance_setting(setting) if not setting.ip_configuration | |
invalid_db_instance_setting(setting) if invalid_ip_configuration(setting.ip_configuration[_]) | |
invalid_ip_configuration(ip_configuration) if not ip_configuration.require_ssl | |
invalid_ip_configuration(ip_configuration) if ip_configuration.authorized_networks[_].value == "0.0.0.0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment