assets.proto 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. // Copyright 2022 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.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/orgpolicy/v1/orgpolicy.proto";
  19. import "google/cloud/osconfig/v1/inventory.proto";
  20. import "google/iam/v1/policy.proto";
  21. import "google/identity/accesscontextmanager/v1/access_level.proto";
  22. import "google/identity/accesscontextmanager/v1/access_policy.proto";
  23. import "google/identity/accesscontextmanager/v1/service_perimeter.proto";
  24. import "google/protobuf/struct.proto";
  25. import "google/protobuf/timestamp.proto";
  26. import "google/rpc/code.proto";
  27. option cc_enable_arenas = true;
  28. option csharp_namespace = "Google.Cloud.Asset.V1";
  29. option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1;asset";
  30. option java_multiple_files = true;
  31. option java_outer_classname = "AssetProto";
  32. option java_package = "com.google.cloud.asset.v1";
  33. option php_namespace = "Google\\Cloud\\Asset\\V1";
  34. // An asset in Google Cloud and its temporal metadata, including the time window
  35. // when it was observed and its status during that window.
  36. message TemporalAsset {
  37. // State of prior asset.
  38. enum PriorAssetState {
  39. // prior_asset is not applicable for the current asset.
  40. PRIOR_ASSET_STATE_UNSPECIFIED = 0;
  41. // prior_asset is populated correctly.
  42. PRESENT = 1;
  43. // Failed to set prior_asset.
  44. INVALID = 2;
  45. // Current asset is the first known state.
  46. DOES_NOT_EXIST = 3;
  47. // prior_asset is a deletion.
  48. DELETED = 4;
  49. }
  50. // The time window when the asset data and state was observed.
  51. TimeWindow window = 1;
  52. // Whether the asset has been deleted or not.
  53. bool deleted = 2;
  54. // An asset in Google Cloud.
  55. Asset asset = 3;
  56. // State of prior_asset.
  57. PriorAssetState prior_asset_state = 4;
  58. // Prior copy of the asset. Populated if prior_asset_state is PRESENT.
  59. // Currently this is only set for responses in Real-Time Feed.
  60. Asset prior_asset = 5;
  61. }
  62. // A time window specified by its `start_time` and `end_time`.
  63. message TimeWindow {
  64. // Start time of the time window (exclusive).
  65. google.protobuf.Timestamp start_time = 1;
  66. // End time of the time window (inclusive). If not specified, the current
  67. // timestamp is used instead.
  68. google.protobuf.Timestamp end_time = 2;
  69. }
  70. // An asset in Google Cloud. An asset can be any resource in the Google Cloud
  71. // [resource
  72. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  73. // a resource outside the Google Cloud resource hierarchy (such as Google
  74. // Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy),
  75. // or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship).
  76. // See [Supported asset
  77. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  78. // for more information.
  79. message Asset {
  80. option (google.api.resource) = {
  81. type: "cloudasset.googleapis.com/Asset"
  82. pattern: "*"
  83. };
  84. // The last update timestamp of an asset. update_time is updated when
  85. // create/update/delete operation is performed.
  86. google.protobuf.Timestamp update_time = 11;
  87. // The full name of the asset. Example:
  88. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
  89. //
  90. // See [Resource
  91. // names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  92. // for more information.
  93. string name = 1;
  94. // The type of the asset. Example: `compute.googleapis.com/Disk`
  95. //
  96. // See [Supported asset
  97. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  98. // for more information.
  99. string asset_type = 2;
  100. // A representation of the resource.
  101. Resource resource = 3;
  102. // A representation of the Cloud IAM policy set on a Google Cloud resource.
  103. // There can be a maximum of one Cloud IAM policy set on any given resource.
  104. // In addition, Cloud IAM policies inherit their granted access scope from any
  105. // policies set on parent resources in the resource hierarchy. Therefore, the
  106. // effectively policy is the union of both the policy set on this resource
  107. // and each policy set on all of the resource's ancestry resource levels in
  108. // the hierarchy. See
  109. // [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
  110. // for more information.
  111. google.iam.v1.Policy iam_policy = 4;
  112. // A representation of an [organization
  113. // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
  114. // There can be more than one organization policy with different constraints
  115. // set on a given resource.
  116. repeated google.cloud.orgpolicy.v1.Policy org_policy = 6;
  117. // A representation of an [access
  118. // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
  119. oneof access_context_policy {
  120. // Please also refer to the [access policy user
  121. // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
  122. google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
  123. // Please also refer to the [access level user
  124. // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
  125. google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
  126. // Please also refer to the [service perimeter user
  127. // guide](https://cloud.google.com/vpc-service-controls/docs/overview).
  128. google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
  129. }
  130. // A representation of runtime OS Inventory information. See [this
  131. // topic](https://cloud.google.com/compute/docs/instances/os-inventory-management)
  132. // for more information.
  133. google.cloud.osconfig.v1.Inventory os_inventory = 12;
  134. // DEPRECATED. This field only presents for the purpose of
  135. // backward-compatibility. The server will never generate responses with this
  136. // field.
  137. // The related assets of the asset of one relationship type. One asset
  138. // only represents one type of relationship.
  139. RelatedAssets related_assets = 13 [deprecated = true];
  140. // One related asset of the current asset.
  141. RelatedAsset related_asset = 15;
  142. // The ancestry path of an asset in Google Cloud [resource
  143. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  144. // represented as a list of relative resource names. An ancestry path starts
  145. // with the closest ancestor in the hierarchy and ends at root. If the asset
  146. // is a project, folder, or organization, the ancestry path starts from the
  147. // asset itself.
  148. //
  149. // Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
  150. repeated string ancestors = 10;
  151. }
  152. // A representation of a Google Cloud resource.
  153. message Resource {
  154. // The API version. Example: `v1`
  155. string version = 1;
  156. // The URL of the discovery document containing the resource's JSON schema.
  157. // Example:
  158. // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
  159. //
  160. // This value is unspecified for resources that do not have an API based on a
  161. // discovery document, such as Cloud Bigtable.
  162. string discovery_document_uri = 2;
  163. // The JSON schema name listed in the discovery document. Example:
  164. // `Project`
  165. //
  166. // This value is unspecified for resources that do not have an API based on a
  167. // discovery document, such as Cloud Bigtable.
  168. string discovery_name = 3;
  169. // The REST URL for accessing the resource. An HTTP `GET` request using this
  170. // URL returns the resource itself. Example:
  171. // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
  172. //
  173. // This value is unspecified for resources without a REST API.
  174. string resource_url = 4;
  175. // The full name of the immediate parent of this resource. See
  176. // [Resource
  177. // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  178. // for more information.
  179. //
  180. // For Google Cloud assets, this value is the parent resource defined in the
  181. // [Cloud IAM policy
  182. // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
  183. // Example:
  184. // `//cloudresourcemanager.googleapis.com/projects/my_project_123`
  185. //
  186. // For third-party assets, this field may be set differently.
  187. string parent = 5;
  188. // The content of the resource, in which some sensitive fields are removed
  189. // and may not be present.
  190. google.protobuf.Struct data = 6;
  191. // The location of the resource in Google Cloud, such as its zone and region.
  192. // For more information, see https://cloud.google.com/about/locations/.
  193. string location = 8;
  194. }
  195. // DEPRECATED. This message only presents for the purpose of
  196. // backward-compatibility. The server will never populate this message in
  197. // responses.
  198. // The detailed related assets with the `relationship_type`.
  199. message RelatedAssets {
  200. option deprecated = true;
  201. // The detailed relationship attributes.
  202. RelationshipAttributes relationship_attributes = 1;
  203. // The peer resources of the relationship.
  204. repeated RelatedAsset assets = 2;
  205. }
  206. // DEPRECATED. This message only presents for the purpose of
  207. // backward-compatibility. The server will never populate this message in
  208. // responses.
  209. // The relationship attributes which include `type`, `source_resource_type`,
  210. // `target_resource_type` and `action`.
  211. message RelationshipAttributes {
  212. option deprecated = true;
  213. // The unique identifier of the relationship type. Example:
  214. // `INSTANCE_TO_INSTANCEGROUP`
  215. string type = 4;
  216. // The source asset type. Example: `compute.googleapis.com/Instance`
  217. string source_resource_type = 1;
  218. // The target asset type. Example: `compute.googleapis.com/Disk`
  219. string target_resource_type = 2;
  220. // The detail of the relationship, e.g. `contains`, `attaches`
  221. string action = 3;
  222. }
  223. // An asset identifier in Google Cloud which contains its name, type and
  224. // ancestors. An asset can be any resource in the Google Cloud [resource
  225. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  226. // a resource outside the Google Cloud resource hierarchy (such as Google
  227. // Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
  228. // See [Supported asset
  229. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  230. // for more information.
  231. message RelatedAsset {
  232. // The full name of the asset. Example:
  233. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
  234. //
  235. // See [Resource
  236. // names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
  237. // for more information.
  238. string asset = 1 [(google.api.resource_reference) = {
  239. type: "cloudasset.googleapis.com/Asset"
  240. }];
  241. // The type of the asset. Example: `compute.googleapis.com/Disk`
  242. //
  243. // See [Supported asset
  244. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
  245. // for more information.
  246. string asset_type = 2;
  247. // The ancestors of an asset in Google Cloud [resource
  248. // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
  249. // represented as a list of relative resource names. An ancestry path starts
  250. // with the closest ancestor in the hierarchy and ends at root.
  251. //
  252. // Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
  253. repeated string ancestors = 3;
  254. // The unique identifier of the relationship type. Example:
  255. // `INSTANCE_TO_INSTANCEGROUP`
  256. string relationship_type = 4;
  257. }
  258. // A result of Resource Search, containing information of a cloud resource.
  259. // Next ID: 31
  260. message ResourceSearchResult {
  261. // The full resource name of this resource. Example:
  262. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
  263. // See [Cloud Asset Inventory Resource Name
  264. // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
  265. // for more information.
  266. //
  267. // To search against the `name`:
  268. //
  269. // * Use a field query. Example: `name:instance1`
  270. // * Use a free text query. Example: `instance1`
  271. string name = 1;
  272. // The type of this resource. Example: `compute.googleapis.com/Disk`.
  273. //
  274. // To search against the `asset_type`:
  275. //
  276. // * Specify the `asset_type` field in your search request.
  277. string asset_type = 2;
  278. // The project that this resource belongs to, in the form of
  279. // projects/{PROJECT_NUMBER}. This field is available when the resource
  280. // belongs to a project.
  281. //
  282. // To search against `project`:
  283. //
  284. // * Use a field query. Example: `project:12345`
  285. // * Use a free text query. Example: `12345`
  286. // * Specify the `scope` field as this project in your search request.
  287. string project = 3;
  288. // The folder(s) that this resource belongs to, in the form of
  289. // folders/{FOLDER_NUMBER}. This field is available when the resource
  290. // belongs to one or more folders.
  291. //
  292. // To search against `folders`:
  293. //
  294. // * Use a field query. Example: `folders:(123 OR 456)`
  295. // * Use a free text query. Example: `123`
  296. // * Specify the `scope` field as this folder in your search request.
  297. repeated string folders = 17;
  298. // The organization that this resource belongs to, in the form of
  299. // organizations/{ORGANIZATION_NUMBER}. This field is available when the
  300. // resource belongs to an organization.
  301. //
  302. // To search against `organization`:
  303. //
  304. // * Use a field query. Example: `organization:123`
  305. // * Use a free text query. Example: `123`
  306. // * Specify the `scope` field as this organization in your search request.
  307. string organization = 18;
  308. // The display name of this resource. This field is available only when the
  309. // resource's Protobuf contains it.
  310. //
  311. // To search against the `display_name`:
  312. //
  313. // * Use a field query. Example: `displayName:"My Instance"`
  314. // * Use a free text query. Example: `"My Instance"`
  315. string display_name = 4;
  316. // One or more paragraphs of text description of this resource. Maximum length
  317. // could be up to 1M bytes. This field is available only when the resource's
  318. // Protobuf contains it.
  319. //
  320. // To search against the `description`:
  321. //
  322. // * Use a field query. Example: `description:"important instance"`
  323. // * Use a free text query. Example: `"important instance"`
  324. string description = 5;
  325. // Location can be `global`, regional like `us-east1`, or zonal like
  326. // `us-west1-b`. This field is available only when the resource's Protobuf
  327. // contains it.
  328. //
  329. // To search against the `location`:
  330. //
  331. // * Use a field query. Example: `location:us-west*`
  332. // * Use a free text query. Example: `us-west*`
  333. string location = 6;
  334. // Labels associated with this resource. See [Labelling and grouping GCP
  335. // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
  336. // for more information. This field is available only when the resource's
  337. // Protobuf contains it.
  338. //
  339. // To search against the `labels`:
  340. //
  341. // * Use a field query:
  342. // - query on any label's key or value. Example: `labels:prod`
  343. // - query by a given label. Example: `labels.env:prod`
  344. // - query by a given label's existence. Example: `labels.env:*`
  345. // * Use a free text query. Example: `prod`
  346. map<string, string> labels = 7;
  347. // Network tags associated with this resource. Like labels, network tags are a
  348. // type of annotations used to group GCP resources. See [Labelling GCP
  349. // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
  350. // for more information. This field is available only when the resource's
  351. // Protobuf contains it.
  352. //
  353. // To search against the `network_tags`:
  354. //
  355. // * Use a field query. Example: `networkTags:internal`
  356. // * Use a free text query. Example: `internal`
  357. repeated string network_tags = 8;
  358. // The Cloud KMS
  359. // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys)
  360. // name or
  361. // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions)
  362. // name.
  363. //
  364. // This field only presents for the purpose of backward compatibility. Please
  365. // use the `kms_keys` field to retrieve KMS key information. This field is
  366. // available only when the resource's Protobuf contains it and will only be
  367. // populated for [these resource
  368. // types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field)
  369. // for backward compatible purposes.
  370. //
  371. // To search against the `kms_key`:
  372. //
  373. // * Use a field query. Example: `kmsKey:key`
  374. // * Use a free text query. Example: `key`
  375. string kms_key = 10 [deprecated = true];
  376. // The Cloud KMS
  377. // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys)
  378. // names or
  379. // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions)
  380. // names. This field is available only when the resource's Protobuf contains
  381. // it.
  382. //
  383. // To search against the `kms_keys`:
  384. //
  385. // * Use a field query. Example: `kmsKeys:key`
  386. // * Use a free text query. Example: `key`
  387. repeated string kms_keys = 28;
  388. // The create timestamp of this resource, at which the resource was created.
  389. // The granularity is in seconds. Timestamp.nanos will always be 0. This field
  390. // is available only when the resource's Protobuf contains it.
  391. //
  392. // To search against `create_time`:
  393. //
  394. // * Use a field query.
  395. // - value in seconds since unix epoch. Example: `createTime > 1609459200`
  396. // - value in date string. Example: `createTime > 2021-01-01`
  397. // - value in date-time string (must be quoted). Example: `createTime >
  398. // "2021-01-01T00:00:00"`
  399. google.protobuf.Timestamp create_time = 11;
  400. // The last update timestamp of this resource, at which the resource was last
  401. // modified or deleted. The granularity is in seconds. Timestamp.nanos will
  402. // always be 0. This field is available only when the resource's Protobuf
  403. // contains it.
  404. //
  405. // To search against `update_time`:
  406. //
  407. // * Use a field query.
  408. // - value in seconds since unix epoch. Example: `updateTime < 1609459200`
  409. // - value in date string. Example: `updateTime < 2021-01-01`
  410. // - value in date-time string (must be quoted). Example: `updateTime <
  411. // "2021-01-01T00:00:00"`
  412. google.protobuf.Timestamp update_time = 12;
  413. // The state of this resource. Different resources types have different state
  414. // definitions that are mapped from various fields of different resource
  415. // types. This field is available only when the resource's Protobuf contains
  416. // it.
  417. //
  418. // Example:
  419. // If the resource is an instance provided by Compute Engine,
  420. // its state will include PROVISIONING, STAGING, RUNNING, STOPPING,
  421. // SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition
  422. // in [API
  423. // Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances).
  424. // If the resource is a project provided by Cloud Resource Manager, its state
  425. // will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and
  426. // DELETE_IN_PROGRESS. See `lifecycleState` definition in [API
  427. // Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects).
  428. //
  429. // To search against the `state`:
  430. //
  431. // * Use a field query. Example: `state:RUNNING`
  432. // * Use a free text query. Example: `RUNNING`
  433. string state = 13;
  434. // The additional searchable attributes of this resource. The attributes may
  435. // vary from one resource type to another. Examples: `projectId` for Project,
  436. // `dnsName` for DNS ManagedZone. This field contains a subset of the resource
  437. // metadata fields that are returned by the List or Get APIs provided by the
  438. // corresponding GCP service (e.g., Compute Engine). see [API references and
  439. // supported searchable
  440. // attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types)
  441. // to see which fields are included.
  442. //
  443. // You can search values of these fields through free text search. However,
  444. // you should not consume the field programically as the field names and
  445. // values may change as the GCP service updates to a new incompatible API
  446. // version.
  447. //
  448. // To search against the `additional_attributes`:
  449. //
  450. // * Use a free text query to match the attributes values. Example: to search
  451. // `additional_attributes = { dnsName: "foobar" }`, you can issue a query
  452. // `foobar`.
  453. google.protobuf.Struct additional_attributes = 9;
  454. // The full resource name of this resource's parent, if it has one.
  455. // To search against the `parent_full_resource_name`:
  456. //
  457. // * Use a field query. Example:
  458. // `parentFullResourceName:"project-name"`
  459. // * Use a free text query. Example:
  460. // `project-name`
  461. string parent_full_resource_name = 19;
  462. // Versioned resource representations of this resource. This is repeated
  463. // because there could be multiple versions of resource representations during
  464. // version migration.
  465. //
  466. // This `versioned_resources` field is not searchable. Some attributes of the
  467. // resource representations are exposed in `additional_attributes` field, so
  468. // as to allow users to search on them.
  469. repeated VersionedResource versioned_resources = 16;
  470. // Attached resources of this resource. For example, an OSConfig
  471. // Inventory is an attached resource of a Compute Instance. This field is
  472. // repeated because a resource could have multiple attached resources.
  473. //
  474. // This `attached_resources` field is not searchable. Some attributes
  475. // of the attached resources are exposed in `additional_attributes` field, so
  476. // as to allow users to search on them.
  477. repeated AttachedResource attached_resources = 20;
  478. // A map of related resources of this resource, keyed by the
  479. // relationship type. A relationship type is in the format of
  480. // {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
  481. // `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
  482. // See [supported relationship
  483. // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
  484. map<string, RelatedResources> relationships = 21;
  485. // TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}.
  486. // To search against the `tagKeys`:
  487. //
  488. // * Use a field query. Example:
  489. // - `tagKeys:"123456789/env*"`
  490. // - `tagKeys="123456789/env"`
  491. // - `tagKeys:"env"`
  492. //
  493. // * Use a free text query. Example:
  494. // - `env`
  495. repeated string tag_keys = 23;
  496. // TagValue namespaced names, in the format of
  497. // {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}.
  498. // To search against the `tagValues`:
  499. //
  500. // * Use a field query. Example:
  501. // - `tagValues:"env"`
  502. // - `tagValues:"env/prod"`
  503. // - `tagValues:"123456789/env/prod*"`
  504. // - `tagValues="123456789/env/prod"`
  505. //
  506. // * Use a free text query. Example:
  507. // - `prod`
  508. repeated string tag_values = 25;
  509. // TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}.
  510. // To search against the `tagValueIds`:
  511. //
  512. // * Use a field query. Example:
  513. // - `tagValueIds:"456"`
  514. // - `tagValueIds="tagValues/456"`
  515. //
  516. // * Use a free text query. Example:
  517. // - `456`
  518. repeated string tag_value_ids = 26;
  519. // The type of this resource's immediate parent, if there is one.
  520. //
  521. // To search against the `parent_asset_type`:
  522. //
  523. // * Use a field query. Example:
  524. // `parentAssetType:"cloudresourcemanager.googleapis.com/Project"`
  525. // * Use a free text query. Example:
  526. // `cloudresourcemanager.googleapis.com/Project`
  527. string parent_asset_type = 103;
  528. }
  529. // Resource representation as defined by the corresponding service providing the
  530. // resource for a given API version.
  531. message VersionedResource {
  532. // API version of the resource.
  533. //
  534. // Example:
  535. // If the resource is an instance provided by Compute Engine v1 API as defined
  536. // in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`,
  537. // version will be "v1".
  538. string version = 1;
  539. // JSON representation of the resource as defined by the corresponding
  540. // service providing this resource.
  541. //
  542. // Example:
  543. // If the resource is an instance provided by Compute Engine, this field will
  544. // contain the JSON representation of the instance as defined by Compute
  545. // Engine:
  546. // `https://cloud.google.com/compute/docs/reference/rest/v1/instances`.
  547. //
  548. // You can find the resource definition for each supported resource type in
  549. // this table:
  550. // `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types`
  551. google.protobuf.Struct resource = 2;
  552. }
  553. // Attached resource representation, which is defined by the corresponding
  554. // service provider. It represents an attached resource's payload.
  555. message AttachedResource {
  556. // The type of this attached resource.
  557. //
  558. // Example: `osconfig.googleapis.com/Inventory`
  559. //
  560. // You can find the supported attached asset types of each resource in this
  561. // table:
  562. // `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types`
  563. string asset_type = 1;
  564. // Versioned resource representations of this attached resource. This is
  565. // repeated because there could be multiple versions of the attached resource
  566. // representations during version migration.
  567. repeated VersionedResource versioned_resources = 3;
  568. }
  569. // The related resources of the primary resource.
  570. message RelatedResources {
  571. // The detailed related resources of the primary resource.
  572. repeated RelatedResource related_resources = 1;
  573. }
  574. // The detailed related resource.
  575. message RelatedResource {
  576. // The type of the asset. Example: `compute.googleapis.com/Instance`
  577. string asset_type = 1;
  578. // The full resource name of the related resource. Example:
  579. // `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
  580. string full_resource_name = 2;
  581. }
  582. // A result of IAM Policy search, containing information of an IAM policy.
  583. message IamPolicySearchResult {
  584. // Explanation about the IAM policy search result.
  585. message Explanation {
  586. // IAM permissions
  587. message Permissions {
  588. // A list of permissions. A sample permission string: `compute.disk.get`.
  589. repeated string permissions = 1;
  590. }
  591. // The map from roles to their included permissions that match the
  592. // permission query (i.e., a query containing `policy.role.permissions:`).
  593. // Example: if query `policy.role.permissions:compute.disk.get`
  594. // matches a policy binding that contains owner role, the
  595. // matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The
  596. // roles can also be found in the returned `policy` bindings. Note that the
  597. // map is populated only for requests with permission queries.
  598. map<string, Permissions> matched_permissions = 1;
  599. }
  600. // The full resource name of the resource associated with this IAM policy.
  601. // Example:
  602. // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
  603. // See [Cloud Asset Inventory Resource Name
  604. // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
  605. // for more information.
  606. //
  607. // To search against the `resource`:
  608. //
  609. // * use a field query. Example: `resource:organizations/123`
  610. string resource = 1;
  611. // The type of the resource associated with this IAM policy. Example:
  612. // `compute.googleapis.com/Disk`.
  613. //
  614. // To search against the `asset_type`:
  615. //
  616. // * specify the `asset_types` field in your search request.
  617. string asset_type = 5;
  618. // The project that the associated GCP resource belongs to, in the form of
  619. // projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM
  620. // instance, Cloud Storage bucket), the project field will indicate the
  621. // project that contains the resource. If an IAM policy is set on a folder or
  622. // orgnization, this field will be empty.
  623. //
  624. // To search against the `project`:
  625. //
  626. // * specify the `scope` field as this project in your search request.
  627. string project = 2;
  628. // The folder(s) that the IAM policy belongs to, in the form of
  629. // folders/{FOLDER_NUMBER}. This field is available when the IAM policy
  630. // belongs to one or more folders.
  631. //
  632. // To search against `folders`:
  633. //
  634. // * use a field query. Example: `folders:(123 OR 456)`
  635. // * use a free text query. Example: `123`
  636. // * specify the `scope` field as this folder in your search request.
  637. repeated string folders = 6;
  638. // The organization that the IAM policy belongs to, in the form
  639. // of organizations/{ORGANIZATION_NUMBER}. This field is available when the
  640. // IAM policy belongs to an organization.
  641. //
  642. // To search against `organization`:
  643. //
  644. // * use a field query. Example: `organization:123`
  645. // * use a free text query. Example: `123`
  646. // * specify the `scope` field as this organization in your search request.
  647. string organization = 7;
  648. // The IAM policy directly set on the given resource. Note that the original
  649. // IAM policy can contain multiple bindings. This only contains the bindings
  650. // that match the given query. For queries that don't contain a constrain on
  651. // policies (e.g., an empty query), this contains all the bindings.
  652. //
  653. // To search against the `policy` bindings:
  654. //
  655. // * use a field query:
  656. // - query by the policy contained members. Example:
  657. // `policy:amy@gmail.com`
  658. // - query by the policy contained roles. Example:
  659. // `policy:roles/compute.admin`
  660. // - query by the policy contained roles' included permissions. Example:
  661. // `policy.role.permissions:compute.instances.create`
  662. google.iam.v1.Policy policy = 3;
  663. // Explanation about the IAM policy search result. It contains additional
  664. // information to explain why the search result matches the query.
  665. Explanation explanation = 4;
  666. }
  667. // Represents the detailed state of an entity under analysis, such as a
  668. // resource, an identity or an access.
  669. message IamPolicyAnalysisState {
  670. // The Google standard error code that best describes the state.
  671. // For example:
  672. // - OK means the analysis on this entity has been successfully finished;
  673. // - PERMISSION_DENIED means an access denied error is encountered;
  674. // - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started
  675. // in time;
  676. google.rpc.Code code = 1;
  677. // The human-readable description of the cause of failure.
  678. string cause = 2;
  679. }
  680. // The Condition evaluation.
  681. message ConditionEvaluation {
  682. // Value of this expression.
  683. enum EvaluationValue {
  684. // Reserved for future use.
  685. EVALUATION_VALUE_UNSPECIFIED = 0;
  686. // The evaluation result is `true`.
  687. TRUE = 1;
  688. // The evaluation result is `false`.
  689. FALSE = 2;
  690. // The evaluation result is `conditional` when the condition expression
  691. // contains variables that are either missing input values or have not been
  692. // supported by Analyzer yet.
  693. CONDITIONAL = 3;
  694. }
  695. // The evaluation result.
  696. EvaluationValue evaluation_value = 1;
  697. }
  698. // IAM Policy analysis result, consisting of one IAM policy binding and derived
  699. // access control lists.
  700. message IamPolicyAnalysisResult {
  701. // A Google Cloud resource under analysis.
  702. message Resource {
  703. // The [full resource
  704. // name](https://cloud.google.com/asset-inventory/docs/resource-name-format)
  705. string full_resource_name = 1;
  706. // The analysis state of this resource.
  707. IamPolicyAnalysisState analysis_state = 2;
  708. }
  709. // An IAM role or permission under analysis.
  710. message Access {
  711. oneof oneof_access {
  712. // The role.
  713. string role = 1;
  714. // The permission.
  715. string permission = 2;
  716. }
  717. // The analysis state of this access.
  718. IamPolicyAnalysisState analysis_state = 3;
  719. }
  720. // An identity under analysis.
  721. message Identity {
  722. // The identity name in any form of members appear in
  723. // [IAM policy
  724. // binding](https://cloud.google.com/iam/reference/rest/v1/Binding), such
  725. // as:
  726. // - user:foo@google.com
  727. // - group:group1@google.com
  728. // - serviceAccount:s1@prj1.iam.gserviceaccount.com
  729. // - projectOwner:some_project_id
  730. // - domain:google.com
  731. // - allUsers
  732. // - etc.
  733. string name = 1;
  734. // The analysis state of this identity.
  735. IamPolicyAnalysisState analysis_state = 2;
  736. }
  737. // A directional edge.
  738. message Edge {
  739. // The source node of the edge. For example, it could be a full resource
  740. // name for a resource node or an email of an identity.
  741. string source_node = 1;
  742. // The target node of the edge. For example, it could be a full resource
  743. // name for a resource node or an email of an identity.
  744. string target_node = 2;
  745. }
  746. // An access control list, derived from the above IAM policy binding, which
  747. // contains a set of resources and accesses. May include one
  748. // item from each set to compose an access control entry.
  749. //
  750. // NOTICE that there could be multiple access control lists for one IAM policy
  751. // binding. The access control lists are created based on resource and access
  752. // combinations.
  753. //
  754. // For example, assume we have the following cases in one IAM policy binding:
  755. // - Permission P1 and P2 apply to resource R1 and R2;
  756. // - Permission P3 applies to resource R2 and R3;
  757. //
  758. // This will result in the following access control lists:
  759. // - AccessControlList 1: [R1, R2], [P1, P2]
  760. // - AccessControlList 2: [R2, R3], [P3]
  761. message AccessControlList {
  762. // The resources that match one of the following conditions:
  763. // - The resource_selector, if it is specified in request;
  764. // - Otherwise, resources reachable from the policy attached resource.
  765. repeated Resource resources = 1;
  766. // The accesses that match one of the following conditions:
  767. // - The access_selector, if it is specified in request;
  768. // - Otherwise, access specifiers reachable from the policy binding's role.
  769. repeated Access accesses = 2;
  770. // Resource edges of the graph starting from the policy attached
  771. // resource to any descendant resources. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] contains
  772. // the full resource name of a parent resource and [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node]
  773. // contains the full resource name of a child resource. This field is
  774. // present only if the output_resource_edges option is enabled in request.
  775. repeated Edge resource_edges = 3;
  776. // Condition evaluation for this AccessControlList, if there is a condition
  777. // defined in the above IAM policy binding.
  778. ConditionEvaluation condition_evaluation = 4;
  779. }
  780. // The identities and group edges.
  781. message IdentityList {
  782. // Only the identities that match one of the following conditions will be
  783. // presented:
  784. // - The identity_selector, if it is specified in request;
  785. // - Otherwise, identities reachable from the policy binding's members.
  786. repeated Identity identities = 1;
  787. // Group identity edges of the graph starting from the binding's
  788. // group members to any node of the [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node]
  789. // contains a group, such as `group:parent@google.com`. The
  790. // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] contains a member of the group,
  791. // such as `group:child@google.com` or `user:foo@google.com`.
  792. // This field is present only if the output_group_edges option is enabled in
  793. // request.
  794. repeated Edge group_edges = 2;
  795. }
  796. // The [full resource
  797. // name](https://cloud.google.com/asset-inventory/docs/resource-name-format)
  798. // of the resource to which the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] policy attaches.
  799. string attached_resource_full_name = 1;
  800. // The Cloud IAM policy binding under analysis.
  801. google.iam.v1.Binding iam_binding = 2;
  802. // The access control lists derived from the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or
  803. // potentially match resource and access selectors specified in the request.
  804. repeated AccessControlList access_control_lists = 3;
  805. // The identity list derived from members of the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or
  806. // potentially match identity selector specified in the request.
  807. IdentityList identity_list = 4;
  808. // Represents whether all analyses on the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] have successfully
  809. // finished.
  810. bool fully_explored = 5;
  811. }