#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BillingSettings {
#[prost(enumeration = "BillingTier", tag = "1")]
pub billing_tier: i32,
#[prost(enumeration = "BillingType", tag = "2")]
pub billing_type: i32,
#[prost(message, optional, tag = "3")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BillingTier {
Unspecified = 0,
Standard = 1,
Premium = 2,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BillingType {
Unspecified = 0,
Subscription = 1,
TrialSubscription = 2,
Alpha = 3,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComponentSettings {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "ComponentEnablementState", tag = "2")]
pub state: i32,
#[prost(string, tag = "3")]
pub project_service_account: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "4")]
pub detector_settings: ::std::collections::HashMap<
::prost::alloc::string::String,
component_settings::DetectorSettings,
>,
#[prost(string, tag = "5")]
pub etag: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "component_settings::SpecificSettings", tags = "41, 42, 44, 40")]
pub specific_settings: ::core::option::Option<component_settings::SpecificSettings>,
}
pub mod component_settings {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectorSettings {
#[prost(enumeration = "super::ComponentEnablementState", tag = "1")]
pub state: i32,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SpecificSettings {
#[prost(message, tag = "41")]
ContainerThreatDetectionSettings(super::ContainerThreatDetectionSettings),
#[prost(message, tag = "42")]
EventThreatDetectionSettings(super::EventThreatDetectionSettings),
#[prost(message, tag = "44")]
SecurityHealthAnalyticsSettings(super::SecurityHealthAnalyticsSettings),
#[prost(message, tag = "40")]
WebSecurityScannerSettings(super::WebSecurityScanner),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WebSecurityScanner {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerThreatDetectionSettings {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventThreatDetectionSettings {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SecurityHealthAnalyticsSettings {
#[prost(message, optional, tag = "1")]
pub non_org_iam_member_settings:
::core::option::Option<security_health_analytics_settings::NonOrgIamMemberSettings>,
#[prost(message, optional, tag = "2")]
pub admin_service_account_settings:
::core::option::Option<security_health_analytics_settings::AdminServiceAccountSettings>,
}
pub mod security_health_analytics_settings {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NonOrgIamMemberSettings {
#[prost(string, repeated, tag = "1")]
pub approved_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AdminServiceAccountSettings {
#[prost(string, repeated, tag = "1")]
pub approved_identities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ComponentEnablementState {
Unspecified = 0,
Disable = 1,
Enable = 2,
Inherit = 3,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Detector {
#[prost(string, tag = "1")]
pub detector: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub component: ::prost::alloc::string::String,
#[prost(enumeration = "BillingTier", tag = "3")]
pub billing_tier: i32,
#[prost(string, repeated, tag = "4")]
pub detector_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SinkSettings {
#[prost(string, tag = "1")]
pub logging_sink_project: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Settings {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub billing_settings: ::core::option::Option<BillingSettings>,
#[prost(enumeration = "settings::OnboardingState", tag = "3")]
pub state: i32,
#[prost(string, tag = "5")]
pub org_service_account: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub sink_settings: ::core::option::Option<SinkSettings>,
#[prost(map = "string, message", tag = "7")]
pub component_settings:
::std::collections::HashMap<::prost::alloc::string::String, ComponentSettings>,
#[prost(map = "string, message", tag = "8")]
pub detector_group_settings: ::std::collections::HashMap<
::prost::alloc::string::String,
settings::DetectorGroupSettings,
>,
#[prost(string, tag = "9")]
pub etag: ::prost::alloc::string::String,
#[prost(message, optional, tag = "10")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
}
pub mod settings {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectorGroupSettings {
#[prost(enumeration = "super::ComponentEnablementState", tag = "1")]
pub state: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OnboardingState {
Unspecified = 0,
Enabled = 1,
Disabled = 2,
BillingSelected = 3,
ProvidersSelected = 4,
ResourcesSelected = 5,
OrgServiceAccountCreated = 6,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServiceAccountRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceAccount {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub service_account: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSettingsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSettingsRequest {
#[prost(message, optional, tag = "1")]
pub settings: ::core::option::Option<Settings>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetSettingsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetSettingsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetSettingsResponse {
#[prost(message, repeated, tag = "1")]
pub settings: ::prost::alloc::vec::Vec<Settings>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CalculateEffectiveSettingsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCalculateEffectiveSettingsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub requests: ::prost::alloc::vec::Vec<CalculateEffectiveSettingsRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCalculateEffectiveSettingsResponse {
#[prost(message, repeated, tag = "1")]
pub settings: ::prost::alloc::vec::Vec<Settings>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetComponentSettingsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateComponentSettingsRequest {
#[prost(message, optional, tag = "1")]
pub component_settings: ::core::option::Option<ComponentSettings>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetComponentSettingsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub etag: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CalculateEffectiveComponentSettingsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDetectorsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub page_size: i32,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDetectorsResponse {
#[prost(message, repeated, tag = "1")]
pub detectors: ::prost::alloc::vec::Vec<Detector>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListComponentsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListComponentsResponse {
#[prost(string, repeated, tag = "1")]
pub components: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod security_center_settings_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " ## API Overview"]
#[doc = ""]
#[doc = " The SecurityCenterSettingsService is a sub-api of"]
#[doc = " `securitycenter.googleapis.com`. The service provides methods to manage"]
#[doc = " Security Center Settings, and Component Settings for GCP organizations,"]
#[doc = " folders, projects, and clusters."]
#[derive(Debug, Clone)]
pub struct SecurityCenterSettingsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> SecurityCenterSettingsServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SecurityCenterSettingsServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
SecurityCenterSettingsServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Retrieves the organizations service account, if it exists, otherwise it"]
#[doc = " creates the organization service account. This API is idempotent and"]
#[doc = " will only create a service account once. On subsequent calls it will"]
#[doc = " return the previously created service account. SHA, SCC and CTD Infra"]
#[doc = " Automation will use this SA. This SA will not have any permissions when"]
#[doc = " created. The UI will provision this via IAM or the user will using"]
#[doc = " their own internal process. This API only creates SAs on the organization."]
#[doc = " Folders are not supported and projects will use per-project SAs associated"]
#[doc = " with APIs enabled on a project. This API will be called by the UX"]
#[doc = " onboarding workflow."]
pub async fn get_service_account(
&mut self,
request: impl tonic::IntoRequest<super::GetServiceAccountRequest>,
) -> Result<tonic::Response<super::ServiceAccount>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/GetServiceAccount") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the Settings."]
pub async fn get_settings(
&mut self,
request: impl tonic::IntoRequest<super::GetSettingsRequest>,
) -> Result<tonic::Response<super::Settings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/GetSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the Settings."]
pub async fn update_settings(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSettingsRequest>,
) -> Result<tonic::Response<super::Settings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/UpdateSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Reset the organization, folder or project's settings and return"]
#[doc = " the settings of just that resource to the default."]
#[doc = ""]
#[doc = " Settings are present at the organization, folder, project, and cluster"]
#[doc = " levels. Using Reset on a sub-organization level will remove that resource's"]
#[doc = " override and result in the parent's settings being used (eg: if Reset on a"]
#[doc = " cluster, project settings will be used)."]
#[doc = ""]
#[doc = " Using Reset on organization will remove the override that was set and"]
#[doc = " result in default settings being used."]
pub async fn reset_settings(
&mut self,
request: impl tonic::IntoRequest<super::ResetSettingsRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/ResetSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a list of settings."]
pub async fn batch_get_settings(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetSettingsRequest>,
) -> Result<tonic::Response<super::BatchGetSettingsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/BatchGetSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " CalculateEffectiveSettings looks up all of the Security Center"]
#[doc = " Settings resources in the GCP resource hierarchy, and calculates the"]
#[doc = " effective settings on that resource by applying the following rules:"]
#[doc = " * Settings provided closer to the target resource take precedence over"]
#[doc = " those further away (e.g. folder will override organization level"]
#[doc = " settings)."]
#[doc = " * Product defaults can be overridden at org, folder, project, and cluster"]
#[doc = " levels."]
#[doc = " * Detectors will be filtered out if they belong to a billing tier the"]
#[doc = " customer"]
#[doc = " has not configured."]
pub async fn calculate_effective_settings(
&mut self,
request: impl tonic::IntoRequest<super::CalculateEffectiveSettingsRequest>,
) -> Result<tonic::Response<super::Settings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/CalculateEffectiveSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a list of effective settings."]
pub async fn batch_calculate_effective_settings(
&mut self,
request: impl tonic::IntoRequest<super::BatchCalculateEffectiveSettingsRequest>,
) -> Result<tonic::Response<super::BatchCalculateEffectiveSettingsResponse>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/BatchCalculateEffectiveSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the Component Settings."]
pub async fn get_component_settings(
&mut self,
request: impl tonic::IntoRequest<super::GetComponentSettingsRequest>,
) -> Result<tonic::Response<super::ComponentSettings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/GetComponentSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the Component Settings."]
pub async fn update_component_settings(
&mut self,
request: impl tonic::IntoRequest<super::UpdateComponentSettingsRequest>,
) -> Result<tonic::Response<super::ComponentSettings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/UpdateComponentSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Reset the organization, folder or project's component settings and return"]
#[doc = " the settings to the default. Settings are present at the"]
#[doc = " organization, folder and project levels. Using Reset for a folder or"]
#[doc = " project will remove the override that was set and result in the"]
#[doc = " organization-level settings being used."]
pub async fn reset_component_settings(
&mut self,
request: impl tonic::IntoRequest<super::ResetComponentSettingsRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/ResetComponentSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the Effective Component Settings."]
pub async fn calculate_effective_component_settings(
&mut self,
request: impl tonic::IntoRequest<super::CalculateEffectiveComponentSettingsRequest>,
) -> Result<tonic::Response<super::ComponentSettings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/CalculateEffectiveComponentSettings") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Retrieves an unordered list of available detectors."]
pub async fn list_detectors(
&mut self,
request: impl tonic::IntoRequest<super::ListDetectorsRequest>,
) -> Result<tonic::Response<super::ListDetectorsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/ListDetectors") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Retrieves an unordered list of available SCC components."]
pub async fn list_components(
&mut self,
request: impl tonic::IntoRequest<super::ListComponentsRequest>,
) -> Result<tonic::Response<super::ListComponentsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.securitycenter.settings.v1beta1.SecurityCenterSettingsService/ListComponents") ;
self.inner.unary(request.into_request(), path, codec).await
}
}
}