elastic / cloudbeat

Analyzing Cloud Security Posture
Other
38 stars 43 forks source link

Use substring check for EKS cluster name provider #2227

Closed therealdwright closed 1 month ago

therealdwright commented 1 month ago

Summary of your changes

Karpenter managed clusters will use aws:eks:cluster-name for its cluster name tag. This commit updates the logic to use a substring check so both the existing tag of eks:cluster-name and karpenter are supported.

Related Issues

Checklist

mergify[bot] commented 1 month ago

This pull request does not have a backport label. Could you fix it @therealdwright? 🙏 To fixup this pull request, you need to add the backport labels for the needed branches, such as:

github-actions[bot] commented 1 month ago

:bar_chart: Allure Report - :green_heart: No failures were reported.

Result Count
🟥 Failed 0
🟩 Passed 359
⬜ Skipped 33
moukoublen commented 1 month ago

Hello @therealdwright, and thanks for opening the issue and the PR,

One minor concern: Would it be safer to compare using ends with instead of contains?

I am not sure if it's actually needed. I just thought of cases where tags could perhaps contain eks:cluster-name in the name but refer to a different thing.

therealdwright commented 1 month ago

I think this is a fair criticism and I am only personally interested in ends with but was trying to be robust but happy to boil this one down to YAGNI.

moukoublen commented 1 month ago

LGTM

Thanks @therealdwright!

therealdwright commented 1 month ago

Thanks @moukoublen - would you have any idea which elastic-agent release this will be in?

moukoublen commented 1 month ago

@therealdwright most probably 8.15.0.