Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Type:
Bug fix
PR Description:
This PR introduces a validation for the Service Account kind in the service account token mount rule. This is to ensure that only objects of kind "ServiceAccount" are processed, preventing unrelated resources from being erroneously connected as related resources. This addresses a bug where multiple objects that are not Service Accounts were connected as related resources.
PR Main Files Walkthrough:
rules/serviceaccount-token-mount/raw.rego
: Added a condition to check if the kind of the object is "ServiceAccount" before proceeding with the rest of the rule logic. This ensures that only Service Accounts are processed by the rule.User Description:
Overview
This PR validates the Service Account thus validating that the related resource is indeed related.
This fixes bug of multiple objects that are not SA that are connected as related resources.