Enforce dedicated service account for Cloud Build triggers#110
Enforce dedicated service account for Cloud Build triggers#110alex-doudou wants to merge 2 commits intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the security posture for Cloud Build triggers by mandating the use of dedicated service accounts. It ensures that triggers operate with the principle of least privilege, thereby reducing potential security risks. The changes primarily involve updating documentation to guide users through the process of setting up and assigning appropriate roles to these dedicated service accounts, and explicitly requiring their use when creating new triggers. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the how_to_create_cloudbuild_trigger.md documentation to include a new section on ensuring a dedicated service account is used for Cloud Build triggers, detailing the creation process and required roles, and emphasizes providing this service account to the create_build_trigger tool. Feedback indicates a critical discrepancy where the create_build_trigger tool does not enforce the use of a dedicated service account, potentially leading to security issues, and suggests modifying the tool to require this parameter. Additionally, a minor markdown formatting issue was noted in a new heading.
| ## ## Final Step: Creating the Trigger | ||
|
|
||
| Once all prerequisites are met, the agent can create the trigger itself using the available tools. No newline at end of file | ||
| Once all prerequisites are met, the agent can create the trigger itself using the `create_build_trigger` tool. **You MUST provide the email of the dedicated service account identified or created in Step 4 to the `service_account` parameter.** No newline at end of file |
There was a problem hiding this comment.
This documentation mandates the use of a dedicated service account, which is an important security best practice. However, the implementation of the create_build_trigger tool (in cicd-mcp-server/cloudbuild/cloudbuild.go) doesn't enforce this. The service_account parameter is optional, and if omitted, the tool silently falls back to the default Compute Engine service account. This creates a significant discrepancy between the documentation's requirement and the tool's behavior, potentially leading to the use of an over-privileged service account. To align with the goal of this PR, the create_build_trigger tool should be modified to require the service_account parameter.
There was a problem hiding this comment.
Addressed in the follow-up commit. (will squash after human review is approved)
| 4. **Check for Repository Link**: Check if a repository link for that specific URI already exists within the Developer Connect connection. | ||
| 5. **Create Repository Link (if needed)**: If the link does not exist, create it. This link is the resource that the Cloud Build trigger will formally point to. | ||
|
|
||
| ### ### 4. Ensure Dedicated Service Account Exists |
There was a problem hiding this comment.
db5b0c4 to
d4977c4
Compare
|
Added the follow up commit to enforce the service account behaviour in our go tool as well. The commit:
|
dc2b7c9 to
ab401d5
Compare
ab401d5 to
da645fe
Compare
This PR:
how_to_create_cloudbuild_trigger.mdto include a mandatory step for creating/using a dedicated service account.