mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 06:45:08 +00:00
feat(gcp): add --project-ids flag and scan all projects by default (#2393)
Co-authored-by: Pepe Fagoaga <pepe@verica.io>
This commit is contained in:
@@ -980,3 +980,14 @@ class Test_Parser:
|
||||
parsed = self.parser.parse(command)
|
||||
assert parsed.provider == "gcp"
|
||||
assert parsed.credentials_file == file
|
||||
|
||||
def test_parser_gcp_project_ids(self):
|
||||
argument = "--project-ids"
|
||||
project_1 = "test_project_1"
|
||||
project_2 = "test_project_2"
|
||||
command = [prowler_command, "gcp", argument, project_1, project_2]
|
||||
parsed = self.parser.parse(command)
|
||||
assert parsed.provider == "gcp"
|
||||
assert len(parsed.project_ids) == 2
|
||||
assert parsed.project_ids[0] == project_1
|
||||
assert parsed.project_ids[1] == project_2
|
||||
|
||||
@@ -45,7 +45,8 @@ class Test_Slack_Integration:
|
||||
)
|
||||
gcp_audit_info = GCP_Audit_Info(
|
||||
credentials=None,
|
||||
project_id="test-project",
|
||||
default_project_id="test-project1",
|
||||
project_ids=["test-project1", "test-project2"],
|
||||
audit_resources=None,
|
||||
audit_metadata=None,
|
||||
)
|
||||
@@ -69,7 +70,7 @@ class Test_Slack_Integration:
|
||||
aws_logo,
|
||||
)
|
||||
assert create_message_identity("gcp", gcp_audit_info) == (
|
||||
f"GCP Project *{gcp_audit_info.project_id}*",
|
||||
f"GCP Projects *{', '.join(gcp_audit_info.project_ids)}*",
|
||||
gcp_logo,
|
||||
)
|
||||
assert create_message_identity("azure", azure_audit_info) == (
|
||||
|
||||
Reference in New Issue
Block a user