assets.proto 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.cloud.asset.v1p7beta1;
  16. import "google/api/resource.proto";
  17. import "google/cloud/orgpolicy/v1/orgpolicy.proto";
  18. import "google/cloud/osconfig/v1/inventory.proto";
  19. import "google/iam/v1/policy.proto";
  20. import "google/identity/accesscontextmanager/v1/access_level.proto";
  21. import "google/identity/accesscontextmanager/v1/access_policy.proto";
  22. import "google/identity/accesscontextmanager/v1/service_perimeter.proto";
  23. import "google/protobuf/struct.proto";
  24. import "google/protobuf/timestamp.proto";
  25. option cc_enable_arenas = true;
  26. option csharp_namespace = "Google.Cloud.Asset.V1P7Beta1";
  27. option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p7beta1;asset";
  28. option java_multiple_files = true;
  29. option java_outer_classname = "AssetProto";
  30. option java_package = "com.google.cloud.asset.v1p7beta1";
  31. option php_namespace = "Google\\Cloud\\Asset\\V1p7beta1";
  32. // The Cloud Asset API.
  33. // An asset in Google Cloud. An asset can be any resource in the Google Cloud
  34. // [resource
  35. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  36. // a resource outside the Google Cloud resource hierarchy (such as Google
  37. // Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
  38. // See [Supported asset
  39. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  40. // for more information.
  41. message Asset {
  42. option (google.api.resource) = {
  43. type: "cloudasset.googleapis.com/Asset"
  44. pattern: "*"
  45. };
  46. // The last update timestamp of an asset. update_time is updated when
  47. // create/update/delete operation is performed.
  48. google.protobuf.Timestamp update_time = 11;
  49. // The full name of the asset. Example:
  50. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
  51. //
  52. // See [Resource
  53. // names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  54. // for more information.
  55. string name = 1;
  56. // The type of the asset. Example: `compute.googleapis.com/Disk`
  57. //
  58. // See [Supported asset
  59. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  60. // for more information.
  61. string asset_type = 2;
  62. // A representation of the resource.
  63. Resource resource = 3;
  64. // A representation of the Cloud IAM policy set on a Google Cloud resource.
  65. // There can be a maximum of one Cloud IAM policy set on any given resource.
  66. // In addition, Cloud IAM policies inherit their granted access scope from any
  67. // policies set on parent resources in the resource hierarchy. Therefore, the
  68. // effectively policy is the union of both the policy set on this resource
  69. // and each policy set on all of the resource's ancestry resource levels in
  70. // the hierarchy. See
  71. // [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
  72. // more information.
  73. google.iam.v1.Policy iam_policy = 4;
  74. // A representation of an [organization
  75. // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
  76. // There can be more than one organization policy with different constraints
  77. // set on a given resource.
  78. repeated google.cloud.orgpolicy.v1.Policy org_policy = 6;
  79. // A representation of an [access
  80. // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
  81. oneof access_context_policy {
  82. // Please also refer to the [access policy user
  83. // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
  84. google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
  85. // Please also refer to the [access level user
  86. // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
  87. google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
  88. // Please also refer to the [service perimeter user
  89. // guide](https://cloud.google.com/vpc-service-controls/docs/overview).
  90. google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter =
  91. 9;
  92. }
  93. // The related assets of the asset of one relationship type.
  94. // One asset only represents one type of relationship.
  95. RelatedAssets related_assets = 13;
  96. // The ancestry path of an asset in Google Cloud [resource
  97. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  98. // represented as a list of relative resource names. An ancestry path starts
  99. // with the closest ancestor in the hierarchy and ends at root. If the asset
  100. // is a project, folder, or organization, the ancestry path starts from the
  101. // asset itself.
  102. //
  103. // Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
  104. repeated string ancestors = 10;
  105. }
  106. // A representation of a Google Cloud resource.
  107. message Resource {
  108. // The API version. Example: `v1`
  109. string version = 1;
  110. // The URL of the discovery document containing the resource's JSON schema.
  111. // Example:
  112. // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
  113. //
  114. // This value is unspecified for resources that do not have an API based on a
  115. // discovery document, such as Cloud Bigtable.
  116. string discovery_document_uri = 2;
  117. // The JSON schema name listed in the discovery document. Example:
  118. // `Project`
  119. //
  120. // This value is unspecified for resources that do not have an API based on a
  121. // discovery document, such as Cloud Bigtable.
  122. string discovery_name = 3;
  123. // The REST URL for accessing the resource. An HTTP `GET` request using this
  124. // URL returns the resource itself. Example:
  125. // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
  126. //
  127. // This value is unspecified for resources without a REST API.
  128. string resource_url = 4;
  129. // The full name of the immediate parent of this resource. See
  130. // [Resource
  131. // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  132. // for more information.
  133. //
  134. // For Google Cloud assets, this value is the parent resource defined in the
  135. // [Cloud IAM policy
  136. // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
  137. // Example:
  138. // `//cloudresourcemanager.googleapis.com/projects/my_project_123`
  139. //
  140. // For third-party assets, this field may be set differently.
  141. string parent = 5;
  142. // The content of the resource, in which some sensitive fields are removed
  143. // and may not be present.
  144. google.protobuf.Struct data = 6;
  145. // The location of the resource in Google Cloud, such as its zone and region.
  146. // For more information, see https://cloud.google.com/about/locations/.
  147. string location = 8;
  148. }
  149. // The detailed related assets with the `relationship_type`.
  150. message RelatedAssets {
  151. // The detailed relation attributes.
  152. RelationshipAttributes relationship_attributes = 1;
  153. // The peer resources of the relationship.
  154. repeated RelatedAsset assets = 2;
  155. }
  156. // The relationship attributes which include `type`, `source_resource_type`,
  157. // `target_resource_type` and `action`.
  158. message RelationshipAttributes {
  159. // The unique identifier of the relationship type. Example:
  160. // `INSTANCE_TO_INSTANCEGROUP`
  161. string type = 4;
  162. // The source asset type. Example: `compute.googleapis.com/Instance`
  163. string source_resource_type = 1;
  164. // The target asset type. Example: `compute.googleapis.com/Disk`
  165. string target_resource_type = 2;
  166. // The detail of the relationship, e.g. `contains`, `attaches`
  167. string action = 3;
  168. }
  169. // An asset identify in Google Cloud which contains its name, type and
  170. // ancestors. An asset can be any resource in the Google Cloud [resource
  171. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  172. // a resource outside the Google Cloud resource hierarchy (such as Google
  173. // Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
  174. // See [Supported asset
  175. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  176. // for more information.
  177. message RelatedAsset {
  178. // The full name of the asset. Example:
  179. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
  180. //
  181. // See [Resource
  182. // names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  183. // for more information.
  184. string asset = 1 [(google.api.resource_reference) = {
  185. type: "cloudasset.googleapis.com/Asset"
  186. }];
  187. // The type of the asset. Example: `compute.googleapis.com/Disk`
  188. //
  189. // See [Supported asset
  190. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  191. // for more information.
  192. string asset_type = 2;
  193. // The ancestors of an asset in Google Cloud [resource
  194. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  195. // represented as a list of relative resource names. An ancestry path starts
  196. // with the closest ancestor in the hierarchy and ends at root.
  197. //
  198. // Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
  199. repeated string ancestors = 3;
  200. }