Skip to content

Commit

Permalink
feat: [google-cloud-securitycenter] Add security_posture, external_sy…
Browse files Browse the repository at this point in the history
…stem.case_uri, external_system.case_priority, external_system.case_sla, external_system.case_create_time, external_system.case_close_time, and external_system.ticket_info to finding's... (#12432)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: Add security_posture, external_system.case_uri,
external_system.case_priority, external_system.case_sla to finding's
list of attributes
feat: Add external_system.case_create_time,
external_system.case_close_time, and external_system.ticket_info to
finding's list of attributes
END_COMMIT_OVERRIDE


PiperOrigin-RevId: 614027711

Source-Link:
googleapis/googleapis@e0791ad

Source-Link:
googleapis/googleapis-gen@298788d
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiIyOTg3ODhkYmIxNTFkZjA0OTdiMDA3NmRlMGQ1ZDYxNzU2NTM2OGE3In0=

---------

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] authored Mar 9, 2024
1 parent f40217d commit 736a1ef
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
SecurityHealthAnalyticsCustomModule,
)
from google.cloud.securitycenter_v1.types.security_marks import SecurityMarks
from google.cloud.securitycenter_v1.types.security_posture import SecurityPosture
from google.cloud.securitycenter_v1.types.securitycenter_service import (
BulkMuteFindingsRequest,
BulkMuteFindingsResponse,
Expand Down Expand Up @@ -198,6 +199,7 @@
"CustomConfig",
"SecurityHealthAnalyticsCustomModule",
"SecurityMarks",
"SecurityPosture",
"BulkMuteFindingsRequest",
"BulkMuteFindingsResponse",
"CreateBigQueryExportRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
SecurityHealthAnalyticsCustomModule,
)
from .types.security_marks import SecurityMarks
from .types.security_posture import SecurityPosture
from .types.securitycenter_service import (
BulkMuteFindingsRequest,
BulkMuteFindingsResponse,
Expand Down Expand Up @@ -221,6 +222,7 @@
"SecurityCenterClient",
"SecurityHealthAnalyticsCustomModule",
"SecurityMarks",
"SecurityPosture",
"ServiceAccountDelegationInfo",
"SetFindingStateRequest",
"SetMuteRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
log_entry,
mitre_attack,
)
from google.cloud.securitycenter_v1.types import (
security_posture,
securitycenter_service,
)
from google.cloud.securitycenter_v1.types import external_system as gcs_external_system
from google.cloud.securitycenter_v1.types import (
notification_config as gcs_notification_config,
Expand All @@ -102,7 +106,6 @@
from google.cloud.securitycenter_v1.types import org_policy
from google.cloud.securitycenter_v1.types import organization_settings
from google.cloud.securitycenter_v1.types import security_marks
from google.cloud.securitycenter_v1.types import securitycenter_service
from google.cloud.securitycenter_v1.types import source
from google.cloud.securitycenter_v1.types import source as gcs_source
from google.cloud.securitycenter_v1.types import vulnerability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
log_entry,
mitre_attack,
)
from google.cloud.securitycenter_v1.types import (
security_posture,
securitycenter_service,
)
from google.cloud.securitycenter_v1.types import external_system as gcs_external_system
from google.cloud.securitycenter_v1.types import (
notification_config as gcs_notification_config,
Expand All @@ -106,7 +110,6 @@
from google.cloud.securitycenter_v1.types import org_policy
from google.cloud.securitycenter_v1.types import organization_settings
from google.cloud.securitycenter_v1.types import security_marks
from google.cloud.securitycenter_v1.types import securitycenter_service
from google.cloud.securitycenter_v1.types import source
from google.cloud.securitycenter_v1.types import source as gcs_source
from google.cloud.securitycenter_v1.types import vulnerability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from .security_health_analytics_custom_config import CustomConfig
from .security_health_analytics_custom_module import SecurityHealthAnalyticsCustomModule
from .security_marks import SecurityMarks
from .security_posture import SecurityPosture
from .securitycenter_service import (
BulkMuteFindingsRequest,
BulkMuteFindingsResponse,
Expand Down Expand Up @@ -164,6 +165,7 @@
"CustomConfig",
"SecurityHealthAnalyticsCustomModule",
"SecurityMarks",
"SecurityPosture",
"BulkMuteFindingsRequest",
"BulkMuteFindingsResponse",
"CreateBigQueryExportRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,88 @@ class ExternalSystem(proto.Message):
References primary/secondary etc assignees in
the external system.
external_uid (str):
Identifier that's used to track the given
finding in the external system.
The identifier that's used to track the
finding's corresponding case in the external
system.
status (str):
Most recent status of the corresponding
finding's ticket/tracker in the external system.
The most recent status of the finding's
corresponding case, as reported by the external
system.
external_system_update_time (google.protobuf.timestamp_pb2.Timestamp):
The most recent time when the corresponding
finding's ticket/tracker was updated in the
external system.
The time when the case was last updated, as
reported by the external system.
case_uri (str):
The link to the finding's corresponding case
in the external system.
case_priority (str):
The priority of the finding's corresponding
case in the external system.
case_sla (google.protobuf.timestamp_pb2.Timestamp):
The SLA of the finding's corresponding case
in the external system.
case_create_time (google.protobuf.timestamp_pb2.Timestamp):
The time when the case was created, as
reported by the external system.
case_close_time (google.protobuf.timestamp_pb2.Timestamp):
The time when the case was closed, as
reported by the external system.
ticket_info (google.cloud.securitycenter_v1.types.ExternalSystem.TicketInfo):
Information about the ticket, if any, that is
being used to track the resolution of the issue
that is identified by this finding.
"""

class TicketInfo(proto.Message):
r"""Information about the ticket, if any, that is being used to
track the resolution of the issue that is identified by this
finding.
Attributes:
id (str):
The identifier of the ticket in the ticket
system.
assignee (str):
The assignee of the ticket in the ticket
system.
description (str):
The description of the ticket in the ticket
system.
uri (str):
The link to the ticket in the ticket system.
status (str):
The latest status of the ticket, as reported
by the ticket system.
update_time (google.protobuf.timestamp_pb2.Timestamp):
The time when the ticket was last updated, as
reported by the ticket system.
"""

id: str = proto.Field(
proto.STRING,
number=1,
)
assignee: str = proto.Field(
proto.STRING,
number=2,
)
description: str = proto.Field(
proto.STRING,
number=3,
)
uri: str = proto.Field(
proto.STRING,
number=4,
)
status: str = proto.Field(
proto.STRING,
number=5,
)
update_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=6,
message=timestamp_pb2.Timestamp,
)

name: str = proto.Field(
proto.STRING,
number=1,
Expand All @@ -74,6 +145,34 @@ class ExternalSystem(proto.Message):
number=5,
message=timestamp_pb2.Timestamp,
)
case_uri: str = proto.Field(
proto.STRING,
number=6,
)
case_priority: str = proto.Field(
proto.STRING,
number=7,
)
case_sla: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=9,
message=timestamp_pb2.Timestamp,
)
case_create_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=10,
message=timestamp_pb2.Timestamp,
)
case_close_time: timestamp_pb2.Timestamp = proto.Field(
proto.MESSAGE,
number=11,
message=timestamp_pb2.Timestamp,
)
ticket_info: TicketInfo = proto.Field(
proto.MESSAGE,
number=8,
message=TicketInfo,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
from google.cloud.securitycenter_v1.types import kernel_rootkit as gcs_kernel_rootkit
from google.cloud.securitycenter_v1.types import mitre_attack as gcs_mitre_attack
from google.cloud.securitycenter_v1.types import security_marks as gcs_security_marks
from google.cloud.securitycenter_v1.types import (
security_posture as gcs_security_posture,
)
from google.cloud.securitycenter_v1.types import vulnerability as gcs_vulnerability
from google.cloud.securitycenter_v1.types import access as gcs_access
from google.cloud.securitycenter_v1.types import application as gcs_application
Expand Down Expand Up @@ -251,6 +254,9 @@ class Finding(proto.Message):
finding.
backup_disaster_recovery (google.cloud.securitycenter_v1.types.BackupDisasterRecovery):
Fields related to Backup and DR findings.
security_posture (google.cloud.securitycenter_v1.types.SecurityPosture):
The security posture associated with the
finding.
log_entries (MutableSequence[google.cloud.securitycenter_v1.types.LogEntry]):
Log entries that are relevant to the finding.
load_balancers (MutableSequence[google.cloud.securitycenter_v1.types.LoadBalancer]):
Expand Down Expand Up @@ -404,13 +410,17 @@ class FindingClass(proto.Enum):
SCC_ERROR (5):
Describes an error that prevents some SCC
functionality.
POSTURE_VIOLATION (6):
Describes a potential security risk due to a
change in the security posture.
"""
FINDING_CLASS_UNSPECIFIED = 0
THREAT = 1
VULNERABILITY = 2
MISCONFIGURATION = 3
OBSERVATION = 4
SCC_ERROR = 5
POSTURE_VIOLATION = 6

name: str = proto.Field(
proto.STRING,
Expand Down Expand Up @@ -615,6 +625,11 @@ class FindingClass(proto.Enum):
message=gcs_backup_disaster_recovery.BackupDisasterRecovery,
)
)
security_posture: gcs_security_posture.SecurityPosture = proto.Field(
proto.MESSAGE,
number=56,
message=gcs_security_posture.SecurityPosture,
)
log_entries: MutableSequence[log_entry.LogEntry] = proto.RepeatedField(
proto.MESSAGE,
number=57,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# -*- coding: utf-8 -*-
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import MutableMapping, MutableSequence

import proto # type: ignore

__protobuf__ = proto.module(
package="google.cloud.securitycenter.v1",
manifest={
"SecurityPosture",
},
)


class SecurityPosture(proto.Message):
r"""Represents a posture that is deployed on Google Cloud by the
Security Command Center Posture Management service. A posture
contains one or more policy sets. A policy set is a group of
policies that enforce a set of security rules on Google Cloud.
Attributes:
name (str):
Name of the posture, for example, ``CIS-Posture``.
revision_id (str):
The version of the posture, for example, ``c7cfa2a8``.
posture_deployment_resource (str):
The project, folder, or organization on which the posture is
deployed, for example, ``projects/{project_number}``.
posture_deployment (str):
The name of the posture deployment, for example,
``organizations/{org_id}/posturedeployments/{posture_deployment_id}``.
changed_policy (str):
The name of the updated policy, for example,
``projects/{project_id}/policies/{constraint_name}``.
policy_set (str):
The name of the updated policyset, for example,
``cis-policyset``.
policy (str):
The ID of the updated policy, for example,
``compute-policy-1``.
policy_drift_details (MutableSequence[google.cloud.securitycenter_v1.types.SecurityPosture.PolicyDriftDetails]):
The details about a change in an updated
policy that violates the deployed posture.
"""

class PolicyDriftDetails(proto.Message):
r"""The policy field that violates the deployed posture and its
expected and detected values.
Attributes:
field (str):
The name of the updated field, for example
constraint.implementation.policy_rules[0].enforce
expected_value (str):
The value of this field that was configured in a posture,
for example, ``true`` or
``allowed_values={"projects/29831892"}``.
detected_value (str):
The detected value that violates the deployed posture, for
example, ``false`` or
``allowed_values={"projects/22831892"}``.
"""

field: str = proto.Field(
proto.STRING,
number=1,
)
expected_value: str = proto.Field(
proto.STRING,
number=2,
)
detected_value: str = proto.Field(
proto.STRING,
number=3,
)

name: str = proto.Field(
proto.STRING,
number=1,
)
revision_id: str = proto.Field(
proto.STRING,
number=2,
)
posture_deployment_resource: str = proto.Field(
proto.STRING,
number=3,
)
posture_deployment: str = proto.Field(
proto.STRING,
number=4,
)
changed_policy: str = proto.Field(
proto.STRING,
number=5,
)
policy_set: str = proto.Field(
proto.STRING,
number=6,
)
policy: str = proto.Field(
proto.STRING,
number=7,
)
policy_drift_details: MutableSequence[PolicyDriftDetails] = proto.RepeatedField(
proto.MESSAGE,
number=8,
message=PolicyDriftDetails,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Loading

0 comments on commit 736a1ef

Please sign in to comment.