fix(adk): write materialized secret files with 0600 permissions#2011
Open
mesutoezdil wants to merge 1 commit into
Open
fix(adk): write materialized secret files with 0600 permissions#2011mesutoezdil wants to merge 1 commit into
mesutoezdil wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR tightens default security behavior by removing privileged container settings that were previously introduced by “skills”, and by restricting on-disk config materialization to owner-only permissions.
Changes:
- Remove default
securityContext.privileged=truebehavior for skills and update associated golden test outputs. - Simplify skills runtime manifest building by no longer toggling a shared “code exec isolation” flag from the skills path.
- Write materialized config files with
0600permissions and add tests asserting file modes.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| go/core/internal/controller/translator/agent/testdata/outputs/agent_with_skills.json | Updates golden output to remove privileged securityContext for skills containers. |
| go/core/internal/controller/translator/agent/testdata/outputs/agent_with_git_skills.json | Updates golden output to remove privileged securityContext for git-skills containers. |
| go/core/internal/controller/translator/agent/security_context_test.go | Updates expectations so skills do not add a container SecurityContext; clarifies PSS Restricted behavior. |
| go/core/internal/controller/translator/agent/manifest_builder.go | Removes needCodeExecIsolation mutation from buildSkillsRuntime and updates call site. |
| go/adk/pkg/config/config_materialize.go | Writes config files with 0600 instead of 0644. |
| go/adk/pkg/config/config_loader_test.go | Adds assertions that materialized files are created with 0600 permissions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8b2ab91 to
07dd6b6
Compare
config.json contains model API keys and kagent-token is a k8s service account token. Writing them world-readable (0644) exposes credentials to other processes in the container. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
07dd6b6 to
3226d4c
Compare
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.
config.jsoncontains model API keys (e.g. OpenAIapi_key)kagent-tokenis a k8s service account token injected viaKAGENT_TOKENin substrate mode0644(world-readable), changed to0600(owner-only)TestMaterializeFromEnvto catch regressions