-
Notifications
You must be signed in to change notification settings - Fork 45
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
salt/auth: Add groups support for bearer auth #2068
salt/auth: Add groups support for bearer auth #2068
Conversation
Hello teddyandrieux,My role is to assist you with the merge of this Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
|
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
The following reviewers are expecting changes from the author, or must review again: |
@@ -12,7 +12,10 @@ Feature: SaltAPI | |||
Scenario: Login to SaltAPI using a ServiceAccount | |||
Given the Kubernetes API is available | |||
When we login to SaltAPI with the ServiceAccount 'storage-operator' | |||
Then we can invoke '["disk.dump", "state.sls"]' on '*' | |||
Then we can ping all minions |
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.
Basically, the fact that this test requires changes shows that there's an issue somewhere in the implementation. This test should remain as-is.
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.
Btw this test do not require change but since storage-opeator
is able to do a *
on nodes
he also have this perms.
Basically storage-operator perms in this PR are:
"perms": [
{
"*": [
"disk.dump",
"state.sls"
]
},
"@jobs",
{
"*": [
".*"
]
},
"@wheel",
"@runner",
"@jobs"
],
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.
But it shouldn't have those perms?!? https://github.com/scality/metalk8s/blob/development/2.4/storage-operator/deploy/role.yaml
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.
As the cluster role say that he can do *
on nodes the check we do for groups is approved so we add node-admin groups thats why but if we dont want that the storage operator can do this then we need to either change the check from groups function or changes the rule of his cluster role
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.
Oh right, I read the Role too fast. Then that would be a bug I guess, we shouldn't give that many permissions to storage-operator
.
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.
From this issue, it seems we should not have kept the default ClusterRole that gets created when the project is initialized with operator-sdk new
. Since operator-sdk generate k8s
doesn't generate this file, it would make sense to update it to match our needs and commit it.
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.
See #2084
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.
Then it's not part of this PR, because we may want to fix it also in 2.4
1d4b15a
to
4859253
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
|
Currently we have no permissions when using bearer token auth, add a groups function to authenticate bearer auth using the same approach as the basic auth for the moment
d90f001
to
9d7e63d
Compare
Add a fixture to create an Admin ServiceAccount for test purpose. This fixture create a ServiceAccount and a ClusterRoleBinding to bind this new ServiceAccount to `cluster-admin` ClusterRole
Add test that a ServiceAccount bind to `cluster-admin` ClusterRole is able to everything with salt-api
/approve |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
The following options are set: approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue None. Goodbye teddyandrieux. |
Component:
'salt', 'tests'
Context:
Currently we have no permissions when using bearer token auth
Summary:
add a
groups
function to authenticate bearer auth using the same approach asthe basic auth for the moment
Also update test accordingly