-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bridgecrewio:main' into fix/ckv_azure_5-default-value
- Loading branch information
Showing
21 changed files
with
1,969 additions
and
1,623 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
...kov/terraform/checks/graph_checks/gcp/GCPPostgreSQLDatabaseFlaglog_durationIsSetToON.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
metadata: | ||
name: "Ensure PostgreSQL database flag 'log_duration' is set to 'on'" | ||
id: "CKV2_GCP_13" | ||
category: "LOGGING" | ||
definition: | ||
or: | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "database_version" | ||
operator: "not_contains" | ||
value: "POSTGRES" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[?(@.name == log_duration & @.value == on)]" | ||
operator: "jsonpath_exists" |
22 changes: 22 additions & 0 deletions
22
...raform/checks/graph_checks/gcp/GCPPostgreSQLDatabaseFlaglog_executor_statsIsSetToOFF.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
metadata: | ||
name: "Ensure PostgreSQL database flag 'log_executor_stats' is set to 'off'" | ||
id: "CKV2_GCP_14" | ||
category: "LOGGING" | ||
definition: | ||
or: | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "database_version" | ||
operator: "not_contains" | ||
value: "POSTGRES" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[*]" | ||
operator: "jsonpath_not_exists" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[?(@.name == log_executor_stats & @.value == on)]" | ||
operator: "jsonpath_not_exists" |
22 changes: 22 additions & 0 deletions
22
...erraform/checks/graph_checks/gcp/GCPPostgreSQLDatabaseFlaglog_parser_statsIsSetToOFF.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
metadata: | ||
name: "Ensure PostgreSQL database flag 'log_parser_stats' is set to 'off'" | ||
id: "CKV2_GCP_15" | ||
category: "LOGGING" | ||
definition: | ||
or: | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "database_version" | ||
operator: "not_contains" | ||
value: "POSTGRES" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[*]" | ||
operator: "jsonpath_not_exists" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[?(@.name == log_parser_stats & @.value == on)]" | ||
operator: "jsonpath_not_exists" |
22 changes: 22 additions & 0 deletions
22
...rraform/checks/graph_checks/gcp/GCPPostgreSQLDatabaseFlaglog_planner_statsIsSetToOFF.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
metadata: | ||
name: "Ensure PostgreSQL database flag 'log_planner_stats' is set to 'off'" | ||
id: "CKV2_GCP_16" | ||
category: "LOGGING" | ||
definition: | ||
or: | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "database_version" | ||
operator: "not_contains" | ||
value: "POSTGRES" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[*]" | ||
operator: "jsonpath_not_exists" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[?(@.name == log_planner_stats & @.value == on)]" | ||
operator: "jsonpath_not_exists" |
22 changes: 22 additions & 0 deletions
22
...aform/checks/graph_checks/gcp/GCPPostgreSQLDatabaseFlaglog_statement_statsIsSetToOFF.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
metadata: | ||
name: "Ensure PostgreSQL database flag 'log_statement_stats' is set to 'off'" | ||
id: "CKV2_GCP_17" | ||
category: "LOGGING" | ||
definition: | ||
or: | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "database_version" | ||
operator: "not_contains" | ||
value: "POSTGRES" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[*]" | ||
operator: "jsonpath_not_exists" | ||
- cond_type: "attribute" | ||
resource_types: | ||
- "google_sql_database_instance" | ||
attribute: "settings.database_flags[?(@.name == log_statement_stats & @.value == on)]" | ||
operator: "jsonpath_not_exists" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = '2.2.257' | ||
version = '2.2.258' |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
checkov==2.2.257 | ||
checkov==2.2.258 |
5 changes: 5 additions & 0 deletions
5
...aform/graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_durationIsSetToON/expected.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pass: | ||
- "google_sql_database_instance.postgresql-instance-ok-1" | ||
fail: | ||
- "google_sql_database_instance.postgresql-instance-not-ok-1" | ||
- "google_sql_database_instance.postgresql-instance-not-ok-2" |
37 changes: 37 additions & 0 deletions
37
...s/terraform/graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_durationIsSetToON/main.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#case1 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-1" { | ||
name = "postgresql-instance-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_duration" | ||
value = "on" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case2 - FAIL | ||
resource "google_sql_database_instance" "postgresql-instance-not-ok-1" { | ||
name = "postgresql-instance-not-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_duration" | ||
value = "off" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case3 - FAIL | ||
resource "google_sql_database_instance" "postgresql-instance-not-ok-2" { | ||
name = "postgresql-instance-not-ok-2" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} |
5 changes: 5 additions & 0 deletions
5
...raph/checks/resources/GCPPostgreSQLDatabaseFlaglog_executor_statsIsSetToOFF/expected.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pass: | ||
- "google_sql_database_instance.postgresql-instance-ok-1" | ||
- "google_sql_database_instance.postgresql-instance-ok-2" | ||
fail: | ||
- "google_sql_database_instance.postgresql-instance-not-ok-1" |
37 changes: 37 additions & 0 deletions
37
...form/graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_executor_statsIsSetToOFF/main.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#case1 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-1" { | ||
name = "postgresql-instance-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_executor_stats" | ||
value = "off" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case2 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-2" { | ||
name = "postgresql-instance-ok-2" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case3 - FAIL | ||
resource "google_sql_database_instance" "postgresql-instance-not-ok-1" { | ||
name = "postgresql-instance-not-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_executor_stats" | ||
value = "on" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} |
5 changes: 5 additions & 0 deletions
5
.../graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_parser_statsIsSetToOFF/expected.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pass: | ||
- "google_sql_database_instance.postgresql-instance-ok-1" | ||
- "google_sql_database_instance.postgresql-instance-ok-2" | ||
fail: | ||
- "google_sql_database_instance.postgresql-instance-not-ok-1" |
37 changes: 37 additions & 0 deletions
37
...raform/graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_parser_statsIsSetToOFF/main.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#case1 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-1" { | ||
name = "postgresql-instance-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_parser_stats" | ||
value = "off" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case2 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-2" { | ||
name = "postgresql-instance-ok-2" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case3 - FAIL | ||
resource "google_sql_database_instance" "postgresql-instance-not-ok-1" { | ||
name = "postgresql-instance-not-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_parser_stats" | ||
value = "on" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} |
5 changes: 5 additions & 0 deletions
5
...graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_planner_statsIsSetToOFF/expected.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pass: | ||
- "google_sql_database_instance.postgresql-instance-ok-1" | ||
- "google_sql_database_instance.postgresql-instance-ok-2" | ||
fail: | ||
- "google_sql_database_instance.postgresql-instance-not-ok-1" |
37 changes: 37 additions & 0 deletions
37
...aform/graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_planner_statsIsSetToOFF/main.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#case1 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-1" { | ||
name = "postgresql-instance-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_planner_stats" | ||
value = "off" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case2 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-2" { | ||
name = "postgresql-instance-ok-2" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case3 - FAIL | ||
resource "google_sql_database_instance" "postgresql-instance-not-ok-1" { | ||
name = "postgresql-instance-not-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_planner_stats" | ||
value = "on" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} |
5 changes: 5 additions & 0 deletions
5
...aph/checks/resources/GCPPostgreSQLDatabaseFlaglog_statement_statsIsSetToOFF/expected.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pass: | ||
- "google_sql_database_instance.postgresql-instance-ok-1" | ||
- "google_sql_database_instance.postgresql-instance-ok-2" | ||
fail: | ||
- "google_sql_database_instance.postgresql-instance-not-ok-1" |
37 changes: 37 additions & 0 deletions
37
...orm/graph/checks/resources/GCPPostgreSQLDatabaseFlaglog_statement_statsIsSetToOFF/main.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#case1 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-1" { | ||
name = "postgresql-instance-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_statement_stats" | ||
value = "off" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case2 - PASS | ||
resource "google_sql_database_instance" "postgresql-instance-ok-2" { | ||
name = "postgresql-instance-ok-2" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} | ||
|
||
#case3 - FAIL | ||
resource "google_sql_database_instance" "postgresql-instance-not-ok-1" { | ||
name = "postgresql-instance-not-ok-1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_statement_stats" | ||
value = "on" | ||
} | ||
tier = "db-f1-micro" | ||
} | ||
deletion_protection = false | ||
} |
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