-
Notifications
You must be signed in to change notification settings - Fork 4
MLE-21295: Enforce automountServiceAccountToken=false #96
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
MLE-21295: Enforce automountServiceAccountToken=false #96
Conversation
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.
Pull Request Overview
This PR enforces security by setting automountServiceAccountToken=false
for MarkLogic pods in Kubernetes. This prevents automatic mounting of service account tokens, reducing the attack surface by eliminating unnecessary access to the Kubernetes API from pods.
- Added
AutomountServiceAccountToken
field to cluster and group specifications with a default value offalse
- Updated StatefulSet generation to enforce the security setting
- Updated sample configurations with new image versions
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pkg/k8sutil/statefulset.go | Added parameter and logic to set automountServiceAccountToken=false on StatefulSets |
pkg/k8sutil/marklogicServer.go | Added parameter passing for automountServiceAccountToken setting |
api/v1/marklogicgroup_types.go | Added AutomountServiceAccountToken field to MarklogicGroupSpec |
api/v1/marklogiccluster_types.go | Added AutomountServiceAccountToken field to MarklogicClusterSpec |
config/crd/bases/*.yaml | Updated CRD definitions to include automountServiceAccountToken field |
api/v1/zz_generated.deepcopy.go | Generated deep copy methods for new field |
config/samples/*.yaml | Updated sample configurations with newer image versions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
// Always enforce automountServiceAccountToken to false for security | ||
falseValue := false | ||
|
||
params := statefulSetParameters{ |
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.
[nitpick] Consider using a package-level constant for the false value instead of declaring it locally in each function. This would improve consistency and make the security requirement more explicit.
Copilot uses AI. Check for mistakes.
// Always enforce automountServiceAccountToken to false for security | ||
falseValue := false | ||
|
||
markLogicGroupParameters := &MarkLogicGroupParameters{ |
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.
[nitpick] Consider using a package-level constant for the false value instead of declaring it locally in each function. This would improve consistency and make the security requirement more explicit.
Copilot uses AI. Check for mistakes.
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.
Look Good To Me
No description provided.