Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

brijesh-elastic
Copy link
Collaborator

@brijesh-elastic brijesh-elastic commented Jul 22, 2025

Proposed commit message

google_scc: Add support for Security Command Center API v2 and update finding data stream to support
Cloud Detection and Response (CDR) workflow

Some fields inside "google_scc.finding.resource" are moved into "google_scc.finding.resource.gcp_metadata"
as per v2 API schema. This change allows to choose between v1 and v2 (recommended) APIs to fetch
findings. Location-based findings can be fetched to support Security Command Center data
residency feature. Field "google_scc.finding.vulnerability.cve.cvssv3.base_score" data
type is updated to "double" to better suit data. In dashboards, ECS fields are used
in preference to custom fields.

Added "do_not_log_failure: true" to the asset and source data streams to prevent logging of expected
pagination end failures, which have been causing system test failures from version 8.19 onwards.
This issue arose due to the addition of Fleet health status updates in the httpjson input.

Add ECS mappings and latest transform to finding data stream to help with the
Cloud Native Vulnerability Management (CNVM)[1] and Cloud Security Posture Management (CSPM)[2] workflow.

[1] https://www.elastic.co/guide/en/security/current/vuln-management-overview.html
[2] https://www.elastic.co/docs/solutions/security/cloud/cloud-security-posture-management

Note

To Reviewers:

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

  • Clone integrations repo.
  • Install elastic package locally.
  • Start elastic stack using elastic-package.
  • Move to integrations/packages/google_scc directory.
  • Run the following command to run tests.

elastic-package test

Related issues

@brijesh-elastic brijesh-elastic self-assigned this Jul 22, 2025
@brijesh-elastic brijesh-elastic requested a review from a team as a code owner July 22, 2025 06:39
@brijesh-elastic brijesh-elastic added documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. breaking change Integration:google_scc Google Security Command Center Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Jul 22, 2025
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@brijesh-elastic brijesh-elastic marked this pull request as draft July 22, 2025 06:41
@brijesh-elastic brijesh-elastic changed the title [google_scc] Add support for Findings v2 API [google_scc] Add support for Security Command Center API v2 Jul 22, 2025
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@brijesh-elastic brijesh-elastic marked this pull request as ready for review July 30, 2025 06:21
@brijesh-elastic brijesh-elastic changed the title [google_scc] Add support for Security Command Center API v2 [google_scc] Add support for Security Command Center API v2 and update finding data stream to support Cloud Detection and Response (CDR) workflow Jul 30, 2025
@brijesh-elastic brijesh-elastic added the dashboard Relates to a Kibana dashboard bug, enhancement, or modification. label Jul 30, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know what are the changes made to the dashboards?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change is that dashboards are exported to version 8.19, along with below minor field changes :

Finding Dashboard

  • Resource Name Filter (google_scc.finding.resource.name -> resource.id)
  • Total Finding Metric (change decimal from 2 to 0)

Overview Dashboard

  • Distribution of Vulnerabilities by Severity (google_scc.finding.severity -> vulnerability.severity)
  • Top 5 Projects by Severity for Vulnerabilities (google_scc.finding.severity -> vulnerability.severity)
  • Top 5 Projects by Severity for Vulnerabilities (google_scc.finding.severity -> vulnerability.severity, google_scc.finding.resource.project.name -> cloud.project.id)
  • Top 5 Projects by Severity for Threats (google_scc.finding.resource.project.name -> cloud.project.id)

Finding Essentials Details

  organization.id
- google_scc.finding.name
+ resource.id
  google_scc.finding.category
  google_scc.finding.class
  google_scc.finding.severity
- google_scc.finding.resource.project.name
- event.created
- google_scc.finding.security_marks.name
- google_scc.finding.parent
+ cloud.project.id
+ google_scc.finding.security_marks.name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like mainly ECS fields are used inside dashboards over custom fields. Could you add that to commit message?

…leet health status updates in the httpjson input. Adding do_not_log_failure: true helps prevent the logging of expected failures, which were previously resulting in test failures
@brijesh-elastic
Copy link
Collaborator Author

/test

@brijesh-elastic brijesh-elastic requested a review from kcreddy July 31, 2025 10:28
- name: id
type: keyword
description: The ID of the resource.
- name: name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kcreddy @brijesh-elastic for example this I believe is covered by ecs@mappings even though resource is not a part of ECS itself. In the component template dynamic templates are being used which match by *.name for example

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is with pipeline tests. Any non-ECS field inside the *expected.json file must be explicitly defined. Otherwise they fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, I wonder if it's smth we want to improve going forward, or is it an expected safety net? It just doesn't match well the dynamic approach taken by ecs@mappings

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safety and also to do with preferring explicit mappings over dynamic mappings for Elasticsearch performanc.e

move_on_creation: true
latest:
unique_key:
- event.id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need event.id here. Isn't a combination of rule.uuid and resource.id unique?

Copy link
Collaborator Author

@brijesh-elastic brijesh-elastic Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will be required.
rule.uuid is not present in most of the cases. So, we must have to add event.id to be unique.

move_on_creation: true
latest:
unique_key:
- event.id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, the combination of resource.id, package.name and package.version should be unique enough. This way we make sure that we don't have duplicated findings, eg. if event.id is generated for each change in the finding (eg. change of the status) we might have N finding documents for each (resource.id, package.name,package.version)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in here too, it will be required.
There are cases that combination of resource.id, package.name, package.version isn't unique.

Copy link
Contributor

@maxcold maxcold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, great work! Tested on the provided env, CDR flows work as expected.
Before approving I want to clarify the usage of event.id for the transform uniqueness

Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

@brijesh-elastic brijesh-elastic requested a review from kcreddy August 4, 2025 09:12
@maxcold maxcold self-requested a review August 4, 2025 16:26
Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brijesh-elastic, since the CI is failing on a known issue elastic/beats#45664, can you skip failing system tests for source and asset data streams where its failing? We can add them back after fix is made by updating kibana version.

Example:

skip:
reason: "Support backward compatibility of Current AWS package."
link: https://github.com/elastic/integrations/issues/3695
service: securityhub

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @brijesh-elastic

Copy link

Quality Gate failed Quality Gate failed

Failed conditions
53.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brijesh-elastic brijesh-elastic merged commit 9110393 into elastic:main Aug 8, 2025
8 of 9 checks passed
@elastic-vault-github-plugin-prod

Package google_scc - 2.0.0 containing this change is available at https://epr.elastic.co/package/google_scc/2.0.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change dashboard Relates to a Kibana dashboard bug, enhancement, or modification. documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:google_scc Google Security Command Center Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors]
Projects
None yet
4 participants