Skip to content

Commit a887434

Browse files
Google APIscopybara-github
authored andcommitted
feat: Adding database access information, such as queries field to a finding. A database may be a sub-resource of an instance (as in the case of CloudSQL instances or Cloud Spanner instances), or the database instance itself
PiperOrigin-RevId: 469544940
1 parent f3e6b9f commit a887434

3 files changed

Lines changed: 68 additions & 8 deletions

File tree

google/cloud/securitycenter/v1/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ proto_library(
5959
"connection.proto",
6060
"contact_details.proto",
6161
"container.proto",
62+
"database.proto",
6263
"exfiltration.proto",
6364
"external_system.proto",
6465
"file.proto",
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.securitycenter.v1;
18+
19+
option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
20+
option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
21+
option java_multiple_files = true;
22+
option java_outer_classname = "DatabaseProto";
23+
option java_package = "com.google.cloud.securitycenter.v1";
24+
option php_namespace = "Google\\Cloud\\SecurityCenter\\V1";
25+
option ruby_package = "Google::Cloud::SecurityCenter::V1";
26+
27+
// Represents database access information, such as queries.
28+
// A database may be a sub-resource of an instance (as in the case of CloudSQL
29+
// instances or Cloud Spanner instances), or the database instance itself.
30+
// Some database resources may not have the full resource name populated
31+
// because these resource types are not yet supported by Cloud Asset Inventory
32+
// (e.g. CloudSQL databases). In these cases only the display name will be
33+
// provided.
34+
message Database {
35+
// The full resource name of the database the user connected to, if it is
36+
// supported by CAI. (https://google.aip.dev/122#full-resource-names)
37+
string name = 1;
38+
39+
// The human readable name of the database the user connected to.
40+
string display_name = 2;
41+
42+
// The username used to connect to the DB. This may not necessarily be an IAM
43+
// principal, and has no required format.
44+
string user_name = 3;
45+
46+
// The SQL statement associated with the relevant access.
47+
string query = 4;
48+
49+
// The target usernames/roles/groups of a SQL privilege grant (not an IAM
50+
// policy change).
51+
repeated string grantees = 5;
52+
}

google/cloud/securitycenter/v1/finding.proto

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import "google/cloud/securitycenter/v1/compliance.proto";
2323
import "google/cloud/securitycenter/v1/connection.proto";
2424
import "google/cloud/securitycenter/v1/contact_details.proto";
2525
import "google/cloud/securitycenter/v1/container.proto";
26+
import "google/cloud/securitycenter/v1/database.proto";
2627
import "google/cloud/securitycenter/v1/exfiltration.proto";
2728
import "google/cloud/securitycenter/v1/external_system.proto";
2829
import "google/cloud/securitycenter/v1/iam_binding.proto";
@@ -257,11 +258,13 @@ message Finding {
257258
Vulnerability vulnerability = 20;
258259

259260
// Output only. The most recent time this finding was muted or unmuted.
260-
google.protobuf.Timestamp mute_update_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
261+
google.protobuf.Timestamp mute_update_time = 21
262+
[(google.api.field_behavior) = OUTPUT_ONLY];
261263

262-
// Output only. Third party SIEM/SOAR fields within SCC, contains external system
263-
// information and external system finding fields.
264-
map<string, ExternalSystem> external_systems = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
264+
// Output only. Third party SIEM/SOAR fields within SCC, contains external
265+
// system information and external system finding fields.
266+
map<string, ExternalSystem> external_systems = 22
267+
[(google.api.field_behavior) = OUTPUT_ONLY];
265268

266269
// MITRE ATT&CK tactics and techniques related to this finding.
267270
// See: https://attack.mitre.org
@@ -283,9 +286,9 @@ message Finding {
283286
// Represents operating system processes associated with the Finding.
284287
repeated Process processes = 30;
285288

286-
// Output only. Map containing the point of contacts for the given finding. The key
287-
// represents the type of contact, while the value contains a list of all the
288-
// contacts that pertain. Please refer to:
289+
// Output only. Map containing the point of contacts for the given finding.
290+
// The key represents the type of contact, while the value contains a list of
291+
// all the contacts that pertain. Please refer to:
289292
// https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories
290293
//
291294
// {
@@ -300,7 +303,8 @@ message Finding {
300303
// ]
301304
// }
302305
// }
303-
map<string, ContactDetails> contacts = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
306+
map<string, ContactDetails> contacts = 33
307+
[(google.api.field_behavior) = OUTPUT_ONLY];
304308

305309
// Contains compliance information for security standards associated to the
306310
// finding.
@@ -324,4 +328,7 @@ message Finding {
324328

325329
// Kubernetes resources associated with the finding.
326330
Kubernetes kubernetes = 43;
331+
332+
// Database associated with the finding.
333+
Database database = 44;
327334
}

0 commit comments

Comments
 (0)