OLS-3858: Scope analysis identity to its run namespace - #439
Conversation
Signed-off-by: waveywaves <11972233+waveywaves@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe operator now creates a scoped analysis ServiceAccount for each ChangesPer-run analysis identity
Sequence Diagram(s)sequenceDiagram
participant AgenticRun
participant ensureAnalysisIdentity
participant Agent
participant cleanupAnalysisIdentity
participant KubernetesAPI
AgenticRun->>ensureAnalysisIdentity: ensure analysis identity
ensureAnalysisIdentity-->>AgenticRun: return ServiceAccount name
AgenticRun->>Agent: Analyze with scoped ServiceAccount
Agent-->>AgenticRun: return analysis result
AgenticRun->>cleanupAnalysisIdentity: clean up after analysis or terminal event
cleanupAnalysisIdentity->>KubernetesAPI: delete analysis RBAC and ServiceAccount
KubernetesAPI-->>cleanupAnalysisIdentity: return deletion result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @waveywaves. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.ai/spec/what/sandbox-execution.md:
- Around line 100-102: Choose one execution identity contract and apply it
consistently: either make execution ServiceAccount usage conditional on
requested RBAC rules, or update the controller to always provision and use
executionSAName(run), including when no RBAC rules are present. Update the
execution identity requirements in .ai/spec/what/sandbox-execution.md lines
100-102 and the isolation summary and Execution row in docs/rbac.md lines
130-138 to describe the same behavior; both documentation sites require changes.
- Line 55: Reconcile the analysis Result RBAC requirements across Rule 8a, Rule
36a, and the constraint near the Result permission statement: exclude analysis
from the shared lightspeed-agent Result-writer requirement, and ensure the
per-run analysis identity remains unable to write Results. If analysis must
publish a Result, define the separately enforced expected-result-name writer
path required by Rule 20a rather than granting namespace-wide Result
permissions.
In `@docs/rbac.md`:
- Around line 109-112: Update the “Dynamic analysis identity (per-AgenticRun)”
documentation to state that the identity is also deleted when analysis is
suspended, and that cleanup failures trigger reconciliation retry/requeue.
Preserve the existing post-analysis and terminal/finalizer cleanup details.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 11d93f3c-59ba-4c7c-8ca6-25ee9430d62a
⛔ Files ignored due to path filters (1)
config/rbac/role.yamlis excluded by!config/rbac/role.yaml
📒 Files selected for processing (7)
.ai/spec/what/sandbox-execution.mdcontroller/agenticrun/analysis_identity.gocontroller/agenticrun/analysis_identity_test.gocontroller/agenticrun/handlers.gocontroller/agenticrun/reconciler.gocontroller/agenticrun/reconciler_test.godocs/rbac.md
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift/lightspeed-agentic-sandbox(manual)
Signed-off-by: waveywaves <11972233+waveywaves@users.noreply.github.com>
|
@waveywaves: This pull request references OLS-3858 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Summary
pods/logpermission.targetNamespacesfrom widening analysis access and grant no Secret or Result write permission.Test plan
make manifestsmake testmake vetmake api-lintmake build