1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.securitycenter.v1;
18
19import "google/api/resource.proto";
20import "google/cloud/securitycenter/v1/folder.proto";
21import "google/cloud/securitycenter/v1/security_marks.proto";
22import "google/protobuf/struct.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
26option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb";
27option java_multiple_files = true;
28option java_package = "com.google.cloud.securitycenter.v1";
29option php_namespace = "Google\\Cloud\\SecurityCenter\\V1";
30option ruby_package = "Google::Cloud::SecurityCenter::V1";
31
32// Security Command Center representation of a Google Cloud
33// resource.
34//
35// The Asset is a Security Command Center resource that captures information
36// about a single Google Cloud resource. All modifications to an Asset are only
37// within the context of Security Command Center and don't affect the referenced
38// Google Cloud resource.
39message Asset {
40  option (google.api.resource) = {
41    type: "securitycenter.googleapis.com/Asset"
42    pattern: "organizations/{organization}/assets/{asset}"
43    pattern: "folders/{folder}/assets/{asset}"
44    pattern: "projects/{project}/assets/{asset}"
45  };
46
47  // Security Command Center managed properties. These properties are managed by
48  // Security Command Center and cannot be modified by the user.
49  message SecurityCenterProperties {
50    // The full resource name of the Google Cloud resource this asset
51    // represents. This field is immutable after create time. See:
52    // https://cloud.google.com/apis/design/resource_names#full_resource_name
53    string resource_name = 1;
54
55    // The type of the Google Cloud resource. Examples include: APPLICATION,
56    // PROJECT, and ORGANIZATION. This is a case insensitive field defined by
57    // Security Command Center and/or the producer of the resource and is
58    // immutable after create time.
59    string resource_type = 2;
60
61    // The full resource name of the immediate parent of the resource. See:
62    // https://cloud.google.com/apis/design/resource_names#full_resource_name
63    string resource_parent = 3;
64
65    // The full resource name of the project the resource belongs to. See:
66    // https://cloud.google.com/apis/design/resource_names#full_resource_name
67    string resource_project = 4;
68
69    // Owners of the Google Cloud resource.
70    repeated string resource_owners = 5;
71
72    // The user defined display name for this resource.
73    string resource_display_name = 6;
74
75    // The user defined display name for the parent of this resource.
76    string resource_parent_display_name = 7;
77
78    // The user defined display name for the project of this resource.
79    string resource_project_display_name = 8;
80
81    // Contains a Folder message for each folder in the assets ancestry.
82    // The first folder is the deepest nested folder, and the last folder is the
83    // folder directly under the Organization.
84    repeated Folder folders = 10;
85  }
86
87  // Cloud IAM Policy information associated with the Google Cloud resource
88  // described by the Security Command Center asset. This information is managed
89  // and defined by the Google Cloud resource and cannot be modified by the
90  // user.
91  message IamPolicy {
92    // The JSON representation of the Policy associated with the asset.
93    // See https://cloud.google.com/iam/reference/rest/v1/Policy for format
94    // details.
95    string policy_blob = 1;
96  }
97
98  // The relative resource name of this asset. See:
99  // https://cloud.google.com/apis/design/resource_names#relative_resource_name
100  // Example:
101  // "organizations/{organization_id}/assets/{asset_id}".
102  string name = 1;
103
104  // Security Command Center managed properties. These properties are managed by
105  // Security Command Center and cannot be modified by the user.
106  SecurityCenterProperties security_center_properties = 2;
107
108  // Resource managed properties. These properties are managed and defined by
109  // the Google Cloud resource and cannot be modified by the user.
110  map<string, google.protobuf.Value> resource_properties = 7;
111
112  // User specified security marks. These marks are entirely managed by the user
113  // and come from the SecurityMarks resource that belongs to the asset.
114  SecurityMarks security_marks = 8;
115
116  // The time at which the asset was created in Security Command Center.
117  google.protobuf.Timestamp create_time = 9;
118
119  // The time at which the asset was last updated or added in Cloud SCC.
120  google.protobuf.Timestamp update_time = 10;
121
122  // Cloud IAM Policy information associated with the Google Cloud resource
123  // described by the Security Command Center asset. This information is managed
124  // and defined by the Google Cloud resource and cannot be modified by the
125  // user.
126  IamPolicy iam_policy = 11;
127
128  // The canonical name of the resource. It's either
129  // "organizations/{organization_id}/assets/{asset_id}",
130  // "folders/{folder_id}/assets/{asset_id}" or
131  // "projects/{project_number}/assets/{asset_id}", depending on the closest CRM
132  // ancestor of the resource.
133  string canonical_name = 13;
134}
135