securitycenter_service.proto 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. // Copyright 2020 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.securitycenter.v1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/securitycenter/v1beta1/asset.proto";
  21. import "google/cloud/securitycenter/v1beta1/finding.proto";
  22. import "google/cloud/securitycenter/v1beta1/organization_settings.proto";
  23. import "google/cloud/securitycenter/v1beta1/security_marks.proto";
  24. import "google/cloud/securitycenter/v1beta1/source.proto";
  25. import "google/iam/v1/iam_policy.proto";
  26. import "google/iam/v1/policy.proto";
  27. import "google/longrunning/operations.proto";
  28. import "google/protobuf/duration.proto";
  29. import "google/protobuf/field_mask.proto";
  30. import "google/protobuf/struct.proto";
  31. import "google/protobuf/timestamp.proto";
  32. option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter";
  33. option java_multiple_files = true;
  34. option java_package = "com.google.cloud.securitycenter.v1beta1";
  35. // V1 Beta APIs for Security Center service.
  36. service SecurityCenter {
  37. option (google.api.default_host) = "securitycenter.googleapis.com";
  38. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  39. // Creates a source.
  40. rpc CreateSource(CreateSourceRequest) returns (Source) {
  41. option (google.api.http) = {
  42. post: "/v1beta1/{parent=organizations/*}/sources"
  43. body: "source"
  44. };
  45. option (google.api.method_signature) = "parent,source";
  46. }
  47. // Creates a finding. The corresponding source must exist for finding creation
  48. // to succeed.
  49. rpc CreateFinding(CreateFindingRequest) returns (Finding) {
  50. option (google.api.http) = {
  51. post: "/v1beta1/{parent=organizations/*/sources/*}/findings"
  52. body: "finding"
  53. };
  54. option (google.api.method_signature) = "parent,finding_id,finding";
  55. }
  56. // Gets the access control policy on the specified Source.
  57. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  58. option (google.api.http) = {
  59. post: "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy"
  60. body: "*"
  61. };
  62. option (google.api.method_signature) = "resource";
  63. }
  64. // Gets the settings for an organization.
  65. rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) {
  66. option (google.api.http) = {
  67. get: "/v1beta1/{name=organizations/*/organizationSettings}"
  68. };
  69. option (google.api.method_signature) = "name";
  70. }
  71. // Gets a source.
  72. rpc GetSource(GetSourceRequest) returns (Source) {
  73. option (google.api.http) = {
  74. get: "/v1beta1/{name=organizations/*/sources/*}"
  75. };
  76. option (google.api.method_signature) = "name";
  77. }
  78. // Filters an organization's assets and groups them by their specified
  79. // properties.
  80. rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) {
  81. option (google.api.http) = {
  82. post: "/v1beta1/{parent=organizations/*}/assets:group"
  83. body: "*"
  84. };
  85. }
  86. // Filters an organization or source's findings and groups them by their
  87. // specified properties.
  88. //
  89. // To group across all sources provide a `-` as the source id.
  90. // Example: /v1beta1/organizations/{organization_id}/sources/-/findings
  91. rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) {
  92. option (google.api.http) = {
  93. post: "/v1beta1/{parent=organizations/*/sources/*}/findings:group"
  94. body: "*"
  95. };
  96. option (google.api.method_signature) = "parent,group_by";
  97. }
  98. // Lists an organization's assets.
  99. rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) {
  100. option (google.api.http) = {
  101. get: "/v1beta1/{parent=organizations/*}/assets"
  102. };
  103. }
  104. // Lists an organization or source's findings.
  105. //
  106. // To list across all sources provide a `-` as the source id.
  107. // Example: /v1beta1/organizations/{organization_id}/sources/-/findings
  108. rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) {
  109. option (google.api.http) = {
  110. get: "/v1beta1/{parent=organizations/*/sources/*}/findings"
  111. };
  112. }
  113. // Lists all sources belonging to an organization.
  114. rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) {
  115. option (google.api.http) = {
  116. get: "/v1beta1/{parent=organizations/*}/sources"
  117. };
  118. option (google.api.method_signature) = "parent";
  119. }
  120. // Runs asset discovery. The discovery is tracked with a long-running
  121. // operation.
  122. //
  123. // This API can only be called with limited frequency for an organization. If
  124. // it is called too frequently the caller will receive a TOO_MANY_REQUESTS
  125. // error.
  126. rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) {
  127. option (google.api.http) = {
  128. post: "/v1beta1/{parent=organizations/*}/assets:runDiscovery"
  129. body: "*"
  130. };
  131. option (google.api.method_signature) = "parent";
  132. option (google.longrunning.operation_info) = {
  133. response_type: "google.protobuf.Empty"
  134. metadata_type: "google.protobuf.Empty"
  135. };
  136. }
  137. // Updates the state of a finding.
  138. rpc SetFindingState(SetFindingStateRequest) returns (Finding) {
  139. option (google.api.http) = {
  140. post: "/v1beta1/{name=organizations/*/sources/*/findings/*}:setState"
  141. body: "*"
  142. };
  143. option (google.api.method_signature) = "name,state,start_time";
  144. }
  145. // Sets the access control policy on the specified Source.
  146. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  147. option (google.api.http) = {
  148. post: "/v1beta1/{resource=organizations/*/sources/*}:setIamPolicy"
  149. body: "*"
  150. };
  151. option (google.api.method_signature) = "resource,policy";
  152. }
  153. // Returns the permissions that a caller has on the specified source.
  154. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  155. option (google.api.http) = {
  156. post: "/v1beta1/{resource=organizations/*/sources/*}:testIamPermissions"
  157. body: "*"
  158. };
  159. option (google.api.method_signature) = "resource,permissions";
  160. }
  161. // Creates or updates a finding. The corresponding source must exist for a
  162. // finding creation to succeed.
  163. rpc UpdateFinding(UpdateFindingRequest) returns (Finding) {
  164. option (google.api.http) = {
  165. patch: "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}"
  166. body: "finding"
  167. };
  168. option (google.api.method_signature) = "finding";
  169. }
  170. // Updates an organization's settings.
  171. rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) {
  172. option (google.api.http) = {
  173. patch: "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}"
  174. body: "organization_settings"
  175. };
  176. option (google.api.method_signature) = "organization_settings";
  177. }
  178. // Updates a source.
  179. rpc UpdateSource(UpdateSourceRequest) returns (Source) {
  180. option (google.api.http) = {
  181. patch: "/v1beta1/{source.name=organizations/*/sources/*}"
  182. body: "source"
  183. };
  184. option (google.api.method_signature) = "source";
  185. }
  186. // Updates security marks.
  187. rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) {
  188. option (google.api.http) = {
  189. patch: "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}"
  190. body: "security_marks"
  191. additional_bindings {
  192. patch: "/v1beta1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}"
  193. body: "security_marks"
  194. }
  195. };
  196. option (google.api.method_signature) = "security_marks";
  197. }
  198. }
  199. // Request message for creating a finding.
  200. message CreateFindingRequest {
  201. // Required. Resource name of the new finding's parent. Its format should be
  202. // "organizations/[organization_id]/sources/[source_id]".
  203. string parent = 1 [
  204. (google.api.field_behavior) = REQUIRED,
  205. (google.api.resource_reference) = {
  206. type: "securitycenter.googleapis.com/Source"
  207. }
  208. ];
  209. // Required. Unique identifier provided by the client within the parent scope.
  210. // It must be alphanumeric and less than or equal to 32 characters and
  211. // greater than 0 characters in length.
  212. string finding_id = 2 [(google.api.field_behavior) = REQUIRED];
  213. // Required. The Finding being created. The name and security_marks will be ignored as
  214. // they are both output only fields on this resource.
  215. Finding finding = 3 [(google.api.field_behavior) = REQUIRED];
  216. }
  217. // Request message for creating a source.
  218. message CreateSourceRequest {
  219. // Required. Resource name of the new source's parent. Its format should be
  220. // "organizations/[organization_id]".
  221. string parent = 1 [
  222. (google.api.field_behavior) = REQUIRED,
  223. (google.api.resource_reference) = {
  224. type: "cloudresourcemanager.googleapis.com/Organization"
  225. }
  226. ];
  227. // Required. The Source being created, only the display_name and description will be
  228. // used. All other fields will be ignored.
  229. Source source = 2 [(google.api.field_behavior) = REQUIRED];
  230. }
  231. // Request message for getting organization settings.
  232. message GetOrganizationSettingsRequest {
  233. // Required. Name of the organization to get organization settings for. Its format is
  234. // "organizations/[organization_id]/organizationSettings".
  235. string name = 1 [
  236. (google.api.field_behavior) = REQUIRED,
  237. (google.api.resource_reference) = {
  238. type: "securitycenter.googleapis.com/OrganizationSettings"
  239. }
  240. ];
  241. }
  242. // Request message for getting a source.
  243. message GetSourceRequest {
  244. // Required. Relative resource name of the source. Its format is
  245. // "organizations/[organization_id]/source/[source_id]".
  246. string name = 1 [
  247. (google.api.field_behavior) = REQUIRED,
  248. (google.api.resource_reference) = {
  249. type: "securitycenter.googleapis.com/Source"
  250. }
  251. ];
  252. }
  253. // Request message for grouping by assets.
  254. message GroupAssetsRequest {
  255. // Required. Name of the organization to groupBy. Its format is
  256. // "organizations/[organization_id]".
  257. string parent = 1 [
  258. (google.api.field_behavior) = REQUIRED,
  259. (google.api.resource_reference) = {
  260. type: "cloudresourcemanager.googleapis.com/Organization"
  261. }
  262. ];
  263. // Expression that defines the filter to apply across assets.
  264. // The expression is a list of zero or more restrictions combined via logical
  265. // operators `AND` and `OR`.
  266. // Parentheses are not supported, and `OR` has higher precedence than `AND`.
  267. //
  268. // Restrictions have the form `<field> <operator> <value>` and may have a `-`
  269. // character in front of them to indicate negation. The fields map to those
  270. // defined in the Asset resource. Examples include:
  271. //
  272. // * name
  273. // * security_center_properties.resource_name
  274. // * resource_properties.a_property
  275. // * security_marks.marks.marka
  276. //
  277. // The supported operators are:
  278. //
  279. // * `=` for all value types.
  280. // * `>`, `<`, `>=`, `<=` for integer values.
  281. // * `:`, meaning substring matching, for strings.
  282. //
  283. // The supported value types are:
  284. //
  285. // * string literals in quotes.
  286. // * integer literals without quotes.
  287. // * boolean literals `true` and `false` without quotes.
  288. //
  289. // For example, `resource_properties.size = 100` is a valid filter string.
  290. string filter = 2;
  291. // Required. Expression that defines what assets fields to use for grouping. The string
  292. // value should follow SQL syntax: comma separated list of fields. For
  293. // example:
  294. // "security_center_properties.resource_project,security_center_properties.project".
  295. //
  296. // The following fields are supported when compare_duration is not set:
  297. //
  298. // * security_center_properties.resource_project
  299. // * security_center_properties.resource_type
  300. // * security_center_properties.resource_parent
  301. //
  302. // The following fields are supported when compare_duration is set:
  303. //
  304. // * security_center_properties.resource_type
  305. string group_by = 3 [(google.api.field_behavior) = REQUIRED];
  306. // When compare_duration is set, the Asset's "state" property is updated to
  307. // indicate whether the asset was added, removed, or remained present during
  308. // the compare_duration period of time that precedes the read_time. This is
  309. // the time between (read_time - compare_duration) and read_time.
  310. //
  311. // The state value is derived based on the presence of the asset at the two
  312. // points in time. Intermediate state changes between the two times don't
  313. // affect the result. For example, the results aren't affected if the asset is
  314. // removed and re-created again.
  315. //
  316. // Possible "state" values when compare_duration is specified:
  317. //
  318. // * "ADDED": indicates that the asset was not present before
  319. // compare_duration, but present at reference_time.
  320. // * "REMOVED": indicates that the asset was present at the start of
  321. // compare_duration, but not present at reference_time.
  322. // * "ACTIVE": indicates that the asset was present at both the
  323. // start and the end of the time period defined by
  324. // compare_duration and reference_time.
  325. //
  326. // This field is ignored if `state` is not a field in `group_by`.
  327. google.protobuf.Duration compare_duration = 4;
  328. // Time used as a reference point when filtering assets. The filter is limited
  329. // to assets existing at the supplied time and their values are those at that
  330. // specific time. Absence of this field will default to the API's version of
  331. // NOW.
  332. google.protobuf.Timestamp read_time = 5;
  333. // The value returned by the last `GroupAssetsResponse`; indicates
  334. // that this is a continuation of a prior `GroupAssets` call, and that the
  335. // system should return the next page of data.
  336. string page_token = 7;
  337. // The maximum number of results to return in a single response. Default is
  338. // 10, minimum is 1, maximum is 1000.
  339. int32 page_size = 8;
  340. }
  341. // Response message for grouping by assets.
  342. message GroupAssetsResponse {
  343. // Group results. There exists an element for each existing unique
  344. // combination of property/values. The element contains a count for the number
  345. // of times those specific property/values appear.
  346. repeated GroupResult group_by_results = 1;
  347. // Time used for executing the groupBy request.
  348. google.protobuf.Timestamp read_time = 2;
  349. // Token to retrieve the next page of results, or empty if there are no more
  350. // results.
  351. string next_page_token = 3;
  352. }
  353. // Request message for grouping by findings.
  354. message GroupFindingsRequest {
  355. // Required. Name of the source to groupBy. Its format is
  356. // "organizations/[organization_id]/sources/[source_id]". To groupBy across
  357. // all sources provide a source_id of `-`. For example:
  358. // organizations/{organization_id}/sources/-
  359. string parent = 1 [
  360. (google.api.field_behavior) = REQUIRED,
  361. (google.api.resource_reference) = {
  362. type: "securitycenter.googleapis.com/Source"
  363. }
  364. ];
  365. // Expression that defines the filter to apply across findings.
  366. // The expression is a list of one or more restrictions combined via logical
  367. // operators `AND` and `OR`.
  368. // Parentheses are not supported, and `OR` has higher precedence than `AND`.
  369. //
  370. // Restrictions have the form `<field> <operator> <value>` and may have a `-`
  371. // character in front of them to indicate negation. Examples include:
  372. //
  373. // * name
  374. // * source_properties.a_property
  375. // * security_marks.marks.marka
  376. //
  377. // The supported operators are:
  378. //
  379. // * `=` for all value types.
  380. // * `>`, `<`, `>=`, `<=` for integer values.
  381. // * `:`, meaning substring matching, for strings.
  382. //
  383. // The supported value types are:
  384. //
  385. // * string literals in quotes.
  386. // * integer literals without quotes.
  387. // * boolean literals `true` and `false` without quotes.
  388. //
  389. // For example, `source_properties.size = 100` is a valid filter string.
  390. string filter = 2;
  391. // Required. Expression that defines what assets fields to use for grouping (including
  392. // `state`). The string value should follow SQL syntax: comma separated list
  393. // of fields. For example:
  394. // "parent,resource_name".
  395. //
  396. // The following fields are supported:
  397. //
  398. // * resource_name
  399. // * category
  400. // * state
  401. // * parent
  402. string group_by = 3 [(google.api.field_behavior) = REQUIRED];
  403. // Time used as a reference point when filtering findings. The filter is
  404. // limited to findings existing at the supplied time and their values are
  405. // those at that specific time. Absence of this field will default to the
  406. // API's version of NOW.
  407. google.protobuf.Timestamp read_time = 4;
  408. // The value returned by the last `GroupFindingsResponse`; indicates
  409. // that this is a continuation of a prior `GroupFindings` call, and
  410. // that the system should return the next page of data.
  411. string page_token = 5;
  412. // The maximum number of results to return in a single response. Default is
  413. // 10, minimum is 1, maximum is 1000.
  414. int32 page_size = 6;
  415. }
  416. // Response message for group by findings.
  417. message GroupFindingsResponse {
  418. // Group results. There exists an element for each existing unique
  419. // combination of property/values. The element contains a count for the number
  420. // of times those specific property/values appear.
  421. repeated GroupResult group_by_results = 1;
  422. // Time used for executing the groupBy request.
  423. google.protobuf.Timestamp read_time = 2;
  424. // Token to retrieve the next page of results, or empty if there are no more
  425. // results.
  426. string next_page_token = 3;
  427. }
  428. // Result containing the properties and count of a groupBy request.
  429. message GroupResult {
  430. // Properties matching the groupBy fields in the request.
  431. map<string, google.protobuf.Value> properties = 1;
  432. // Total count of resources for the given properties.
  433. int64 count = 2;
  434. }
  435. // Request message for listing sources.
  436. message ListSourcesRequest {
  437. // Required. Resource name of the parent of sources to list. Its format should be
  438. // "organizations/[organization_id]".
  439. string parent = 1 [
  440. (google.api.field_behavior) = REQUIRED,
  441. (google.api.resource_reference) = {
  442. type: "cloudresourcemanager.googleapis.com/Organization"
  443. }
  444. ];
  445. // The value returned by the last `ListSourcesResponse`; indicates
  446. // that this is a continuation of a prior `ListSources` call, and
  447. // that the system should return the next page of data.
  448. string page_token = 2;
  449. // The maximum number of results to return in a single response. Default is
  450. // 10, minimum is 1, maximum is 1000.
  451. int32 page_size = 7;
  452. }
  453. // Response message for listing sources.
  454. message ListSourcesResponse {
  455. // Sources belonging to the requested parent.
  456. repeated Source sources = 1;
  457. // Token to retrieve the next page of results, or empty if there are no more
  458. // results.
  459. string next_page_token = 2;
  460. }
  461. // Request message for listing assets.
  462. message ListAssetsRequest {
  463. // Required. Name of the organization assets should belong to. Its format is
  464. // "organizations/[organization_id]".
  465. string parent = 1 [
  466. (google.api.field_behavior) = REQUIRED,
  467. (google.api.resource_reference) = {
  468. type: "cloudresourcemanager.googleapis.com/Organization"
  469. }
  470. ];
  471. // Expression that defines the filter to apply across assets.
  472. // The expression is a list of zero or more restrictions combined via logical
  473. // operators `AND` and `OR`.
  474. // Parentheses are not supported, and `OR` has higher precedence than `AND`.
  475. //
  476. // Restrictions have the form `<field> <operator> <value>` and may have a `-`
  477. // character in front of them to indicate negation. The fields map to those
  478. // defined in the Asset resource. Examples include:
  479. //
  480. // * name
  481. // * security_center_properties.resource_name
  482. // * resource_properties.a_property
  483. // * security_marks.marks.marka
  484. //
  485. // The supported operators are:
  486. //
  487. // * `=` for all value types.
  488. // * `>`, `<`, `>=`, `<=` for integer values.
  489. // * `:`, meaning substring matching, for strings.
  490. //
  491. // The supported value types are:
  492. //
  493. // * string literals in quotes.
  494. // * integer literals without quotes.
  495. // * boolean literals `true` and `false` without quotes.
  496. //
  497. // For example, `resource_properties.size = 100` is a valid filter string.
  498. string filter = 2;
  499. // Expression that defines what fields and order to use for sorting. The
  500. // string value should follow SQL syntax: comma separated list of fields. For
  501. // example: "name,resource_properties.a_property". The default sorting order
  502. // is ascending. To specify descending order for a field, a suffix " desc"
  503. // should be appended to the field name. For example: "name
  504. // desc,resource_properties.a_property". Redundant space characters in the
  505. // syntax are insignificant. "name desc,resource_properties.a_property" and "
  506. // name desc , resource_properties.a_property " are equivalent.
  507. string order_by = 3;
  508. // Time used as a reference point when filtering assets. The filter is limited
  509. // to assets existing at the supplied time and their values are those at that
  510. // specific time. Absence of this field will default to the API's version of
  511. // NOW.
  512. google.protobuf.Timestamp read_time = 4;
  513. // When compare_duration is set, the ListAssetResult's "state" attribute is
  514. // updated to indicate whether the asset was added, removed, or remained
  515. // present during the compare_duration period of time that precedes the
  516. // read_time. This is the time between (read_time -
  517. // compare_duration) and read_time.
  518. //
  519. // The state value is derived based on the presence of the asset at the two
  520. // points in time. Intermediate state changes between the two times don't
  521. // affect the result. For example, the results aren't affected if the asset is
  522. // removed and re-created again.
  523. //
  524. // Possible "state" values when compare_duration is specified:
  525. //
  526. // * "ADDED": indicates that the asset was not present before
  527. // compare_duration, but present at read_time.
  528. // * "REMOVED": indicates that the asset was present at the start of
  529. // compare_duration, but not present at read_time.
  530. // * "ACTIVE": indicates that the asset was present at both the
  531. // start and the end of the time period defined by
  532. // compare_duration and read_time.
  533. //
  534. // If compare_duration is not specified, then the only possible state is
  535. // "UNUSED", which indicates that the asset is present at read_time.
  536. google.protobuf.Duration compare_duration = 5;
  537. // Optional. A field mask to specify the ListAssetsResult fields to be listed in the
  538. // response.
  539. // An empty field mask will list all fields.
  540. google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL];
  541. // The value returned by the last `ListAssetsResponse`; indicates
  542. // that this is a continuation of a prior `ListAssets` call, and
  543. // that the system should return the next page of data.
  544. string page_token = 8;
  545. // The maximum number of results to return in a single response. Default is
  546. // 10, minimum is 1, maximum is 1000.
  547. int32 page_size = 9;
  548. }
  549. // Response message for listing assets.
  550. message ListAssetsResponse {
  551. // Result containing the Asset and its State.
  552. message ListAssetsResult {
  553. // State of the asset.
  554. //
  555. // When querying across two points in time this describes
  556. // the change between the two points: ADDED, REMOVED, or ACTIVE.
  557. // If there was no compare_duration supplied in the request the state should
  558. // be: UNUSED
  559. enum State {
  560. // Unspecified state.
  561. STATE_UNSPECIFIED = 0;
  562. // Request did not specify use of this field in the result.
  563. UNUSED = 1;
  564. // Asset was added between the points in time.
  565. ADDED = 2;
  566. // Asset was removed between the points in time.
  567. REMOVED = 3;
  568. // Asset was active at both point(s) in time.
  569. ACTIVE = 4;
  570. }
  571. // Asset matching the search request.
  572. Asset asset = 1;
  573. // State of the asset.
  574. State state = 2;
  575. }
  576. // Assets matching the list request.
  577. repeated ListAssetsResult list_assets_results = 1;
  578. // Time used for executing the list request.
  579. google.protobuf.Timestamp read_time = 2;
  580. // Token to retrieve the next page of results, or empty if there are no more
  581. // results.
  582. string next_page_token = 3;
  583. // The total number of assets matching the query.
  584. int32 total_size = 4;
  585. }
  586. // Request message for listing findings.
  587. message ListFindingsRequest {
  588. // Required. Name of the source the findings belong to. Its format is
  589. // "organizations/[organization_id]/sources/[source_id]". To list across all
  590. // sources provide a source_id of `-`. For example:
  591. // organizations/{organization_id}/sources/-
  592. string parent = 1 [
  593. (google.api.field_behavior) = REQUIRED,
  594. (google.api.resource_reference) = {
  595. type: "securitycenter.googleapis.com/Source"
  596. }
  597. ];
  598. // Expression that defines the filter to apply across findings.
  599. // The expression is a list of one or more restrictions combined via logical
  600. // operators `AND` and `OR`.
  601. // Parentheses are not supported, and `OR` has higher precedence than `AND`.
  602. //
  603. // Restrictions have the form `<field> <operator> <value>` and may have a `-`
  604. // character in front of them to indicate negation. Examples include:
  605. //
  606. // * name
  607. // * source_properties.a_property
  608. // * security_marks.marks.marka
  609. //
  610. // The supported operators are:
  611. //
  612. // * `=` for all value types.
  613. // * `>`, `<`, `>=`, `<=` for integer values.
  614. // * `:`, meaning substring matching, for strings.
  615. //
  616. // The supported value types are:
  617. //
  618. // * string literals in quotes.
  619. // * integer literals without quotes.
  620. // * boolean literals `true` and `false` without quotes.
  621. //
  622. // For example, `source_properties.size = 100` is a valid filter string.
  623. string filter = 2;
  624. // Expression that defines what fields and order to use for sorting. The
  625. // string value should follow SQL syntax: comma separated list of fields. For
  626. // example: "name,resource_properties.a_property". The default sorting order
  627. // is ascending. To specify descending order for a field, a suffix " desc"
  628. // should be appended to the field name. For example: "name
  629. // desc,source_properties.a_property". Redundant space characters in the
  630. // syntax are insignificant. "name desc,source_properties.a_property" and "
  631. // name desc , source_properties.a_property " are equivalent.
  632. string order_by = 3;
  633. // Time used as a reference point when filtering findings. The filter is
  634. // limited to findings existing at the supplied time and their values are
  635. // those at that specific time. Absence of this field will default to the
  636. // API's version of NOW.
  637. google.protobuf.Timestamp read_time = 4;
  638. // Optional. A field mask to specify the Finding fields to be listed in the response.
  639. // An empty field mask will list all fields.
  640. google.protobuf.FieldMask field_mask = 5 [(google.api.field_behavior) = OPTIONAL];
  641. // The value returned by the last `ListFindingsResponse`; indicates
  642. // that this is a continuation of a prior `ListFindings` call, and
  643. // that the system should return the next page of data.
  644. string page_token = 6;
  645. // The maximum number of results to return in a single response. Default is
  646. // 10, minimum is 1, maximum is 1000.
  647. int32 page_size = 7;
  648. }
  649. // Response message for listing findings.
  650. message ListFindingsResponse {
  651. // Findings matching the list request.
  652. repeated Finding findings = 1;
  653. // Time used for executing the list request.
  654. google.protobuf.Timestamp read_time = 2;
  655. // Token to retrieve the next page of results, or empty if there are no more
  656. // results.
  657. string next_page_token = 3;
  658. // The total number of findings matching the query.
  659. int32 total_size = 4;
  660. }
  661. // Request message for updating a finding's state.
  662. message SetFindingStateRequest {
  663. // Required. The relative resource name of the finding. See:
  664. // https://cloud.google.com/apis/design/resource_names#relative_resource_name
  665. // Example:
  666. // "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".
  667. string name = 1 [
  668. (google.api.field_behavior) = REQUIRED,
  669. (google.api.resource_reference) = {
  670. type: "securitycenter.googleapis.com/Finding"
  671. }
  672. ];
  673. // Required. The desired State of the finding.
  674. Finding.State state = 2 [(google.api.field_behavior) = REQUIRED];
  675. // Required. The time at which the updated state takes effect.
  676. google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED];
  677. }
  678. // Request message for running asset discovery for an organization.
  679. message RunAssetDiscoveryRequest {
  680. // Required. Name of the organization to run asset discovery for. Its format is
  681. // "organizations/[organization_id]".
  682. string parent = 1 [
  683. (google.api.field_behavior) = REQUIRED,
  684. (google.api.resource_reference) = {
  685. type: "cloudresourcemanager.googleapis.com/Organization"
  686. }
  687. ];
  688. }
  689. // Request message for updating or creating a finding.
  690. message UpdateFindingRequest {
  691. // Required. The finding resource to update or create if it does not already exist.
  692. // parent, security_marks, and update_time will be ignored.
  693. //
  694. // In the case of creation, the finding id portion of the name must
  695. // alphanumeric and less than or equal to 32 characters and greater than 0
  696. // characters in length.
  697. Finding finding = 1 [(google.api.field_behavior) = REQUIRED];
  698. // The FieldMask to use when updating the finding resource. This field should
  699. // not be specified when creating a finding.
  700. google.protobuf.FieldMask update_mask = 2;
  701. }
  702. // Request message for updating an organization's settings.
  703. message UpdateOrganizationSettingsRequest {
  704. // Required. The organization settings resource to update.
  705. OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED];
  706. // The FieldMask to use when updating the settings resource.
  707. google.protobuf.FieldMask update_mask = 2;
  708. }
  709. // Request message for updating a source.
  710. message UpdateSourceRequest {
  711. // Required. The source resource to update.
  712. Source source = 1 [(google.api.field_behavior) = REQUIRED];
  713. // The FieldMask to use when updating the source resource.
  714. google.protobuf.FieldMask update_mask = 2;
  715. }
  716. // Request message for updating a SecurityMarks resource.
  717. message UpdateSecurityMarksRequest {
  718. // Required. The security marks resource to update.
  719. SecurityMarks security_marks = 1 [(google.api.field_behavior) = REQUIRED];
  720. // The FieldMask to use when updating the security marks resource.
  721. google.protobuf.FieldMask update_mask = 2;
  722. // The time at which the updated SecurityMarks take effect.
  723. google.protobuf.Timestamp start_time = 3;
  724. }