Skip to content

Instantly share code, notes, and snippets.

@anderseknert
Last active May 27, 2024 07:47
Show Gist options
  • Save anderseknert/ee08972646010710ef6caf51a972e2c6 to your computer and use it in GitHub Desktop.
Save anderseknert/ee08972646010710ef6caf51a972e2c6 to your computer and use it in GitHub Desktop.
google_sql_database_instance policy
package google_sql_database_instance
import rego.v1
violations contains db_instance.id if {
some db_instance in input.google_sql_database_instance
not valid_db_instance(db_instance)
}
valid_db_instance(db_instance) if every setting in db_instance.config.settings {
every ip_configuration in setting.ip_configuration {
ip_configuration.require_ssl == true
not "0.0.0.0" in {authorized_network.value | some authorized_network in ip_configuration.authorized_networks}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment