Skip to content
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(kuma-cp) Admin User Token bootstrap #2923

Merged
merged 8 commits into from
Oct 25, 2021
Merged

Conversation

jakubdyszkiewicz
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz commented Oct 7, 2021

Summary

Bootstrap flow for Admin User Token.

We create Admin User Token for the user. The assumption is that if someone has access to Secrets, they have access to user token signing key and can do whatever they want, so we could just as well pregenerate this token for convenience.

Additionally, on Kubernetes, we will disable localhostIsAdmin setting once we switch to User Token as the default auth mechanism. We can do this since user can just access the secret directly using kubectl.
On Universal, we cannot do this, because it's expected that the user will extract it using kumactl / API. Therefore what we can do is to log a warning that it is recommended to disable this setting.

I'm considering logging bootstrap of Admin User Token is enabled... message only when Admin User Token is created, but I think it may be useful for every start of CP. What do you think?

Documentation

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

Backwards compatibility

  • No backporting.

Base automatically changed from cli-auth to master October 11, 2021 09:07
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz marked this pull request as ready for review October 11, 2021 13:22
@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team as a code owner October 11, 2021 13:22
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2021

Codecov Report

Merging #2923 (da5d8a2) into master (7e40b0f) will increase coverage by 0.07%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2923      +/-   ##
==========================================
+ Coverage   52.21%   52.29%   +0.07%     
==========================================
  Files         912      913       +1     
  Lines       52736    52804      +68     
==========================================
+ Hits        27538    27612      +74     
+ Misses      23004    22993      -11     
- Partials     2194     2199       +5     
Impacted Files Coverage Δ
test/framework/universal_cluster.go 0.00% <0.00%> (ø)
pkg/plugins/authn/api-server/tokens/plugin.go 66.66% <60.00%> (-3.34%) ⬇️
...s/authn/api-server/tokens/admin_token_bootstrap.go 82.69% <82.69%> (ø)
pkg/config/api-server/config.go 70.21% <100.00%> (+2.03%) ⬆️
pkg/core/bootstrap/bootstrap.go 65.20% <100.00%> (+0.51%) ⬆️
...ugins/authn/api-server/tokens/issuer/revocation.go 86.66% <100.00%> (+0.95%) ⬆️
pkg/core/resources/manager/cache.go 85.71% <0.00%> (ø)
api/observability/v1/mads.pb.go 35.56% <0.00%> (+1.03%) ⬆️
pkg/xds/generator/direct_access_proxy_generator.go 83.90% <0.00%> (+1.14%) ⬆️
pkg/mads/v1/client/client.go 43.75% <0.00%> (+2.50%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e40b0f...da5d8a2. Read the comment docs.

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Copy link
Contributor

@bartsmykla bartsmykla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz merged commit 3c77793 into master Oct 25, 2021
@jakubdyszkiewicz jakubdyszkiewicz deleted the token-bootstrap branch October 25, 2021 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants