Skip to content

Add new AWS Config datastream. #13830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 28, 2025
Merged

Conversation

muskan-agarwal26
Copy link
Contributor

Proposed commit message

This release includes the Config data stream for supporting config findings via REST API.

AWS Config fields are mapped to their corresponding ECS fields where possible. Also added associated dashboards and visualizations.

Test samples were derived from live logs.

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/aws directory.
  • Run the following command to run tests.

elastic-package test

2025/05/07 21:50:34  INFO New version is available - v0.111.0. Download from: https://github.com/elastic/elastic-package/releases/tag/v0.111.0
Run system tests for the package
2025/05/07 21:50:35  INFO License text found in "/root/ELASTIC_PROJECT/github/integrations/LICENSE.txt" will be included in package
2025/05/07 21:51:45  INFO Write container logs to file: /root/ELASTIC_PROJECT/github/integrations/build/container-logs/config-1746634905423590657.log
2025/05/07 21:51:50  INFO Write container logs to file: /root/ELASTIC_PROJECT/github/integrations/build/container-logs/elastic-agent-1746634910377459951.log
--- Test results for package: aws - START ---
╭─────────┬─────────────┬───────────┬───────────┬────────┬───────────────╮
│ PACKAGE │ DATA STREAM │ TEST TYPE │ TEST NAME │ RESULT │  TIME ELAPSED │
├─────────┼─────────────┼───────────┼───────────┼────────┼───────────────┤
│ aws     │ config      │ system    │ default   │ PASS   │ 55.030876912s │
╰─────────┴─────────────┴───────────┴───────────┴────────┴───────────────╯
--- Test results for package: aws - END   ---
Done

Related issues

Screenshots

config-1
config-2

@muskan-agarwal26 muskan-agarwal26 requested review from a team as code owners May 7, 2025 16:27
@andrewkroh andrewkroh added Crest Contributions from Crest developement team. dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:aws AWS Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] labels May 7, 2025
@elasticmachine
Copy link

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

@kcreddy
Copy link
Contributor

kcreddy commented May 7, 2025

/test

@muskan-agarwal26 muskan-agarwal26 marked this pull request as draft May 8, 2025 05:09
@muskan-agarwal26 muskan-agarwal26 marked this pull request as ready for review May 9, 2025 18:36
@andrewkroh andrewkroh added the Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] label May 9, 2025
@kcreddy
Copy link
Contributor

kcreddy commented May 13, 2025

/test

Comment on lines +21 to +28
### Agentless Enabled Integration
Agentless integrations allow you to collect data without having to manage Elastic Agent in your cloud. They make manual agent deployment unnecessary, so you can focus on your data instead of the agent that collects it. For more information, refer to [Agentless integrations](https://www.elastic.co/guide/en/serverless/current/security-agentless-integrations.html) and the [Agentless integrations FAQ](https://www.elastic.co/guide/en/serverless/current/agentless-integration-troubleshooting.html).
Agentless deployments are only supported in Elastic Serverless and Elastic Cloud environments. This functionality is in beta and is subject to change. Beta features are not subject to the support SLA of official GA features.

### Agent Based Installation
- Elastic Agent must be installed
- You can install only one Elastic Agent per host.
- Elastic Agent is required to stream data from the REST API and ship the data to Elastic, where the events will then be processed via the integration's ingest pipelines.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need guidance from docs for how to provide this information.

@efd6
Copy link
Contributor

efd6 commented May 13, 2025

Also, need to add owner.

Error: package "packages/aws" shares ownership across data streams but these ones [packages/aws/data_stream/config] lack owners

1. Add config data stream entry in CODEOWNERS.
2. Update changelog entry.
3. Format CEL code as suggested.
4. Added fields into redact.
5. Changed transform version v1.
6. Used minify_json in config.yml file.
@muskan-agarwal26 muskan-agarwal26 requested a review from efd6 May 14, 2025 09:45
@efd6
Copy link
Contributor

efd6 commented May 14, 2025

/test

@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented May 15, 2025

🚀 Benchmarks report

Package aws 👍(7) 💚(12) 💔(2)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
s3access 4524.89 2375.3 -2149.59 (-47.51%) 💔
emr_logs 22727.27 17241.38 -5485.89 (-24.14%) 💔

To see the full report comment with /test benchmark fullreport

@efd6
Copy link
Contributor

efd6 commented May 15, 2025

Please address #13830 (comment).

Comment on lines 12 to 18
"delete": {
"min_age": "7d",
"actions": {
"delete": {}
}
}
}
Copy link
Contributor

@kcreddy kcreddy May 15, 2025

Choose a reason for hiding this comment

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

@maxcold, similar to this comment, this ILM policy is for security posture. Please confirm if the 7 days retention is okay on source data.

Also, this PR is adding the transform. Please confirm if you would like to test this before merging?

cc: @nick-alayil

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it definitely makes sense to test it before merging
On the ILM policy - if we ingest the full posture every 24h, then 7d retention for the source index is fine, we don't need old data in the source index.
For vulnerability data stream though it might be a different case as we have 90d retention on transform, I'm not sure how it will work with 7d on ILM, need to think about it

Copy link
Contributor

@kcreddy kcreddy May 23, 2025

Choose a reason for hiding this comment

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

On the ILM policy - if we ingest the full posture every 24h, then 7d retention for the source index is fine, we don't need old data in the source index.

@maxcold, Thanks for the confirmation. Let me know when the testing is done so we can move forward with merging.

Regarding vulnerability data_stream in https://github.com/elastic/integrations/pull/13595/files#r2079624821, what we have is a full ingestion (not incremental) every interval: 4h. So my understanding is that a similar 7d ILM on source data is going to be fine.
The CDR guides mentions 90d retention only incase the ingestion was incremental.

Copy link
Contributor

@kcreddy kcreddy May 23, 2025

Choose a reason for hiding this comment

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

I think it definitely makes sense to test it before merging

@muskan-agarwal26 @piyush-elastic, our cloud security team would like to test this feature before merging the PR. Once their testing is done, we can merge this.
cc: @nick-alayil

Copy link
Contributor

Choose a reason for hiding this comment

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

@kcreddy will let you know regarding AWS Config testing

As for the retention - if transform have retention_policy.time.max_age: 24h then having retention period of 7d on source index should be ok. I just don't see transform on m365 PR at all, that's why wasn't sure what's the approach there.

Copy link
Contributor

@kcreddy kcreddy May 26, 2025

Choose a reason for hiding this comment

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

@maxcold,

As for the retention - if transform have retention_policy.time.max_age: 24h then having retention period of 7d on source index should be ok.

Got it, thanks!

I just don't see transform on m365 PR at all, that's why wasn't sure what's the approach there.

Its also a full sync every interval default: 4h of vulnerabilities in case of M365 Defender/Defender for Endpoint PR: #13595. So, I believe a retention of 7d should be okay in that case as well.
The transform isn't added because there are still few missing MUST HAVE fields, but we did the best effort to populate fields based on CDR guide. Once we get to this integration (supporting CNVM), we can look into the missing MUST HAVE fields.

cc: @sharadcrest

@efd6
Copy link
Contributor

efd6 commented May 15, 2025

/test

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

LGTM but waiting for @kcreddy

kcreddy added a commit to kcreddy/elasticsearch that referenced this pull request May 26, 2025
…tic#128350)

Adding `logs-aws.config-*` data stream indices to the `kibana_system` privileges.
This is required for the latest transform to work.

Related:
- elastic/integrations#13830 (comment)

(cherry picked from commit 169527f)
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.

I built the integration from the PR, installed it on a cloud env 9.0.1. Here are the issues I found, we need to fix them before merging:

  1. resource.name, resource.type, rule.number are missing in the data, that's only what I can see in the data grid.
  2. the flyout opens but has no data, most likely some of the data missing but I need to dig deeper to understand what exactly

@kcreddy @muskan-agarwal26 before implementing the changes for CDR flows we were doing spreadsheet mapping of the fields required by the guide https://docs.elastic.dev/security-solution/cloud-security/cdr/3p-dev-guide . This allows to understand what crucial fields are missing or the data format is different. Has this exercise been done for AWS Config?

Screenshot 2025-05-26 at 18 05 24

elasticsearchmachine pushed a commit to elastic/elasticsearch that referenced this pull request May 27, 2025
) (#128443)

Adding `logs-aws.config-*` data stream indices to the `kibana_system` privileges.
This is required for the latest transform to work.

Related:
- elastic/integrations#13830 (comment)

(cherry picked from commit 169527f)
elasticsearchmachine pushed a commit to elastic/elasticsearch that referenced this pull request May 27, 2025
) (#128446)

Adding `logs-aws.config-*` data stream indices to the `kibana_system` privileges.
This is required for the latest transform to work.

Related:
- elastic/integrations#13830 (comment)

(cherry picked from commit 169527f)
elasticsearchmachine pushed a commit to elastic/elasticsearch that referenced this pull request May 27, 2025
) (#128444)

Adding `logs-aws.config-*` data stream indices to the `kibana_system` privileges.
This is required for the latest transform to work.

Related:
- elastic/integrations#13830 (comment)

(cherry picked from commit 169527f)
elasticsearchmachine pushed a commit to elastic/elasticsearch that referenced this pull request May 27, 2025
) (#128460)

Adding `logs-aws.config-*` data stream indices to the `kibana_system` privileges.
This is required for the latest transform to work.

Related:
- elastic/integrations#13830 (comment)

(cherry picked from commit 169527f)
@muskan-agarwal26 muskan-agarwal26 requested a review from kcreddy May 28, 2025 05:37
@kcreddy
Copy link
Contributor

kcreddy commented May 28, 2025

/test

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.

After an internal discussion, we decided not to create transform for now. This will remove the issue of #13830 (review).
@muskan-agarwal26 please remove the transform (and any related changes) from the PR.

cc: @nick-alayil @maxcold @piyush-elastic

@muskan-agarwal26 muskan-agarwal26 requested a review from kcreddy May 28, 2025 09:33
@kcreddy
Copy link
Contributor

kcreddy commented May 28, 2025

/test

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

1. Add category in manifest.
2. Update readme as suggested.
@muskan-agarwal26 muskan-agarwal26 requested a review from kcreddy May 28, 2025 10:45
@kcreddy
Copy link
Contributor

kcreddy commented May 28, 2025

/test

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. Thanks!

@kcreddy kcreddy removed request for a team May 28, 2025 11:25
@elasticmachine
Copy link

💚 Build Succeeded

History

Copy link

Copy link
Contributor

@muthu-mps muthu-mps left a comment

Choose a reason for hiding this comment

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

code owner approval!

@kcreddy kcreddy merged commit 45ff60e into elastic:main May 28, 2025
8 checks passed
@elastic-vault-github-plugin-prod

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

anupratharamachandran pushed a commit to anupratharamachandran/integrations that referenced this pull request Jun 2, 2025
This release includes the Config data stream for supporting config findings via REST API.

AWS Config fields are mapped to their corresponding ECS fields where possible. Also added associated dashboards and visualizations.

Test samples were derived from live logs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crest Contributions from Crest developement team. dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:aws AWS Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Integration] AWS Config
8 participants