turbot/terraform_gcp_compliance

GitHub
bigquery_dataset_encrypted_with_cmkbigquery_dataset_not_publicly_accessiblebigquery_table_encrypted_with_cmkcompute_disk_encrypted_with_cskcompute_instance_block_project_wide_ssh_enabledcompute_instance_confidential_computing_enabledcompute_instance_ip_forwarding_disabledcompute_instance_oslogin_enabledcompute_instance_serial_port_connection_disabledcompute_instance_shielded_vm_enabledcompute_instance_with_no_default_service_accountcompute_instance_with_no_default_service_account_with_full_accesscompute_instance_with_no_public_ip_addressescompute_network_contains_no_default_networkcompute_network_contains_no_legacy_networkcompute_subnetwork_flow_log_enabledcompute_subnetwork_private_ip_google_accessdns_managed_zone_dnssec_enableddns_managed_zone_key_signing_not_using_rsasha1dns_managed_zone_zone_signing_not_using_rsasha1iam_service_account_gcp_managed_keykms_key_rotated_within_100_daykms_key_rotated_within_90_daykubernetes_cluster_auto_repair_enabledkubernetes_cluster_auto_upgrade_enabledkubernetes_cluster_legacy_abac_enabledkubernetes_cluster_legacy_endpoints_disabledkubernetes_cluster_network_policy_installedkubernetes_cluster_node_config_image_cos_containerdkubernetes_cluster_private_cluster_config_enabledlogging_bucket_retention_policy_enabledsql_instance_automated_backups_enabledsql_instance_mysql_local_infile_database_flag_offsql_instance_mysql_skip_show_database_flag_onsql_instance_postgresql_log_checkpoints_database_flag_onsql_instance_postgresql_log_connections_database_flag_onsql_instance_postgresql_log_disconnections_database_flag_onsql_instance_postgresql_log_duration_database_flag_onsql_instance_postgresql_log_executor_stats_database_flag_offsql_instance_postgresql_log_hostname_database_flag_configuredsql_instance_postgresql_log_lock_waits_database_flag_onsql_instance_postgresql_log_min_duration_statement_database_flag_disabledsql_instance_postgresql_log_parser_stats_database_flag_offsql_instance_postgresql_log_planner_stats_database_flag_offsql_instance_postgresql_log_statement_stats_database_flag_offsql_instance_postgresql_log_temp_files_database_flag_0sql_instance_require_ssl_enabledsql_instance_sql_3625_trace_database_flag_offsql_instance_sql_contained_database_authentication_database_flag_offsql_instance_sql_cross_db_ownership_chaining_database_flag_offsql_instance_sql_external_scripts_enabled_database_flag_offsql_instance_sql_remote_access_database_flag_offsql_instance_sql_user_options_database_flag_not_configuredstorage_bucket_not_publicly_accessiblestorage_bucket_uniform_access_enabled

Query: sql_instance_postgresql_log_temp_files_database_flag_0

Usage

steampipe query terraform_gcp_compliance.query.sql_instance_postgresql_log_temp_files_database_flag_0

Plugins & Tables

SQL

select
type || ' ' || name as resource,
case
when coalesce(trim((arguments ->> 'database_version')), '') = '' then 'alarm'
when (arguments ->> 'database_version') not like 'POSTGRES%' then 'skip'
when (arguments -> 'settings' -> 'database_flags' ->> 'name') = 'log_temp_files'
and (
arguments -> 'settings' -> 'database_flags' ->> 'value'
) = '0' then 'ok'
else 'alarm'
end as status,
name || case
when coalesce(trim((arguments ->> 'database_version')), '') = '' then ' ''database_version'' is not defined'
when (arguments ->> 'database_version') not like 'POSTGRES%' then ' not a PostgreSQL database'
when (arguments -> 'settings') is null then ' ''settings'' is not defined'
when (arguments -> 'settings' -> 'database_flags') is null then ' ''settings.database_flags'' is not defined'
when coalesce(
trim(
(arguments -> 'settings' -> 'database_flags' ->> 'name')
),
''
) = '' then ' ''settings.database_flags.name'' is not defined'
when coalesce(
trim(
(
arguments -> 'settings' -> 'database_flags' ->> 'value'
)
),
''
) = '' then ' ''settings.database_flags.value'' is not defined'
when (arguments -> 'settings' -> 'database_flags' ->> 'name') <> 'log_temp_files' then ' ''log_temp_files'' database flag not set'
when (arguments -> 'settings' -> 'database_flags' ->> 'name') = 'log_temp_files'
and (
arguments -> 'settings' -> 'database_flags' ->> 'value'
) = '0' then ' ''log_temp_files'' database flag set to ''0'''
else ' ''log_temp_files'' database flag not set to ''0'''
end || '.' reason,
path || ':' || start_line
from
terraform_resource
where
type = 'google_sql_database_instance';

Controls

The query is being used by the following controls: