Skip to content
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

Adopt Secrets in Cloud Posture Management #8604

Merged

Conversation

romulets
Copy link
Member

@romulets romulets commented Nov 29, 2023

What

Adopt Secrets in Cloud Posture Management

Based on elastic/package-spec#665 definition of what is possibly a secret the following the keys were labeled as secrets:

  • cloudbeat/cis_eks
    • session_token
  • cloudbeat/cis_aws
    • secret_access_key
  • cloudbeat/cis_azure
    • azure.credentials.client_secret
    • azure.credentials.client_password
    • azure.credentials.client_certificate_password

Based on the criteria used of what potentially is a secret, more fields would have been classified as secret. Below you can find why they were not:

  • cloudbeat/cis_eks
    • session_token
      • Not flagged as secret because it's a temporary token
  • cloudbeat/cis_aws
    • session_token
      • Not flagged as secret because it's a temporary token

Why

Adoption of secrets is a kibana wide effort to remove the possibility of secrets leaks in kibana (via system logs/audit or humans)

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.

Author's Checklist

  • Test all integrations with secrets and validate that Posture Management still properly works

Related issues

Screenshots

Example of stored secret:

ezgif com-video-to-gif

@romulets romulets added the enhancement New feature or request label Nov 29, 2023
@romulets romulets self-assigned this Nov 29, 2023
@romulets romulets requested a review from a team as a code owner November 29, 2023 12:15
@romulets romulets force-pushed the 7380/adopt-secrets-posture-security-mgmt branch 2 times, most recently from 230a0b1 to a572eb3 Compare November 29, 2023 12:17
@elasticmachine
Copy link

elasticmachine commented Nov 29, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-12-04T13:20:55.350+0000

  • Duration: 17 min 37 sec

Test stats 🧪

Test Results
Failed 0
Passed 4
Skipped 0
Total 4

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Nov 29, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (0/0) 💚
Files 100.0% (0/0) 💚 21.429
Classes 100.0% (0/0) 💚 21.429
Methods 25.0% (2/8) 👎 -60.269
Lines 100.0% (0/0) 💚 14.149
Conditionals 100.0% (0/0) 💚

@jeniawhite
Copy link
Contributor

@romulets
Looking at AWS V4 auth signature (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html).
There is an X-Amz-Security-Token header that holds the session token (has to be provided as part of the request).
This header is part of the generated signed URL.
Due to that, I think that is it safe to assume that the session token is not a secret.
It looks like the behavior should be similar to the AWS access key ID (visible and present at the request as well).
I assume that AWS wouldn't assign it to signed URLs as a visible header if it should have been considered as a secret like the secret key ID.
We can still decide to treat them as secrets but I do not think that it is a must.

@romulets romulets force-pushed the 7380/adopt-secrets-posture-security-mgmt branch from a572eb3 to f020514 Compare November 29, 2023 14:33
@romulets
Copy link
Member Author

romulets commented Nov 30, 2023

Tested with CSPM AWS.

Secrets are stored properly and properly retrieved in cloudbeat

Kibana configuration
image

Cloudbeat findings:
image

After a call with @amirbenun we agreed that testing one integration is enough, because cloudbeat doesn't do anything special to retrieve configurations our secrets. This piece is all automatically handled by the elastic/beats library and fleet-server implementation. Therefore if it works for one CSPM AWS, other CSPM and KSPM should have no further problems.

@oren-zohar do you agree with the above statement?

@oren-zohar oren-zohar requested a review from amirbenun December 4, 2023 09:34
@romulets romulets force-pushed the 7380/adopt-secrets-posture-security-mgmt branch from f448753 to ff435a3 Compare December 4, 2023 13:20
@romulets romulets merged commit 3431bbe into elastic:main Dec 4, 2023
1 check passed
@romulets romulets deleted the 7380/adopt-secrets-posture-security-mgmt branch December 4, 2023 13:39
@elasticmachine
Copy link

Package cloud_security_posture - 1.7.0-preview07 containing this change is available at https://epr.elastic.co/search?package=cloud_security_posture

@elasticmachine
Copy link

Package cloud_security_posture - 1.7.0-preview08 containing this change is available at https://epr.elastic.co/search?package=cloud_security_posture

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants