Skip to content

[Cloud Security] Add aws prefix to CSPM vars #14923

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

Closed
wants to merge 2 commits into from

Conversation

seanrathier
Copy link
Contributor

Proposed commit message

Add aws prefix to CSPM vars

This change is needed so we can use the same input variables for CSPM and Cloud Asset Inventory in order to make integration with the CloudSetup component.

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

Related issues

@seanrathier seanrathier self-assigned this Aug 13, 2025
@seanrathier seanrathier requested a review from a team as a code owner August 13, 2025 16:44
@seanrathier seanrathier added enhancement New feature or request breaking change Team:Cloud Security Cloud Security team [elastic/cloud-security-posture] labels Aug 13, 2025
@seanrathier seanrathier requested a review from Copilot August 13, 2025 16:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an aws prefix to CSPM (Cloud Security Posture Management) variable names to enable shared input variables between CSPM and Cloud Asset Inventory components for CloudSetup integration.

  • Prefixed AWS credential-related variables with aws. namespace (e.g., access_key_idaws.access_key_id)
  • Maintained backward compatibility by supporting both old and new variable names in templates
  • Updated package version to 4.0.0-preview01 to reflect the significant change

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/cloud_security_posture/manifest.yml Updated package version to 4.0.0-preview01
packages/cloud_security_posture/data_stream/findings/manifest.yml Added aws prefix to credential variable names in stream configurations
packages/cloud_security_posture/data_stream/findings/agent/stream/aws.yml.hbs Added support for both old and new prefixed variable names in Handlebars template
packages/cloud_security_posture/changelog.yml Added changelog entry documenting the AWS variable prefix enhancement

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@@ -23,21 +23,39 @@ config:
{{#if access_key_id}}
Copy link
Preview

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

The template now contains duplicate conditional blocks for both old and new variable names (e.g., access_key_id and aws.access_key_id). This duplication makes the template harder to maintain. Consider consolidating these into a single conditional or adding a comment explaining the backward compatibility strategy and deprecation timeline.

Copilot uses AI. Check for mistakes.

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link

💚 Build Succeeded

cc @seanrathier

Copy link

@andrewkroh andrewkroh added the Integration:cloud_security_posture Security Posture Management label Aug 13, 2025
@@ -15,6 +15,11 @@
# 1.4.x - 8.9.x
# 1.3.x - 8.8.x
# 1.2.x - 8.7.x
- version: "4.0.0-preview01"
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the reasoning behind major version upgrade?
So far, we kept it in sync with major stack versions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are at version 3. I perceived this to be a breaking change, warranting a major version change.

@@ -23,21 +23,39 @@ config:
{{#if access_key_id}}
access_key_id: {{access_key_id}}
{{/if}}
{{#if aws.access_key_id}}
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if both access_key_id and aws.access_key_id are available?

I believe only one should be used to resolve source of truth

access_key_id is deprecated and its content is migrated to aws.access_key_id. then I'd use aws.access_key_id when available, and when not I'll check for access_key_id for compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was doing that in the aws.hbs file, the change checks for both values with and without the aws prefix. Or so I thought that was the solution you were referring to in DMs.

However, this change does not address showing the Fleet extension in Kibana for older versions of the integration; therefore, I am going to close this PR and have a CloudSetup mapping

- version: "4.0.0-preview01"
changes:
- description: Changed AWS input vars with aws. prefix
type: enhancement
Copy link
Member

Choose a reason for hiding this comment

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

I noticed the GH PR is labeled with breaking change but that's not in agreement with the changelog type. Assuming it's a breaking change that affects end users then I would expect to have a changes item with type: breaking-change explaining the impact and how users can handle the breaking change when they upgrade.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andrewkroh, I was pretty sure that this would be a breaking eventually, however I managed to find a different path in Kibana to fix this issue so I will be closing this.

I will add the correct type next time.

@seanrathier
Copy link
Contributor Author

I am closing this PR because there is a path in Kibana that is less risky and to support older versions of the CSPM integration.

@seanrathier seanrathier deleted the update-cspm-aws-vars branch August 19, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration:cloud_security_posture Security Posture Management Team:Cloud Security Cloud Security team [elastic/cloud-security-posture]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants