Created
April 4, 2021 22:51
-
-
Save kapilt/2bffea9441a9155875a020e438316309 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
diff --git a/tools/c7n_gcp/c7n_gcp/mu.py b/tools/c7n_gcp/c7n_gcp/mu.py | |
index 8006a6b2a..dcef9fe80 100644 | |
--- a/tools/c7n_gcp/c7n_gcp/mu.py | |
+++ b/tools/c7n_gcp/c7n_gcp/mu.py | |
@@ -481,7 +481,7 @@ class PubSubSource(EventSource): | |
client.execute_command('delete', {'topic': self.get_topic_param()}) | |
-class SCCSubscriber(EventSource): | |
+class SecurityCenterSubscriber(EventSource): | |
def __init__(self, session, data, resource): | |
self.session = session | |
diff --git a/tools/c7n_gcp/c7n_gcp/policy.py b/tools/c7n_gcp/c7n_gcp/policy.py | |
index c906f9e93..547898716 100644 | |
--- a/tools/c7n_gcp/c7n_gcp/policy.py | |
+++ b/tools/c7n_gcp/c7n_gcp/policy.py | |
@@ -173,12 +173,12 @@ class ApiAuditMode(FunctionMode): | |
@execution.register('gcp-scc') | |
-class SCCMode(FunctionMode): | |
- """Custodian policy execution on gcp scc findings. | |
+class SecurityCenterMode(FunctionMode): | |
+ """Custodian policy execution on GCP Security Command Center (SCC) findings. | |
- Deploys as a Cloud Function triggered by scc findings. This allows | |
+ Deploys as a Cloud Function triggered by SCC findings. This allows | |
you to apply your policies as soon as a scc finding occurs. | |
- See `SCC findings | |
+ See `Security Command Center findings | |
<https://cloud.google.com/security-command-center/docs/concepts-security-command-center-overview#google-cloud-security-findings>`_ | |
for more details. | |
@@ -219,7 +219,7 @@ class SCCMode(FunctionMode): | |
events = [ | |
mu.PubSubSource(local_session(self.policy.session_factory), | |
{"topic": self._resource_topic()}), | |
- mu.SCCSubscriber(local_session(self.policy.session_factory), | |
+ mu.SecurityCenterSubscriber(local_session(self.policy.session_factory), | |
{"topic": self._resource_topic(), | |
"org": self.policy.data["mode"]["org"]}, self.policy.resource_manager)] | |
return mu.PolicyFunction(self.policy, events=events) | |
diff --git a/tools/c7n_gcp/tests/test_mu_gcp.py b/tools/c7n_gcp/tests/test_mu_gcp.py | |
index 8edf863b2..a0335533e 100644 | |
--- a/tools/c7n_gcp/tests/test_mu_gcp.py | |
+++ b/tools/c7n_gcp/tests/test_mu_gcp.py | |
@@ -334,7 +334,7 @@ class FunctionTest(BaseTest): | |
'org': 111111111111}}, | |
session_factory=factory) | |
exec_mode = p.get_execution_mode() | |
- self.assertTrue(isinstance(exec_mode, policy.SCCMode)) | |
+ self.assertTrue(isinstance(exec_mode, policy.SecurityCenterMode)) | |
event = event_data('network-finding.json') | |
resources = exec_mode.run(event, None) | |
self.assertEqual(len(resources), 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment