1
- // Copyright 2019 Google LLC.
1
+ // Copyright 2020 Google LLC
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
11
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
- //
15
14
16
15
syntax = "proto3" ;
17
16
18
17
package google.cloud.asset.v1 ;
19
18
20
19
import "google/api/resource.proto" ;
20
+ import "google/cloud/orgpolicy/v1/orgpolicy.proto" ;
21
21
import "google/iam/v1/policy.proto" ;
22
+ import "google/identity/accesscontextmanager/v1/access_level.proto" ;
23
+ import "google/identity/accesscontextmanager/v1/access_policy.proto" ;
24
+ import "google/identity/accesscontextmanager/v1/service_perimeter.proto" ;
22
25
import "google/protobuf/any.proto" ;
23
26
import "google/protobuf/struct.proto" ;
24
27
import "google/protobuf/timestamp.proto" ;
@@ -32,101 +35,138 @@ option java_outer_classname = "AssetProto";
32
35
option java_package = "com.google.cloud.asset.v1" ;
33
36
option php_namespace = "Google\\Cloud\\Asset\\V1" ;
34
37
35
- // Temporal asset. In addition to the asset, the temporal asset includes the
36
- // status of the asset and valid from and to time of it .
38
+ // An asset in Google Cloud and its temporal metadata, including the time window
39
+ // when it was observed and its status during that window .
37
40
message TemporalAsset {
38
41
// The time window when the asset data and state was observed.
39
42
TimeWindow window = 1 ;
40
43
41
- // If the asset is deleted or not.
44
+ // Whether the asset has been deleted or not.
42
45
bool deleted = 2 ;
43
46
44
- // Asset .
47
+ // An asset in Google Cloud .
45
48
Asset asset = 3 ;
46
49
}
47
50
48
- // A time window of ( start_time, end_time] .
51
+ // A time window specified by its " start_time" and " end_time" .
49
52
message TimeWindow {
50
53
// Start time of the time window (exclusive).
51
54
google.protobuf.Timestamp start_time = 1 ;
52
55
53
- // End time of the time window (inclusive).
54
- // Current timestamp if not specified .
56
+ // End time of the time window (inclusive). If not specified, the current
57
+ // timestamp is used instead .
55
58
google.protobuf.Timestamp end_time = 2 ;
56
59
}
57
60
58
- // Cloud asset. This includes all Google Cloud Platform resources,
59
- // Cloud IAM policies, and other non-GCP assets.
61
+ // An asset in Google Cloud. An asset can be any resource in the Google Cloud
62
+ // [resource
63
+ // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
64
+ // a resource outside the Google Cloud resource hierarchy (such as Google
65
+ // Kubernetes Engine clusters and objects), or a Cloud IAM policy.
60
66
message Asset {
61
67
option (google.api.resource ) = {
62
68
type : "cloudasset.googleapis.com/Asset"
63
69
pattern : "*"
64
70
};
65
71
66
72
// The full name of the asset. For example:
67
- // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
73
+ // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1"
74
+ //
68
75
// See [Resource
69
- // Names ](https://cloud.google.com/apis/design/resource_names#full_resource_name)
76
+ // names ](https://cloud.google.com/apis/design/resource_names#full_resource_name)
70
77
// for more information.
71
78
string name = 1 ;
72
79
73
- // Type of the asset. Example: "compute.googleapis.com/Disk".
80
+ // The type of the asset. For example: "compute.googleapis.com/Disk"
81
+ //
82
+ // See [Supported asset
83
+ // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
84
+ // for more information.
74
85
string asset_type = 2 ;
75
86
76
- // Representation of the resource.
87
+ // A representation of the resource.
77
88
Resource resource = 3 ;
78
89
79
- // Representation of the actual Cloud IAM policy set on a cloud resource. For
80
- // each resource, there must be at most one Cloud IAM policy set on it.
90
+ // A representation of the Cloud IAM policy set on a Google Cloud resource.
91
+ // There can be a maximum of one Cloud IAM policy set on any given resource.
92
+ // In addition, Cloud IAM policies inherit their granted access scope from any
93
+ // policies set on parent resources in the resource hierarchy. Therefore, the
94
+ // effectively policy is the union of both the policy set on this resource
95
+ // and each policy set on all of the resource's ancestry resource levels in
96
+ // the hierarchy. See
97
+ // [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
98
+ // more information.
81
99
google.iam.v1.Policy iam_policy = 4 ;
82
100
83
- // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
84
- // represented as a list of relative resource names. Ancestry path starts with
85
- // the closest CRM ancestor and ends at root. If the asset is a CRM
86
- // project/folder/organization, this starts from the asset itself.
101
+ // A representation of an [organization
102
+ // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
103
+ // There can be more than one organization policy with different constraints
104
+ // set on a given resource.
105
+ repeated google.cloud.orgpolicy.v1.Policy org_policy = 6 ;
106
+
107
+ // A representation of an [access
108
+ // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
109
+ oneof access_context_policy {
110
+ google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7 ;
111
+
112
+ google.identity.accesscontextmanager.v1.AccessLevel access_level = 8 ;
113
+
114
+ google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9 ;
115
+ }
116
+
117
+ // The ancestry path of an asset in Google Cloud [resource
118
+ // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
119
+ // represented as a list of relative resource names. An ancestry path starts
120
+ // with the closest ancestor in the hierarchy and ends at root. If the asset
121
+ // is a project, folder, or organization, the ancestry path starts from the
122
+ // asset itself.
87
123
//
88
- // Example: ["projects/123456789", "folders/5432", "organizations/1234"]
124
+ // For example: ` ["projects/123456789", "folders/5432", "organizations/1234"]`
89
125
repeated string ancestors = 10 ;
90
126
}
91
127
92
- // Representation of a cloud resource.
128
+ // A representation of a Google Cloud resource.
93
129
message Resource {
94
- // The API version. Example : "v1".
130
+ // The API version. For example : "v1"
95
131
string version = 1 ;
96
132
97
133
// The URL of the discovery document containing the resource's JSON schema.
98
134
// For example:
99
- // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
100
- // It will be left unspecified for resources without a discovery-based API,
101
- // such as Cloud Bigtable.
135
+ // "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"
136
+ //
137
+ // This value is unspecified for resources that do not have an API based on a
138
+ // discovery document, such as Cloud Bigtable.
102
139
string discovery_document_uri = 2 ;
103
140
104
- // The JSON schema name listed in the discovery document.
105
- // Example: "Project". It will be left unspecified for resources (such as
106
- // Cloud Bigtable) without a discovery-based API.
141
+ // The JSON schema name listed in the discovery document. For example:
142
+ // "Project"
143
+ //
144
+ // This value is unspecified for resources that do not have an API based on a
145
+ // discovery document, such as Cloud Bigtable.
107
146
string discovery_name = 3 ;
108
147
109
- // The REST URL for accessing the resource. An HTTP GET operation using this
110
- // URL returns the resource itself.
111
- // Example:
112
- // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
113
- // It will be left unspecified for resources without a REST API.
148
+ // The REST URL for accessing the resource. An HTTP ` GET` request using this
149
+ // URL returns the resource itself. For example:
150
+ // "https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123"
151
+ //
152
+ // This value is unspecified for resources without a REST API.
114
153
string resource_url = 4 ;
115
154
116
155
// The full name of the immediate parent of this resource. See
117
156
// [Resource
118
157
// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
119
158
// for more information.
120
159
//
121
- // For GCP assets, it is the parent resource defined in the [Cloud IAM policy
160
+ // For Google Cloud assets, this value is the parent resource defined in the
161
+ // [Cloud IAM policy
122
162
// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
123
163
// For example:
124
- // ` "//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
164
+ // "//cloudresourcemanager.googleapis.com/projects/my_project_123"
125
165
//
126
- // For third-party assets, it is up to the users to define .
166
+ // For third-party assets, this field may be set differently .
127
167
string parent = 5 ;
128
168
129
- // The content of the resource, in which some sensitive fields are scrubbed
130
- // away and may not be present.
169
+ // The content of the resource, in which some sensitive fields are removed
170
+ // and may not be present.
131
171
google.protobuf.Struct data = 6 ;
132
172
}
0 commit comments