Skip to content

Commit a73c4ce

Browse files
feat(v1): add canonical_name and folder fields (#379)
Assets and findings may be created in organizations, folders or projects, however in the current API version the name field for resources will always be prefixed by "organizations/...", for historical reasons. The "canonical_name" field shows the actual location of the resource, and in requests either the name or "canonical name" can be used for the "name" in the request. The "folder" field contains the folders in the resource's ancestry. PiperOrigin-RevId: 372965035 Source-Link: googleapis/googleapis@0a992df Source-Link: googleapis/googleapis-gen@3874faa
1 parent f4e729d commit a73c4ce

18 files changed

+3641
-1456
lines changed

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/asset.proto

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,11 +16,12 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/api/resource.proto";
20+
import "google/cloud/securitycenter/v1/folder.proto";
2121
import "google/cloud/securitycenter/v1/security_marks.proto";
2222
import "google/protobuf/struct.proto";
2323
import "google/protobuf/timestamp.proto";
24+
import "google/api/annotations.proto";
2425

2526
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
2627
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
@@ -40,6 +41,8 @@ message Asset {
4041
option (google.api.resource) = {
4142
type: "securitycenter.googleapis.com/Asset"
4243
pattern: "organizations/{organization}/assets/{asset}"
44+
pattern: "folders/{folder}/assets/{asset}"
45+
pattern: "projects/{project}/assets/{asset}"
4346
};
4447

4548
// Security Command Center managed properties. These properties are managed by
@@ -75,6 +78,11 @@ message Asset {
7578

7679
// The user defined display name for the project of this resource.
7780
string resource_project_display_name = 8;
81+
82+
// Contains a Folder message for each folder in the assets ancestry.
83+
// The first folder is the deepest nested folder, and the last folder is the
84+
// folder directly under the Organization.
85+
repeated Folder folders = 10;
7886
}
7987

8088
// Cloud IAM Policy information associated with the Google Cloud resource
@@ -109,13 +117,19 @@ message Asset {
109117
// The time at which the asset was created in Security Command Center.
110118
google.protobuf.Timestamp create_time = 9;
111119

112-
// The time at which the asset was last updated, added, or deleted in Security
113-
// Command Center.
120+
// The time at which the asset was last updated or added in Cloud SCC.
114121
google.protobuf.Timestamp update_time = 10;
115122

116123
// Cloud IAM Policy information associated with the Google Cloud resource
117124
// described by the Security Command Center asset. This information is managed
118125
// and defined by the Google Cloud resource and cannot be modified by the
119126
// user.
120127
IamPolicy iam_policy = 11;
128+
129+
// The canonical name of the resource. It's either
130+
// "organizations/{organization_id}/assets/{asset_id}",
131+
// "folders/{folder_id}/assets/{asset_id}" or
132+
// "projects/{project_number}/assets/{asset_id}", depending on the closest CRM
133+
// ancestor of the resource.
134+
string canonical_name = 13;
121135
}

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,12 +16,12 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/api/field_behavior.proto";
2120
import "google/api/resource.proto";
2221
import "google/cloud/securitycenter/v1/security_marks.proto";
2322
import "google/protobuf/struct.proto";
2423
import "google/protobuf/timestamp.proto";
24+
import "google/api/annotations.proto";
2525

2626
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
2727
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
@@ -41,6 +41,8 @@ message Finding {
4141
option (google.api.resource) = {
4242
type: "securitycenter.googleapis.com/Finding"
4343
pattern: "organizations/{organization}/sources/{source}/findings/{finding}"
44+
pattern: "folders/{folder}/sources/{source}/findings/{finding}"
45+
pattern: "projects/{project}/sources/{source}/findings/{finding}"
4446
};
4547

4648
// The state of the finding.
@@ -164,7 +166,8 @@ message Finding {
164166
// occurred. For example, if the finding represents an open firewall it would
165167
// capture the time the detector believes the firewall became open. The
166168
// accuracy is determined by the detector. If the finding were to be resolved
167-
// afterward, this time would reflect when the finding was resolved.
169+
// afterward, this time would reflect when the finding was resolved. Must not
170+
// be set to a value greater than the current timestamp.
168171
google.protobuf.Timestamp event_time = 9;
169172

170173
// The time at which the finding was created in Security Command Center.
@@ -173,4 +176,12 @@ message Finding {
173176
// The severity of the finding. This field is managed by the source that
174177
// writes the finding.
175178
Severity severity = 12;
179+
180+
// The canonical name of the finding. It's either
181+
// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}",
182+
// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}" or
183+
// "projects/{project_number}/sources/{source_id}/findings/{finding_id}",
184+
// depending on the closest CRM ancestor of the resource associated with the
185+
// finding.
186+
string canonical_name = 14;
176187
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.securitycenter.v1;
18+
19+
import "google/api/annotations.proto";
20+
21+
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
22+
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "FolderProto";
25+
option java_package = "com.google.cloud.securitycenter.v1";
26+
option php_namespace = "Google\\Cloud\\SecurityCenter\\V1";
27+
option ruby_package = "Google::Cloud::SecurityCenter::V1";
28+
29+
// Message that contains the resource name and display name of a folder
30+
// resource.
31+
message Folder {
32+
// Full resource name of this folder. See:
33+
// https://cloud.google.com/apis/design/resource_names#full_resource_name
34+
string resource_folder = 1;
35+
36+
// The user defined display name for this folder.
37+
string resource_folder_display_name = 2;
38+
}

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_config.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/api/field_behavior.proto";
2120
import "google/api/resource.proto";
21+
import "google/api/annotations.proto";
2222

2323
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
2424
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/notification_message.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/cloud/securitycenter/v1/finding.proto";
2120
import "google/cloud/securitycenter/v1/resource.proto";
21+
import "google/api/annotations.proto";
2222

2323
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
2424
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/organization_settings.proto

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/api/resource.proto";
20+
import "google/api/annotations.proto";
2121

2222
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
2323
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
@@ -63,6 +63,10 @@ message OrganizationSettings {
6363

6464
// The mode to use for filtering asset discovery.
6565
InclusionMode inclusion_mode = 2;
66+
67+
// The folder ids to use for filtering asset discovery.
68+
// It consists of only digits, e.g., 756619654966.
69+
repeated string folder_ids = 3;
6670
}
6771

6872
// The relative resource name of the settings. See:

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/resource.proto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19+
import "google/api/field_behavior.proto";
20+
import "google/cloud/securitycenter/v1/folder.proto";
1921
import "google/api/annotations.proto";
2022

2123
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
@@ -43,4 +45,9 @@ message Resource {
4345

4446
// The human readable name of resource's parent.
4547
string parent_display_name = 5;
48+
49+
// Output only. Contains a Folder message for each folder in the assets ancestry.
50+
// The first folder is the deepest nested folder, and the last folder is the
51+
// folder directly under the Organization.
52+
repeated Folder folders = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
4653
}

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/run_asset_discovery_response.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/protobuf/duration.proto";
20+
import "google/api/annotations.proto";
2121

2222
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
2323
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";

packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/security_marks.proto

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@ syntax = "proto3";
1616

1717
package google.cloud.securitycenter.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/api/resource.proto";
20+
import "google/api/annotations.proto";
2121

2222
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
2323
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
@@ -35,6 +35,10 @@ message SecurityMarks {
3535
type: "securitycenter.googleapis.com/SecurityMarks"
3636
pattern: "organizations/{organization}/assets/{asset}/securityMarks"
3737
pattern: "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks"
38+
pattern: "folders/{folder}/assets/{asset}/securityMarks"
39+
pattern: "projects/{project}/assets/{asset}/securityMarks"
40+
pattern: "folders/{folder}/sources/{source}/findings/{finding}/securityMarks"
41+
pattern: "projects/{project}/sources/{source}/findings/{finding}/securityMarks"
3842
};
3943

4044
// The relative resource name of the SecurityMarks. See:
@@ -53,4 +57,14 @@ message SecurityMarks {
5357
// * Values have leading and trailing whitespace trimmed, remaining
5458
// characters must be between 1 - 4096 characters (inclusive)
5559
map<string, string> marks = 2;
60+
61+
// The canonical name of the marks.
62+
// Examples:
63+
// "organizations/{organization_id}/assets/{asset_id}/securityMarks"
64+
// "folders/{folder_id}/assets/{asset_id}/securityMarks"
65+
// "projects/{project_number}/assets/{asset_id}/securityMarks"
66+
// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks"
67+
// "folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks"
68+
// "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks"
69+
string canonical_name = 3;
5670
}

0 commit comments

Comments
 (0)