-
Notifications
You must be signed in to change notification settings - Fork 1
feat: let devs specify an existing secret #14
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
feat: let devs specify an existing secret #14
Conversation
WalkthroughAdds Helm validation for required JIT settings, introduces optional use of an existing Kubernetes Secret, updates secret rendering to be conditional on that option, and centralizes secret name resolution via a helper. Values and schema are updated to document and support both authentication modes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User Values
participant H as Helm Template Engine
participant V as validateValues
participant S as Secret Template
participant J as _job_helper.tpl
U->>H: Provide .Values (jit.clientId/Secret or jit.existingSecret)
H->>V: include "jit-k8s-agent.validateValues"
alt Invalid configuration
V-->>H: fail with guidance
else Valid configuration
V-->>H: continue
H->>S: Render secret.yaml
alt existingSecret set
S-->>H: Skip Secret creation
else existingSecret not set
S-->>H: Create Secret with JIT_CLIENT_ID/SECRET
end
H->>J: Resolve {{ $jitCredentialsSecret }}
J-->>H: Use existingSecret or default {{ .Chart.Name }}-jit-credentials
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
🧰 Additional context used🪛 YAMLlint (1.37.1)charts/jit-k8s-agent/templates/secret.yaml[error] 1-1: syntax error: expected the node content, but found '-' (syntax) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (7)
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, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
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.
❌ The following Jit checks failed to run:
- secret-detection
#jit_bypass_commit in this PR to bypass, Jit Admin privileges required.
More info in the Jit platform.
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.
Changes look good. There is one helm-lint that we should fix - https://github.com/jitsecurity/helm-charts/actions/runs/18201751540/job/52218011560?pr=14.
Moreover, let's update the README as well to indicate that the chart supports existing secret.
|
Implemented in - #15. |
Motivation: prevent storing clientId and Secret in Gitops repos
Tests:
Summary by CodeRabbit