assets.proto 30 KB

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