-
Couldn't load subscription status.
- Fork 2.1k
cmd/tailscale/cli,feature: add support for identity federation #17529
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
Conversation
3a9a986 to
2e648e5
Compare
2e648e5 to
0e8c3df
Compare
| } | ||
| // Try to resolve the auth key via workload identity federation if that functionality | ||
| // is available and no auth key is yet determined. | ||
| if f, ok := tailscale.HookResolveAuthKeyViaWIF.GetOk(); ok && authKey == "" { |
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.
Note for future us to double check if we have credential precedence documented somewhere and will need to add this as a result
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.
Yeah it'll be worth mentioning in the command doc
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.
Consider calling this from ResolveAuthKey instead? That way it'll work in tsnet too (the original purpose of my ResolveAuthKey PR was to move common logic out into a place where both the CLI and tsnet could use 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.
ResolveAuthKey & ResolveAuthKeyViaWIF diverge enough that it feels best to keep them separate. They'll grow apart even more as we expand the ResolveAuthKeyViaWIF implementation while we work on the GA release.
For our beta release we do not plan to support tsnet just yet. We want a bit more time in the incubator before we cover more than tailscale up.
| return authkey, nil | ||
| } | ||
|
|
||
| func parseOptionalAttributes(clientID string) (ephemeral bool, preauthorized bool, err error) { |
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.
Nit: might be good to put this somewhere common that can be used by the resolveAuthKey path as a followup
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.
Do you know where it'd be appropriate to share code between different hooks? I tried to find a common place but nothing seemed obvious.
0e8c3df to
98effb6
Compare
98effb6 to
1e1dbd6
Compare
|
@tendstofortytwo sup, adding you to this PR since you worked on |
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.
hey! I'm on PTO so this isn't super thorough, just did a quick pass 😅 consider asking in #client if you haven't already
cmd/tailscale/cli/up.go
Outdated
| upf.BoolVar(&upArgs.advertiseDefaultRoute, "advertise-exit-node", false, "offer to be an exit node for internet traffic for the tailnet") | ||
| upf.BoolVar(&upArgs.postureChecking, "report-posture", false, hidden+"allow management plane to gather device posture information") | ||
| upf.StringVar(&upArgs.wifClientID, "wif-client-id", "", "Client ID used to generate authkeys via workload identity federation") | ||
| upf.StringVar(&upArgs.wifIDToken, "wif-id-token", "", "ID token from the identity provider to exchange with the control server for workload identity federation") |
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.
maybe worth gating on the feature being present?
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.
Sorry can you explain what you mean or give me an example? I don't see other arguments being conditionally gated.
| } | ||
| // Try to resolve the auth key via workload identity federation if that functionality | ||
| // is available and no auth key is yet determined. | ||
| if f, ok := tailscale.HookResolveAuthKeyViaWIF.GetOk(); ok && authKey == "" { |
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.
Consider calling this from ResolveAuthKey instead? That way it'll work in tsnet too (the original purpose of my ResolveAuthKey PR was to move common logic out into a place where both the CLI and tsnet could use it)
Sorry didn't know you were on PTO, I'll ask in #client thanks! |
6ffb19e to
3f3eeed
Compare
Add new arguments to `tailscale up` so authkeys can be generated dynamically via identity federation. Updates #9192 Signed-off-by: mcoulombe <max@tailscale.com>
3f3eeed to
ed90cc4
Compare
Add new arguments to
tailscale upso authkeys can be generated dynamically via identity federation.Example command:
Updates #9192