-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Adding SSHPortForwarding
to RoleOptions
proto
#49165
base: master
Are you sure you want to change the base?
Conversation
0f0277f
to
52a3c3a
Compare
52a3c3a
to
68c65e0
Compare
68c65e0
to
a9f61a9
Compare
🤖 Vercel preview here: https://docs-a38lfwqrd-goteleport.vercel.app/docs/ver/preview |
🤖 Vercel preview here: https://docs-7zclicyhf-goteleport.vercel.app/docs/ver/preview |
🤖 Vercel preview here: https://docs-auvan7y8n-goteleport.vercel.app/docs/ver/preview |
🤖 Vercel preview here: https://docs-bp1o04fn1-goteleport.vercel.app/docs/ver/preview |
🤖 Vercel preview here: https://docs-3r0agi8kj-goteleport.vercel.app/docs/ver/preview |
7f6cf18
to
d5ccde5
Compare
🤖 Vercel preview here: https://docs-58wo7315l-goteleport.vercel.app/docs |
d5ccde5
to
f7a10fc
Compare
🤖 Vercel preview here: https://docs-79oiwdi2g-goteleport.vercel.app/docs |
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.
The rename looks good to me . Please adjust the PR and commit message to reflect the name change though.
// Deprecated: Use SSHPortForwarding instead | ||
BoolValue PortForwarding = 3 [ | ||
(gogoproto.nullable) = true, |
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.
// Deprecated: Use SSHPortForwarding instead | |
BoolValue PortForwarding = 3 [ | |
(gogoproto.nullable) = true, | |
// Deprecated: Use SSHPortForwarding instead | |
BoolValue PortForwarding = 3 [ | |
deprecated = true, | |
(gogoproto.nullable) = true, |
// SSHPortForwardConfig defines which types of SSH port forwarding are permitted, if any. | ||
message SSHPortForwardConfig { | ||
// Allow local port forwarding. | ||
BoolValue Local = 1 [ |
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.
Should we anticipate the need to support values beyond true/false? Historically, we've struggled with two-state protos, as we often needed to introduce a third state later, which they couldn't accommodate. Would it make sense to use an enum or string to represent the state instead?
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.
Couldn't any other future restrictions be added to this message? The original Boolean field has been around this long and we haven't had too many regrets or requests to extend functionality.
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.
They can. it was just to avoid having to deprecate another field and keep supporting it because we never know when/how customers upgrade their clusters.
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.
I don't think we would need to deprecate though. Any additional features could be gated by requiring port forwarding is both enabled and is limited by new field foo.
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.
I'm actually combining these bools into a single enum in the implementation, so I could definitely see lifting that into the proto instead. The only thing I don't really like about proto enums is that they're not very nice to work with from the terraform provider since they're effectively magic numbers. That's less of a problem than the schema being inflexible, though
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.
If you end up changing to enums, please use plain strings.
Otherwise, we end up with this (as you pointed out)
https://goteleport.com/docs/reference/terraform-provider/resources/auth_preference/
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.
After mulling it over some more and talking to TIm, I think leaving them as bools might make for a better user experience. Most of the extensions I can imagine we might want to do would probably involve extending the SSHPortForwardConfig
message to contain more fields rather than modifying Local
or Remote
directly.
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.
I can see this evolving in a way that we would list the allowed ports.
Similar to TCPPorts in the App Resource: #47706
I would prefer something more flexible, but I'm ok with the current design 👍
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.
I suppose the Local
and Remote
fields could be messages themselves, which would allow us to do something like:
ssh_port_forwarding:
local:
enabled: true
ports:
- 8080
remote:
enabled: false
It's a little more verbose, but it saves us from having to add top level fields like local_ports
and remote_ports
later on 🤔 I'll think about this some more, but I might like that better
PortForwardConfig
to RoleOptions
protoSSHPortForwarding
to RoleOptions
proto
f7a10fc
to
9124e7f
Compare
🤖 Vercel preview here: https://docs-ldyoxe0lf-goteleport.vercel.app/docs |
9124e7f
to
4fc4a63
Compare
🤖 Vercel preview here: https://docs-m36rjw91c-goteleport.vercel.app/docs |
This PR is the first for enabling individual access control of both local and remote port forwarding. It adds a
SSHPortForwardConfig
message which is surfaced through theRoleOptions
message on any given role. It also marksPortForwarding
as deprecated since we'll want to encourage leveragingSSHPortForwarding
going forward. The legacyPortForwarding
boolean will still be evaluated and prioritized overSSHPortForwarding
for backwards compatibility, which I'll include some more information about in the follow up PR implementing the new config options.No changelog since this doesn't actually change any functionality and I'll cover the new options in the next PR.