eval: Add fix-rbac-wrong-resource eval#337
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces an evaluation to verify that a misconfigured RBAC resource is fixed correctly by ensuring that the service account only has permissions to list pods in its designated namespace while denying global pod listing.
- A new verification script (verify.sh) was created to enforce the permission checks.
- The setup script (setup.sh) simulates the misconfigured RBAC by assigning incorrect permissions.
- Accompanying task metadata (task.yaml) and cleanup script (cleanup.sh) support the eval flow.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| k8s-bench/tasks/fix-rbac-wrong-resource/verify.sh | Verifies that the fixed RBAC permissions allow listing pods in the proper namespace and reject global access. |
| k8s-bench/tasks/fix-rbac-wrong-resource/task.yaml | Defines the eval task details including prompt and script references. |
| k8s-bench/tasks/fix-rbac-wrong-resource/setup.sh | Sets up a namespace and a misconfigured RBAC role that lists deployments instead of pods. |
| k8s-bench/tasks/fix-rbac-wrong-resource/cleanup.sh | Provides cleanup by deleting the created namespace. |
Collaborator
|
Suggestion - maybe output what this benchmark looks like when you run it? |
droot
approved these changes
Jun 13, 2025
Member
Good idea! @noahlwest we should include this as a step in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds fix-rbac-wrong-resource eval. The goal of this eval is to cover the case of the agent fixing a misconfigured RBAC resource. In this case, the permissions are granted on the wrong resource type.
-verify checks for expected and denied permissions