-
Notifications
You must be signed in to change notification settings - Fork 290
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
Make allowed kubectl commands configurable #284
Conversation
@girishg4t could you please resolve the errors in CI build? |
@PrasadG193 fixed the issue in test case |
test/resource_config.yaml
Outdated
@@ -207,6 +207,13 @@ settings: | |||
kubectl: | |||
# Set true to enable kubectl commands execution | |||
enabled: true | |||
# List of allowed commands |
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.
extra leading space?
# List of allowed commands | |
# List of allowed commands |
test/resource_config.yaml
Outdated
# List of allowed commands | ||
commands: | ||
# method which are allowed | ||
verbs: ["api-resources","api-versions","cluster-info","describe","diff","explain","get","logs","top","auth"] |
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.
verbs: ["api-resources","api-versions","cluster-info","describe","diff","explain","get","logs","top","auth"] | |
verbs: ["api-resources", "api-versions", "cluster-info", "describe", "diff", "explain", "get", "logs", "top", "auth"] |
@girishg4t We should also allow if someone uses singular resource name - like |
@PrasadG193 i have made the changes as per review comments please check |
@girishg4t This is yet to be resolved #284 (comment) |
@PrasadG193 is this not the one ? |
If user configured access with -
Will they be able to execute |
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
af7dd4e
to
f9ac20c
Compare
@girishg4t [minor] ideally PR heading should be one-liner summary of what you have done. It should inform reader what is the PR about. Please follow this while creating PR next time 🙂 |
@girishg4t I've done a few changes as per the discussion. Going to merge once CI passes. PTAL |
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
1e858a2
to
8ef642d
Compare
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
ISSUE TYPE
SUMMARY
Added configuration in resource_config.yaml for limiting kubectl commands as per the discussion given in ticket 183
The configuration added is used in
slack.go and mattermost.go to pass it to executor.go and used to limit the commands execution
Fixes #183