Skip to content

Commit

Permalink
feat: Added cloud provider field to list findings response (#26242)
Browse files Browse the repository at this point in the history
feat: Added http configuration rule to ResourceValueConfig and ValuedResource API methods
feat: Added toxic combination field to finding
docs: Updated comments for ResourceValueConfig
  • Loading branch information
gcf-owl-bot[bot] authored Jun 27, 2024
1 parent 1616141 commit 8b5746c
Show file tree
Hide file tree
Showing 26 changed files with 927 additions and 74 deletions.
6 changes: 6 additions & 0 deletions google-cloud-security_center-v2/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"lib/google/cloud/securitycenter/v2/attack_path_pb.rb",
"lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb",
"lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb",
"lib/google/cloud/securitycenter/v2/cloud_armor_pb.rb",
"lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb",
"lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb",
"lib/google/cloud/securitycenter/v2/compliance_pb.rb",
Expand All @@ -43,6 +44,7 @@
"lib/google/cloud/securitycenter/v2/external_system_pb.rb",
"lib/google/cloud/securitycenter/v2/file_pb.rb",
"lib/google/cloud/securitycenter/v2/finding_pb.rb",
"lib/google/cloud/securitycenter/v2/folder_pb.rb",
"lib/google/cloud/securitycenter/v2/group_membership_pb.rb",
"lib/google/cloud/securitycenter/v2/iam_binding_pb.rb",
"lib/google/cloud/securitycenter/v2/indicator_pb.rb",
Expand All @@ -53,6 +55,7 @@
"lib/google/cloud/securitycenter/v2/log_entry_pb.rb",
"lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb",
"lib/google/cloud/securitycenter/v2/mute_config_pb.rb",
"lib/google/cloud/securitycenter/v2/notebook_pb.rb",
"lib/google/cloud/securitycenter/v2/notification_config_pb.rb",
"lib/google/cloud/securitycenter/v2/notification_message_pb.rb",
"lib/google/cloud/securitycenter/v2/org_policy_pb.rb",
Expand Down Expand Up @@ -80,6 +83,7 @@
"proto_docs/google/cloud/securitycenter/v2/attack_path.rb",
"proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb",
"proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb",
"proto_docs/google/cloud/securitycenter/v2/cloud_armor.rb",
"proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb",
"proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb",
"proto_docs/google/cloud/securitycenter/v2/compliance.rb",
Expand All @@ -91,6 +95,7 @@
"proto_docs/google/cloud/securitycenter/v2/external_system.rb",
"proto_docs/google/cloud/securitycenter/v2/file.rb",
"proto_docs/google/cloud/securitycenter/v2/finding.rb",
"proto_docs/google/cloud/securitycenter/v2/folder.rb",
"proto_docs/google/cloud/securitycenter/v2/group_membership.rb",
"proto_docs/google/cloud/securitycenter/v2/iam_binding.rb",
"proto_docs/google/cloud/securitycenter/v2/indicator.rb",
Expand All @@ -101,6 +106,7 @@
"proto_docs/google/cloud/securitycenter/v2/log_entry.rb",
"proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb",
"proto_docs/google/cloud/securitycenter/v2/mute_config.rb",
"proto_docs/google/cloud/securitycenter/v2/notebook.rb",
"proto_docs/google/cloud/securitycenter/v2/notification_config.rb",
"proto_docs/google/cloud/securitycenter/v2/notification_message.rb",
"proto_docs/google/cloud/securitycenter/v2/org_policy.rb",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2118,14 +2118,6 @@ def get_source request, options = nil
# Required. Expression that defines what assets fields to use for grouping.
# The string value should follow SQL syntax: comma separated list of fields.
# For example: "parent,resource_name".
#
# The following fields are supported:
#
# * resource_name
# * category
# * state
# * parent
# * severity
# @param page_token [::String]
# The value returned by the last `GroupFindingsResponse`; indicates
# that this is a continuation of a prior `GroupFindings` call, and
Expand Down Expand Up @@ -4073,6 +4065,10 @@ def update_notification_config request, options = nil
# The list of fields to be updated.
# If empty all mutable fields will be updated.
#
# To update nested fields, include the top level field in the mask
# For example, to update gcp_metadata.resource_type, include the
# "gcp_metadata" field mask
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,27 @@ def organization_location_path organization:, location:
"organizations/#{organization}/locations/#{location}"
end

##
# Create a fully-qualified OrganizationValuedResource resource string.
#
# The resource will be in the following format:
#
# `organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}`
#
# @param organization [String]
# @param location [String]
# @param simulation [String]
# @param valued_resource [String]
#
# @return [::String]
def organization_valued_resource_path organization:, location:, simulation:, valued_resource:
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/"

"organizations/#{organization}/locations/#{location}/simulations/#{simulation}/valuedResources/#{valued_resource}"
end

##
# Create a fully-qualified Policy resource string.
#
Expand Down Expand Up @@ -656,18 +677,42 @@ def project_path project:
##
# Create a fully-qualified ResourceValueConfig resource string.
#
# The resource will be in the following format:
# @overload resource_value_config_path(organization:, resource_value_config:)
# The resource will be in the following format:
#
# `organizations/{organization}/resourceValueConfigs/{resource_value_config}`
# `organizations/{organization}/resourceValueConfigs/{resource_value_config}`
#
# @param organization [String]
# @param resource_value_config [String]
# @param organization [String]
# @param resource_value_config [String]
#
# @overload resource_value_config_path(organization:, location:, resource_value_config:)
# The resource will be in the following format:
#
# `organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}`
#
# @param organization [String]
# @param location [String]
# @param resource_value_config [String]
#
# @return [::String]
def resource_value_config_path organization:, resource_value_config:
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
def resource_value_config_path **args
resources = {
"organization:resource_value_config" => (proc do |organization:, resource_value_config:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"

"organizations/#{organization}/resourceValueConfigs/#{resource_value_config}"
end),
"location:organization:resource_value_config" => (proc do |organization:, location:, resource_value_config:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"organizations/#{organization}/locations/#{location}/resourceValueConfigs/#{resource_value_config}"
end)
}

"organizations/#{organization}/resourceValueConfigs/#{resource_value_config}"
resource = resources[args.keys.sort.join(":")]
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
resource.call(**args)
end

##
Expand Down Expand Up @@ -821,18 +866,42 @@ def security_marks_path **args
##
# Create a fully-qualified Simulation resource string.
#
# The resource will be in the following format:
# @overload simulation_path(organization:, simulation:)
# The resource will be in the following format:
#
# `organizations/{organization}/simulations/{simulation}`
# `organizations/{organization}/simulations/{simulation}`
#
# @param organization [String]
# @param simulation [String]
# @param organization [String]
# @param simulation [String]
#
# @overload simulation_path(organization:, location:, simluation:)
# The resource will be in the following format:
#
# `organizations/{organization}/locations/{location}/simulations/{simluation}`
#
# @param organization [String]
# @param location [String]
# @param simluation [String]
#
# @return [::String]
def simulation_path organization:, simulation:
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
def simulation_path **args
resources = {
"organization:simulation" => (proc do |organization:, simulation:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"

"organizations/#{organization}/simulations/#{simulation}"
end),
"location:organization:simluation" => (proc do |organization:, location:, simluation:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"organizations/#{organization}/locations/#{location}/simulations/#{simluation}"
end)
}

"organizations/#{organization}/simulations/#{simulation}"
resource = resources[args.keys.sort.join(":")]
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
resource.call(**args)
end

##
Expand Down Expand Up @@ -948,20 +1017,46 @@ def topic_path project:, topic:
##
# Create a fully-qualified ValuedResource resource string.
#
# The resource will be in the following format:
# @overload valued_resource_path(organization:, simulation:, valued_resource:)
# The resource will be in the following format:
#
# `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
# `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
#
# @param organization [String]
# @param simulation [String]
# @param valued_resource [String]
# @param organization [String]
# @param simulation [String]
# @param valued_resource [String]
#
# @overload valued_resource_path(organization:, location:, simluation:, valued_resource:)
# The resource will be in the following format:
#
# `organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}`
#
# @param organization [String]
# @param location [String]
# @param simluation [String]
# @param valued_resource [String]
#
# @return [::String]
def valued_resource_path organization:, simulation:, valued_resource:
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/"
def valued_resource_path **args
resources = {
"organization:simulation:valued_resource" => (proc do |organization:, simulation:, valued_resource:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "simulation cannot contain /" if simulation.to_s.include? "/"

"organizations/#{organization}/simulations/#{simulation}/valuedResources/#{valued_resource}"
end),
"location:organization:simluation:valued_resource" => (proc do |organization:, location:, simluation:, valued_resource:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
raise ::ArgumentError, "simluation cannot contain /" if simluation.to_s.include? "/"

"organizations/#{organization}/simulations/#{simulation}/valuedResources/#{valued_resource}"
"organizations/#{organization}/locations/#{location}/simulations/#{simluation}/valuedResources/#{valued_resource}"
end)
}

resource = resources[args.keys.sort.join(":")]
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
resource.call(**args)
end

extend self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1933,14 +1933,6 @@ def get_source request, options = nil
# Required. Expression that defines what assets fields to use for grouping.
# The string value should follow SQL syntax: comma separated list of fields.
# For example: "parent,resource_name".
#
# The following fields are supported:
#
# * resource_name
# * category
# * state
# * parent
# * severity
# @param page_token [::String]
# The value returned by the last `GroupFindingsResponse`; indicates
# that this is a continuation of a prior `GroupFindings` call, and
Expand Down Expand Up @@ -3731,6 +3723,10 @@ def update_notification_config request, options = nil
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
# The list of fields to be updated.
# If empty all mutable fields will be updated.
#
# To update nested fields, include the top level field in the mask
# For example, to update gcp_metadata.resource_type, include the
# "gcp_metadata" field mask
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
Expand Down
Loading

0 comments on commit 8b5746c

Please sign in to comment.