-
Notifications
You must be signed in to change notification settings - Fork 9
fix(konflux): apply build pipeline service account migration #173
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
Merged
xiangce
merged 2 commits into
master
from
apply-konflux-sa-migration-module-update-router
Dec 22, 2025
Merged
fix(konflux): apply build pipeline service account migration #173
xiangce
merged 2 commits into
master
from
apply-konflux-sa-migration-module-update-router
Dec 22, 2025
+6
−4
Conversation
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConfigures Tekton pull-request and push pipelines to run under a specific Konflux build pipeline service account instead of the default taskRun template. Sequence diagram for Tekton pipeline run using Konflux build service accountsequenceDiagram
actor Developer
participant GitHub
participant Tekton_Controller
participant PipelineRun_PR
participant ServiceAccount_build_pipeline_module_update_router
participant Build_Tasks
Developer->>GitHub: Open_pull_request_or_push_commit
GitHub-->>Tekton_Controller: Webhook_event
Tekton_Controller->>PipelineRun_PR: Create_PipelineRun(docker-build-oci-ta)
PipelineRun_PR->>ServiceAccount_build_pipeline_module_update_router: Bind_taskRunTemplate_serviceAccountName
PipelineRun_PR->>Build_Tasks: Start_tasks_with_bound_ServiceAccount
Build_Tasks-->>ServiceAccount_build_pipeline_module_update_router: Use_permissions_to_access_resources
Build_Tasks-->>Tekton_Controller: Report_task_status
Tekton_Controller-->>GitHub: Update_PR_or_commit_status
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.tekton/module-update-router-push.yaml:33-34` </location>
<code_context>
pipelineRef:
name: docker-build-oci-ta
- taskRunTemplate: {}
+ taskRunTemplate:
+ serviceAccountName: build-pipeline-module-update-router
workspaces:
- name: git-auth
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Validate that the chosen service account has the minimal required permissions for both push and PR pipelines
Reusing `build-pipeline-module-update-router` for both push and PR runs might give PR executions more permissions than they need. If PRs can be triggered from forks or otherwise untrusted sources, consider a dedicated, least-privilege service account for PR builds to keep RBAC tightly scoped.
Suggested implementation:
```
pipelineRef:
name: docker-build-oci-ta
taskRunTemplate:
# Dedicated service account for push builds; PR builds SHOULD use a separate,
# least-privilege SA (e.g. `build-pipeline-module-update-router-pr`)
serviceAccountName: build-pipeline-module-update-router-push
workspaces:
```
1. In the corresponding PR pipeline file (likely `.tekton/module-update-router-pr.yaml` or similar), set `taskRunTemplate.serviceAccountName` to a distinct service account, e.g. `build-pipeline-module-update-router-pr`.
2. Define the `build-pipeline-module-update-router-push` and `build-pipeline-module-update-router-pr` ServiceAccounts in your manifests (if not already present).
3. Adjust RBAC so that:
- `build-pipeline-module-update-router-push` has the full permissions required for push builds.
- `build-pipeline-module-update-router-pr` is restricted to the minimal read/build permissions needed for PR validation, avoiding write/production-impacting permissions where possible.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Signed-off-by: Xiaoxue Wang <[email protected]>
fbd9fec to
0fb9336
Compare
Signed-off-by: Xiaoxue Wang <[email protected]>
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.
to apply #130
Summary by Sourcery
Deployment: