Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
feat: add cloud_dlp_inspection and cloud_dlp_data_profile fields to f…
Browse files Browse the repository at this point in the history
…inding's list of attributes (#449)

* feat: add cloud_dlp_inspection and cloud_dlp_data_profile fields to finding's list of attributes
docs: miscellaneous style improvements

PiperOrigin-RevId: 525798516

Source-Link: googleapis/googleapis@36a885f

Source-Link: googleapis/googleapis-gen@c47a1b7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzQ3YTFiNzk5MjZlYjRiOWZjNDdmNDQ1YTNhODk3MTMxNDA3NWRlNyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Apr 21, 2023
1 parent b50eb1b commit f167dad
Show file tree
Hide file tree
Showing 17 changed files with 469 additions and 193 deletions.
6 changes: 6 additions & 0 deletions google/cloud/securitycenter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
)
from google.cloud.securitycenter_v1.types.asset import Asset
from google.cloud.securitycenter_v1.types.bigquery_export import BigQueryExport
from google.cloud.securitycenter_v1.types.cloud_dlp_data_profile import (
CloudDlpDataProfile,
)
from google.cloud.securitycenter_v1.types.cloud_dlp_inspection import CloudDlpInspection
from google.cloud.securitycenter_v1.types.compliance import Compliance
from google.cloud.securitycenter_v1.types.connection import Connection
from google.cloud.securitycenter_v1.types.contact_details import Contact, ContactDetails
Expand Down Expand Up @@ -145,6 +149,8 @@
"ServiceAccountDelegationInfo",
"Asset",
"BigQueryExport",
"CloudDlpDataProfile",
"CloudDlpInspection",
"Compliance",
"Connection",
"Contact",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/securitycenter_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from .types.access import Access, Geolocation, ServiceAccountDelegationInfo
from .types.asset import Asset
from .types.bigquery_export import BigQueryExport
from .types.cloud_dlp_data_profile import CloudDlpDataProfile
from .types.cloud_dlp_inspection import CloudDlpInspection
from .types.compliance import Compliance
from .types.connection import Connection
from .types.contact_details import Contact, ContactDetails
Expand Down Expand Up @@ -119,6 +121,8 @@
"BigQueryExport",
"BulkMuteFindingsRequest",
"BulkMuteFindingsResponse",
"CloudDlpDataProfile",
"CloudDlpInspection",
"Compliance",
"Connection",
"Contact",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
from google.cloud.securitycenter_v1.types import (
access,
bigquery_export,
cloud_dlp_data_profile,
cloud_dlp_inspection,
compliance,
connection,
container,
Expand Down Expand Up @@ -118,6 +120,8 @@ class SecurityCenterAsyncClient:
parse_big_query_export_path = staticmethod(
SecurityCenterClient.parse_big_query_export_path
)
dlp_job_path = staticmethod(SecurityCenterClient.dlp_job_path)
parse_dlp_job_path = staticmethod(SecurityCenterClient.parse_dlp_job_path)
effective_security_health_analytics_custom_module_path = staticmethod(
SecurityCenterClient.effective_security_health_analytics_custom_module_path
)
Expand Down Expand Up @@ -156,6 +160,10 @@ class SecurityCenterAsyncClient:
)
source_path = staticmethod(SecurityCenterClient.source_path)
parse_source_path = staticmethod(SecurityCenterClient.parse_source_path)
table_data_profile_path = staticmethod(SecurityCenterClient.table_data_profile_path)
parse_table_data_profile_path = staticmethod(
SecurityCenterClient.parse_table_data_profile_path
)
topic_path = staticmethod(SecurityCenterClient.topic_path)
parse_topic_path = staticmethod(SecurityCenterClient.parse_topic_path)
common_billing_account_path = staticmethod(
Expand Down Expand Up @@ -495,8 +503,8 @@ async def sample_create_security_health_analytics_custom_module():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.CreateSecurityHealthAnalyticsCustomModuleRequest, dict]]):
The request object. Request message for creating security
health analytics custom modules.
The request object. Request message for creating Security
Health Analytics custom modules.
parent (:class:`str`):
Required. Resource name of the new
custom module's parent. Its format is
Expand Down Expand Up @@ -1352,8 +1360,8 @@ async def sample_delete_security_health_analytics_custom_module():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.DeleteSecurityHealthAnalyticsCustomModuleRequest, dict]]):
The request object. Request message for deleting security
health analytics custom modules.
The request object. Request message for deleting Security
Health Analytics custom modules.
name (:class:`str`):
Required. Name of the custom module
to delete. Its format is
Expand Down Expand Up @@ -2089,7 +2097,7 @@ async def sample_get_effective_security_health_analytics_custom_module():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, dict]]):
The request object. Request message for getting effective
security health analytics custom
Security Health Analytics custom
modules.
name (:class:`str`):
Required. Name of the effective
Expand Down Expand Up @@ -2224,8 +2232,8 @@ async def sample_get_security_health_analytics_custom_module():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.GetSecurityHealthAnalyticsCustomModuleRequest, dict]]):
The request object. Request message for getting security
health analytics custom modules.
The request object. Request message for getting Security
Health Analytics custom modules.
name (:class:`str`):
Required. Name of the custom module
to get. Its format is
Expand Down Expand Up @@ -2848,7 +2856,7 @@ async def sample_list_descendant_security_health_analytics_custom_modules():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, dict]]):
The request object. Request message for listing
descendant security health analytics
descendant Security Health Analytics
custom modules.
parent (:class:`str`):
Required. Name of parent to list
Expand All @@ -2870,7 +2878,7 @@ async def sample_list_descendant_security_health_analytics_custom_modules():
Returns:
google.cloud.securitycenter_v1.services.security_center.pagers.ListDescendantSecurityHealthAnalyticsCustomModulesAsyncPager:
Response message for listing
descendant security health analytics
descendant Security Health Analytics
custom modules.
Iterating over this object will yield
results and resolve additional pages
Expand Down Expand Up @@ -3346,7 +3354,7 @@ async def sample_list_effective_security_health_analytics_custom_modules():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, dict]]):
The request object. Request message for listing effective
security health analytics custom
Security Health Analytics custom
modules.
parent (:class:`str`):
Required. Name of parent to list
Expand All @@ -3368,7 +3376,7 @@ async def sample_list_effective_security_health_analytics_custom_modules():
Returns:
google.cloud.securitycenter_v1.services.security_center.pagers.ListEffectiveSecurityHealthAnalyticsCustomModulesAsyncPager:
Response message for listing
effective security health analytics
effective Security Health Analytics
custom modules.
Iterating over this object will yield
results and resolve additional pages
Expand Down Expand Up @@ -3487,8 +3495,8 @@ async def sample_list_security_health_analytics_custom_modules():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.ListSecurityHealthAnalyticsCustomModulesRequest, dict]]):
The request object. Request message for listing security
health analytics custom modules.
The request object. Request message for listing Security
Health Analytics custom modules.
parent (:class:`str`):
Required. Name of parent to list
custom modules. Its format is
Expand All @@ -3508,8 +3516,8 @@ async def sample_list_security_health_analytics_custom_modules():
Returns:
google.cloud.securitycenter_v1.services.security_center.pagers.ListSecurityHealthAnalyticsCustomModulesAsyncPager:
Response message for listing security
health analytics custom modules.
Response message for listing Security
Health Analytics custom modules.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -4994,7 +5002,7 @@ async def update_security_health_analytics_custom_module(
the given name based on the given update mask. Updating
the enablement state is supported on both resident and
inherited modules (though resident modules cannot have
an enablement state of inherited). Updating the
an enablement state of "inherited"). Updating the
display name and custom config of a module is supported
on resident modules only.
Expand Down Expand Up @@ -5025,8 +5033,8 @@ async def sample_update_security_health_analytics_custom_module():
Args:
request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateSecurityHealthAnalyticsCustomModuleRequest, dict]]):
The request object. Request message for updating security
health analytics custom modules.
The request object. Request message for updating Security
Health Analytics custom modules.
security_health_analytics_custom_module (:class:`google.cloud.securitycenter_v1.types.SecurityHealthAnalyticsCustomModule`):
Required. The SecurityHealthAnalytics
custom module to update.
Expand Down
74 changes: 56 additions & 18 deletions google/cloud/securitycenter_v1/services/security_center/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
from google.cloud.securitycenter_v1.types import (
access,
bigquery_export,
cloud_dlp_data_profile,
cloud_dlp_inspection,
compliance,
connection,
container,
Expand Down Expand Up @@ -270,6 +272,23 @@ def parse_big_query_export_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def dlp_job_path(
project: str,
dlp_job: str,
) -> str:
"""Returns a fully-qualified dlp_job string."""
return "projects/{project}/dlpJobs/{dlp_job}".format(
project=project,
dlp_job=dlp_job,
)

@staticmethod
def parse_dlp_job_path(path: str) -> Dict[str, str]:
"""Parses a dlp_job path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/dlpJobs/(?P<dlp_job>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def effective_security_health_analytics_custom_module_path(
organization: str,
Expand Down Expand Up @@ -456,6 +475,25 @@ def parse_source_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def table_data_profile_path(
project: str,
table_profile: str,
) -> str:
"""Returns a fully-qualified table_data_profile string."""
return "projects/{project}/tableProfiles/{table_profile}".format(
project=project,
table_profile=table_profile,
)

@staticmethod
def parse_table_data_profile_path(path: str) -> Dict[str, str]:
"""Parses a table_data_profile path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/tableProfiles/(?P<table_profile>.+?)$", path
)
return m.groupdict() if m else {}

@staticmethod
def topic_path(
project: str,
Expand Down Expand Up @@ -900,8 +938,8 @@ def sample_create_security_health_analytics_custom_module():
Args:
request (Union[google.cloud.securitycenter_v1.types.CreateSecurityHealthAnalyticsCustomModuleRequest, dict]):
The request object. Request message for creating security
health analytics custom modules.
The request object. Request message for creating Security
Health Analytics custom modules.
parent (str):
Required. Resource name of the new
custom module's parent. Its format is
Expand Down Expand Up @@ -1770,8 +1808,8 @@ def sample_delete_security_health_analytics_custom_module():
Args:
request (Union[google.cloud.securitycenter_v1.types.DeleteSecurityHealthAnalyticsCustomModuleRequest, dict]):
The request object. Request message for deleting security
health analytics custom modules.
The request object. Request message for deleting Security
Health Analytics custom modules.
name (str):
Required. Name of the custom module
to delete. Its format is
Expand Down Expand Up @@ -2483,7 +2521,7 @@ def sample_get_effective_security_health_analytics_custom_module():
Args:
request (Union[google.cloud.securitycenter_v1.types.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, dict]):
The request object. Request message for getting effective
security health analytics custom
Security Health Analytics custom
modules.
name (str):
Required. Name of the effective
Expand Down Expand Up @@ -2613,8 +2651,8 @@ def sample_get_security_health_analytics_custom_module():
Args:
request (Union[google.cloud.securitycenter_v1.types.GetSecurityHealthAnalyticsCustomModuleRequest, dict]):
The request object. Request message for getting security
health analytics custom modules.
The request object. Request message for getting Security
Health Analytics custom modules.
name (str):
Required. Name of the custom module
to get. Its format is
Expand Down Expand Up @@ -3196,7 +3234,7 @@ def sample_list_descendant_security_health_analytics_custom_modules():
Args:
request (Union[google.cloud.securitycenter_v1.types.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, dict]):
The request object. Request message for listing
descendant security health analytics
descendant Security Health Analytics
custom modules.
parent (str):
Required. Name of parent to list
Expand All @@ -3218,7 +3256,7 @@ def sample_list_descendant_security_health_analytics_custom_modules():
Returns:
google.cloud.securitycenter_v1.services.security_center.pagers.ListDescendantSecurityHealthAnalyticsCustomModulesPager:
Response message for listing
descendant security health analytics
descendant Security Health Analytics
custom modules.
Iterating over this object will yield
results and resolve additional pages
Expand Down Expand Up @@ -3674,7 +3712,7 @@ def sample_list_effective_security_health_analytics_custom_modules():
Args:
request (Union[google.cloud.securitycenter_v1.types.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, dict]):
The request object. Request message for listing effective
security health analytics custom
Security Health Analytics custom
modules.
parent (str):
Required. Name of parent to list
Expand All @@ -3696,7 +3734,7 @@ def sample_list_effective_security_health_analytics_custom_modules():
Returns:
google.cloud.securitycenter_v1.services.security_center.pagers.ListEffectiveSecurityHealthAnalyticsCustomModulesPager:
Response message for listing
effective security health analytics
effective Security Health Analytics
custom modules.
Iterating over this object will yield
results and resolve additional pages
Expand Down Expand Up @@ -3810,8 +3848,8 @@ def sample_list_security_health_analytics_custom_modules():
Args:
request (Union[google.cloud.securitycenter_v1.types.ListSecurityHealthAnalyticsCustomModulesRequest, dict]):
The request object. Request message for listing security
health analytics custom modules.
The request object. Request message for listing Security
Health Analytics custom modules.
parent (str):
Required. Name of parent to list
custom modules. Its format is
Expand All @@ -3831,8 +3869,8 @@ def sample_list_security_health_analytics_custom_modules():
Returns:
google.cloud.securitycenter_v1.services.security_center.pagers.ListSecurityHealthAnalyticsCustomModulesPager:
Response message for listing security
health analytics custom modules.
Response message for listing Security
Health Analytics custom modules.
Iterating over this object will yield
results and resolve additional pages
automatically.
Expand Down Expand Up @@ -5295,7 +5333,7 @@ def update_security_health_analytics_custom_module(
the given name based on the given update mask. Updating
the enablement state is supported on both resident and
inherited modules (though resident modules cannot have
an enablement state of inherited). Updating the
an enablement state of "inherited"). Updating the
display name and custom config of a module is supported
on resident modules only.
Expand Down Expand Up @@ -5326,8 +5364,8 @@ def sample_update_security_health_analytics_custom_module():
Args:
request (Union[google.cloud.securitycenter_v1.types.UpdateSecurityHealthAnalyticsCustomModuleRequest, dict]):
The request object. Request message for updating security
health analytics custom modules.
The request object. Request message for updating Security
Health Analytics custom modules.
security_health_analytics_custom_module (google.cloud.securitycenter_v1.types.SecurityHealthAnalyticsCustomModule):
Required. The SecurityHealthAnalytics
custom module to update.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ def update_security_health_analytics_custom_module(
the given name based on the given update mask. Updating
the enablement state is supported on both resident and
inherited modules (though resident modules cannot have
an enablement state of inherited). Updating the
an enablement state of "inherited"). Updating the
display name and custom config of a module is supported
on resident modules only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ def update_security_health_analytics_custom_module(
the given name based on the given update mask. Updating
the enablement state is supported on both resident and
inherited modules (though resident modules cannot have
an enablement state of inherited). Updating the
an enablement state of "inherited"). Updating the
display name and custom config of a module is supported
on resident modules only.
Expand Down
Loading

0 comments on commit f167dad

Please sign in to comment.