Skip to content

Commit 4f369e8

Browse files
[google_scc] Initial release for the Google SCC (#6645)
* Initial release for the Google SCC * Update the changelog entry * Resolve review comments * Resolve review comments and updated dashboard * Update fields desciption
1 parent c72b65b commit 4f369e8

File tree

76 files changed

+15807
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+15807
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
/packages/github @elastic/security-external-integrations
102102
/packages/golang @elastic/obs-infraobs-integrations
103103
/packages/google_cloud_storage @elastic/security-external-integrations
104+
/packages/google_scc @elastic/security-external-integrations
104105
/packages/google_workspace @elastic/security-external-integrations
105106
/packages/hadoop @elastic/obs-infraobs-integrations
106107
/packages/haproxy @elastic/obs-infraobs-integrations
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dependencies:
2+
ecs:
3+
reference: git@v8.8.0
4+
import_mappings: true
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Google Security Command Center
2+
3+
## Overview
4+
5+
The [Google Security Command Center](https://cloud.google.com/security-command-center) integration allows users to monitor finding, audit, asset, and source. Security Command Center Premium provides comprehensive threat detection for Google Cloud that includes Event Threat Detection, Container Threat Detection, and Virtual Machine Threat Detection as built-in services.
6+
7+
Use the Google SCC integration to collect and parse data from the Google SCC REST API (finding, asset, and source) or GCP Pub/Sub (finding, asset, and audit). Then visualize that data through search, correlation, and visualization within Elastic Security.
8+
9+
## Data streams
10+
11+
The Google SCC integration collects four types of data: finding, audit, asset, and source.
12+
13+
**Finding** is a record of assessment data like security, risk, health, or privacy, that is ingested into Security Command Center for presentation, notification, analysis, policy testing, and enforcement. For example, a cross-site scripting (XSS) vulnerability in an App Engine application is a finding.
14+
15+
**Audit** logs created by Security Command Center as part of Cloud Audit Logs.
16+
17+
**Asset** lists assets with time and resource types and returns paged results in response.
18+
19+
**Source** is an entity or a mechanism that can produce a finding. A source is like a container of findings that come from the same scanner, logger, monitor, and other tools.
20+
21+
## Compatibility
22+
23+
This module has been tested against the latest Google SCC API version **v1**.
24+
25+
## Requirements
26+
27+
- Elastic Agent must be installed.
28+
- You can install only one Elastic Agent per host.
29+
- Elastic Agent is required to stream data from the GCP Pub/Sub or REST API and ship the data to Elastic, where the events will then be processed via the integration's ingest pipelines.
30+
31+
### Installing and managing an Elastic Agent:
32+
33+
You have a few options for installing and managing an Elastic Agent:
34+
35+
### Install a Fleet-managed Elastic Agent (recommended):
36+
37+
With this approach, you install Elastic Agent and use Fleet in Kibana to define, configure, and manage your agents in a central location. We recommend using Fleet management because it makes the management and upgrade of your agents considerably easier.
38+
39+
### Install Elastic Agent in standalone mode (advanced users):
40+
41+
With this approach, you install Elastic Agent and manually configure the agent locally on the system where it’s installed. You are responsible for managing and upgrading the agents. This approach is reserved for advanced users only.
42+
43+
### Install Elastic Agent in a containerized environment:
44+
45+
You can run Elastic Agent inside a container, either with Fleet Server or standalone. Docker images for all versions of Elastic Agent are available from the Elastic Docker registry and we provide deployment manifests for running on Kubernetes.
46+
47+
There are some minimum requirements for running Elastic Agent and for more information, refer to the link [here](https://www.elastic.co/guide/en/fleet/current/elastic-agent-installation.html).
48+
49+
The minimum **kibana.version** required is **8.8.0**.
50+
51+
## Prerequisites
52+
53+
- Create Google SCC service account [Steps to create](https://developers.google.com/identity/protocols/oauth2/service-account#creatinganaccount).
54+
- Permissions required for Service Account:
55+
- Cloud Asset Viewer at Organization Level
56+
- Pub/Sub Subscriber at Project Level
57+
- Security Center Admin Editor at Organization Level
58+
- **Security Command Center API** and **Cloud Asset API** must be enabled.
59+
60+
This integration will make use of the following *oauth2 scope*:
61+
62+
- `https://www.googleapis.com/auth/cloud-platform`
63+
64+
Once Service Account credentials are downloaded as a JSON file, then the integration can be setup to collect data.
65+
66+
If installing in GCP-Cloud Environment, No need to provide any credentials and make sure the account linked with the VM has all the required IAM permissions. Steps to [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc).
67+
68+
## Setup
69+
70+
### To create GCP Pub/Sub, follow the below steps:
71+
72+
- [Create Topic for Pub/sub](https://cloud.google.com/pubsub/docs/create-topic#create_a_topic).
73+
- [Create Subscription for topic](https://cloud.google.com/pubsub/docs/create-subscription#create_subscriptions)
74+
75+
### To collect data from GCP Pub/Sub, follow the below steps:
76+
77+
- [Configure to export finding to GCP Pub/Sub](https://cloud.google.com/security-command-center/docs/how-to-notifications).
78+
- [Configure to export asset to GCP Pub/Sub](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes).
79+
- [Configure to export audit to GCP Pub/Sub](https://cloud.google.com/logging/docs/export/configure_export_v2?_ga=2.110932226.-66737431.1679995682#overview).
80+
81+
**NOTE**:
82+
- **Sink destination** must be **Pub/Sub topic** while exporting audit logs to GCP Pub/Sub.
83+
- Create unique Pub/Sub topic per data-stream.
84+
85+
### Enabling the integration in Elastic:
86+
1. In Kibana go to **Management > Integrations**.
87+
2. In "Search for integrations" search bar, type **Google Security Command Center**.
88+
3. Click on the **Google Security Command Center** integration from the search results.
89+
4. Click on the **Add Google Security Command Center** Integration button to add the integration.
90+
5. While adding the integration, if you want to **collect logs via Rest API**, turn on the toggle and then put the following details:
91+
- credentials type
92+
- credentials JSON/file
93+
- parent type
94+
- id
95+
- To collect **asset logs**, put the following details:
96+
- content type
97+
98+
or if you want to **collect logs via GCP Pub/Sub**, turn on the toggle and then put the following details:
99+
- credentials type
100+
- credentials JSON/file
101+
- project id
102+
- To collect **asset, audit, or finding logs**, put the following details:
103+
- topic
104+
- subscription name
105+
106+
## Logs reference
107+
108+
### Asset
109+
110+
This is the `Asset` dataset.
111+
112+
#### Example
113+
114+
{{event "asset"}}
115+
116+
{{fields "asset"}}
117+
118+
### Finding
119+
120+
This is the `Finding` dataset.
121+
122+
#### Example
123+
124+
{{event "finding"}}
125+
126+
{{fields "finding"}}
127+
128+
### Source
129+
130+
This is the `Source` dataset.
131+
132+
#### Example
133+
134+
{{event "source"}}
135+
136+
{{fields "source"}}
137+
138+
### Audit
139+
140+
This is the `Audit` dataset.
141+
142+
#### Example
143+
144+
{{event "audit"}}
145+
146+
{{fields "audit"}}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
version: '2.3'
2+
services:
3+
google_scc:
4+
image: docker.elastic.co/observability/stream:v0.10.0
5+
hostname: google_scc
6+
ports:
7+
- 8090
8+
volumes:
9+
- ./files:/files:ro
10+
environment:
11+
PORT: '8090'
12+
command:
13+
- http-server
14+
- --addr=:8090
15+
- --config=/files/config.yml
16+
gcppubsub-emulator:
17+
image: google/cloud-sdk:emulators
18+
command: gcloud beta emulators pubsub start --host-port=0.0.0.0:8681
19+
ports:
20+
- "8681/tcp"
21+
gcppubsub-audit:
22+
image: docker.elastic.co/observability/stream:v0.10.0
23+
volumes:
24+
- ./files:/files:ro
25+
command:
26+
- log
27+
- --retry=30
28+
- --addr=gcppubsub-emulator:8681
29+
- -p=gcppubsub
30+
- --gcppubsub-clear=true
31+
- --gcppubsub-project=audit
32+
- /files/audit.log
33+
depends_on:
34+
- gcppubsub-emulator
35+
gcppubsub-asset:
36+
image: docker.elastic.co/observability/stream:v0.10.0
37+
volumes:
38+
- ./files:/files:ro
39+
command:
40+
- log
41+
- --retry=30
42+
- --addr=gcppubsub-emulator:8681
43+
- -p=gcppubsub
44+
- --gcppubsub-clear=true
45+
- --gcppubsub-project=asset
46+
- /files/asset.log
47+
depends_on:
48+
- gcppubsub-emulator
49+
gcppubsub-finding:
50+
image: docker.elastic.co/observability/stream:v0.10.0
51+
volumes:
52+
- ./files:/files:ro
53+
command:
54+
- log
55+
- --retry=30
56+
- --addr=gcppubsub-emulator:8681
57+
- -p=gcppubsub
58+
- --gcppubsub-clear=true
59+
- --gcppubsub-project=finding
60+
- /files/finding.log
61+
depends_on:
62+
- gcppubsub-emulator
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"asset":{"ancestors":["projects/123456987522","folders/123456987520","organizations/523456987520"],"assetType":"logging.googleapis.com/LogBucket","name":"//logging.googleapis.com/projects/123456987522/locations/global/buckets/_Default","resource":{"data":{"description":"Default bucket","lifecycleState":"ACTIVE","name":"projects/123456987522/locations/global/buckets/_Default","retentionDays":30},"discoveryDocumentUri":"https://logging.googleapis.com/$discovery/rest","discoveryName":"LogBucket","location":"global","parent":"//cloudresourcemanager.googleapis.com/projects/123456987522","version":"v2"},"updateTime":"2023-05-28T06:59:48.052491Z"},"priorAsset":{"ancestors":["projects/123456987522","folders/123456987520","organizations/523456987520"],"assetType":"logging.googleapis.com/LogBucket","name":"//logging.googleapis.com/projects/123456987522/locations/global/buckets/_Default","resource":{"data":{"analyticsEnabled":true,"description":"Default bucket","lifecycleState":"ACTIVE","name":"projects/123456987522/locations/global/buckets/_Default","retentionDays":30},"discoveryDocumentUri":"https://logging.googleapis.com/$discovery/rest","discoveryName":"LogBucket","location":"global","parent":"//cloudresourcemanager.googleapis.com/projects/123456987522","version":"v2"},"updateTime":"2023-05-27T18:53:48.843904Z"},"priorAssetState":"PRESENT","window":{"startTime":"2023-05-28T06:59:48.052491Z"}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"protoPayload":{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","authenticationInfo":{"principalEmail":"test-user@example.net"},"requestMetadata":{"callerIp":"175.16.199.1","requestAttributes":{},"destinationAttributes":{}},"serviceName":"login.googleapis.com","methodName":"google.login.LoginService.loginFailure","resourceName":"organizations/123"},"insertId":"-nahbepd4l1x","resource":{"type":"audited_resource"},"httpRequest":{"remoteIp":"FE80::0202:B3FF:FE1E:1010"},"timestamp":"2021-09-24T16:16:57.183212Z","severity":"NOTICE","logName":"organizations/123/logs/cloudaudit.googleapis.com%2Fdata_access","receiveTimestamp":"2021-09-24T17:51:25.034361197Z"}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
rules:
2+
- path: /token
3+
methods: [POST]
4+
request_headers:
5+
Content-Type:
6+
- "application/x-www-form-urlencoded"
7+
responses:
8+
- status_code: 200
9+
headers:
10+
Content-Type:
11+
- "application/json"
12+
body: >
13+
{"access_token": "1/fFAGRNJru1FTz70BzhT3Zg","expires_in": 3920,"token_type": "Bearer", "scope": "https://www.googleapis.com/auth/admin.reports.audit.readonly","refresh_token": "1//xEoDL4iW3cxlI7yDbSRFYNG01kVKM2C-259HOF2aQbI"}
14+
15+
- path: /v1/organizations/xxxx/sources/-/findings
16+
methods: [GET]
17+
request_headers:
18+
Accept:
19+
- "application/json"
20+
Authorization:
21+
- "Bearer 1/fFAGRNJru1FTz70BzhT3Zg"
22+
responses:
23+
- status_code: 200
24+
headers:
25+
Content-Type:
26+
- "application/json"
27+
body: >
28+
{"listFindingsResults":[{"finding":{"name":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545","parent":"organizations/515665165161/sources/98481484454154454545","resourceName":"//cloudresourcemanager.googleapis.com/projects/45455445554","state":"ACTIVE","category":"application","externalUri":"http://www.adwait.com","securityMarks":{"name":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545/securityMarks"},"eventTime":"2023-06-02T05:17:41.936Z","createTime":"2020-02-19T13:37:43.858Z","severity":"CRITICAL","canonicalName":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545","mute":"UNMUTED","muteUpdateTime":"2022-03-23T05:50:21.804Z","externalSystems":{"test":{"name":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545/externalSystems/test","assignees":["primary"],"externalUid":"test_scc_finding_2","status":"updated1","externalSystemUpdateTime":"2022-01-05T05:00:35.674Z"}},"muteInitiator":"Unmuted by john@gmail.com"},"resource":{"name":"//cloudresourcemanager.googleapis.com/projects/45455445554"}}]}
29+
30+
- path: /v1/organizations/xxxx/sources
31+
methods: [GET]
32+
request_headers:
33+
Accept:
34+
- "application/json"
35+
Authorization:
36+
- "Bearer 1/fFAGRNJru1FTz70BzhT3Zg"
37+
responses:
38+
- status_code: 200
39+
headers:
40+
Content-Type:
41+
- "application/json"
42+
body: >
43+
{"sources":[{"name":"organizations/595779152576/sources/10134421585261057824","displayName":"Cloudflare Security Events","description":"Extend your security view from the edge.","canonicalName":"organizations/595779152576/sources/10134421585261057824"}]}
44+
45+
- path: /v1/organizations/xxxx/assets
46+
methods: [GET]
47+
request_headers:
48+
Accept:
49+
- "application/json"
50+
Authorization:
51+
- "Bearer 1/fFAGRNJru1FTz70BzhT3Zg"
52+
responses:
53+
- status_code: 200
54+
headers:
55+
Content-Type:
56+
- "application/json"
57+
body: >
58+
{"assets":[{"name":"//cloudbilling.googleapis.com/billingAccounts/012345-A08098-1Ab2CD","assetType":"cloudbilling.googleapis.com/BillingAccount","resource":{"version":"v1","discoveryDocumentUri":"https://cloudbilling.googleapis.com/$discovery/rest","discoveryName":"BillingAccount","data":{"displayName":"New","name":"billingAccounts/012345-A08098-1Ab2CD"},"location":"global"},"ancestors":["organizations/523456987520"],"updateTime":"2022-11-17T12:20:17.601902Z"}]}
59+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"finding":{"name":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545","parent":"organizations/515665165161/sources/98481484454154454545","resourceName":"//cloudresourcemanager.googleapis.com/projects/45455445554","state":"ACTIVE","category":"application","externalUri":"http://www.adwait.com","sourceProperties":{},"securityMarks":{"name":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545/securityMarks"},"eventTime":"2023-06-02T05:17:41.936Z","createTime":"2020-02-19T13:37:43.858Z","severity":"CRITICAL","canonicalName":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545","mute":"UNMUTED","muteUpdateTime":"2022-03-23T05:50:21.804Z","externalSystems":{"test":{"name":"organizations/515665165161/sources/98481484454154454545/findings/414rfrhjebhrbhjbr444454hv54545/externalSystems/test","assignees":["primary"],"externalUid":"test_scc_finding_2","status":"updated1","externalSystemUpdateTime":"2022-01-05T05:00:35.674Z"}},"muteInitiator":"Unmuted by john@gmail.com"},"resource":{"name":"//cloudresourcemanager.googleapis.com/projects/45455445554"}}

packages/google_scc/changelog.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# newer versions go on top
2+
- version: "0.1.0"
3+
changes:
4+
- description: Initial release.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/6645

0 commit comments

Comments
 (0)