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

Add IAM Method support to Wizard #10972

Closed
russjones opened this issue Mar 8, 2022 · 13 comments
Closed

Add IAM Method support to Wizard #10972

russjones opened this issue Mar 8, 2022 · 13 comments
Assignees

Comments

@russjones
Copy link
Contributor

russjones commented Mar 8, 2022

Investigate and propose adding IAM method support to the "Add Server" wizard.

@russjones
Copy link
Contributor Author

russjones commented Mar 8, 2022

Potential approach.

image

@mcbattirola
Copy link
Contributor

mcbattirola commented Mar 22, 2022

@russjones @xinding33

Here's a PR adding capabilities for the web ui generate a iam method join token using the web API: #11339

We can add a new tab IAM on the Add Server button in the web UI, ask the users for AWS accounts and arn (optional). Since multiple rules are allowed, new fields can be added.

Here's a proposal, please let me know your thoughts:

Screenshot from 2022-03-22 13-39-27

Screenshot from 2022-03-22 11-35-01
(multiple rules)


The docs suggest that this method could be used for starting multiple agents, maybe we should add this information and allow the user to set a custom TTL?


Draft PR for this proposed solution: gravitational/webapps#690

@rishibarbhaya-design
Copy link

iam
manually
automatically

@nklaassen
Copy link
Contributor

I should point out that it's valid to set just the AWS account, just the AWS ARN, or both.

Also there's currently no way to start a node to join with the IAM method from just the command line, a config file is necessary. Could pretty easily add the necessary command line args though to avoid the config file.

@mcbattirola
Copy link
Contributor

I should point out that it's valid to set just the AWS account, just the AWS ARN, or both.

I see, thanks for pointing that out

Also there's currently no way to start a node to join with the IAM method from just the command line, a config file is necessary. Could pretty easily add the necessary command line args though to avoid the config file.

I was able to start a node with the command line like this, am I missing something?:

 sudo /usr/local/bin/teleport start --roles=node --token=iam-token --auth-server=https://matheus13.cloud.gravitational.io:443
2022-03-23T13:10:59Z INFO [PROC:1]    Connecting to the cluster matheus13.cloud.gravitational.io with TLS client certificate. service/connect.go:146
2022-03-23T13:11:01Z INFO [PROC:1]    Node: features loaded from auth server: Kubernetes:true App:true DB:true OIDC:true SAML:true AccessControls:true AdvancedAccessWorkflows:true Cloud:true HSM:true  service/connect.go:64
2022-03-23T13:11:03Z [NODE:1:CA] INFO Cache "node" first init succeeded. cache/cache.go:716
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log. service/service.go:2113
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log/upload. service/service.go:2113
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log/upload/sessions. service/service.go:2113
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log/upload/sessions/default. service/service.go:2113
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log. service/service.go:2113
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log/upload. service/service.go:2113
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log/upload/streaming. service/service.go:2113
2022-03-23T13:11:03Z INFO [AUDIT:1]   Creating directory /var/lib/teleport/log/upload/streaming/default. service/service.go:2113
2022-03-23T13:11:03Z INFO [NODE:1]    Service is starting in tunnel mode. service/service.go:2025
2022-03-23T13:11:03Z INFO [PROC:1]    The new service has started successfully. Starting syncing rotation status with period 10m0s. service/connect.go:459
2022-03-23T13:11:04Z [NODE:PROX] INFO Connected. addr:172.31.34.115:49244 remote-addr:13.248.223.84:443 leaseID:1 target:matheus13.cloud.gravitational.io:443 reversetunnel/agent.go:403
2022-03-23T13:11:05Z [NODE:PROX] INFO Connected. addr:172.31.34.115:49248 remote-addr:13.248.223.84:443 leaseID:2 target:matheus13.cloud.gravitational.io:443 reversetunnel/agent.go:403

@nklaassen
Copy link
Contributor

@mcbattirola it should not work unless there is already an identity in /var/lib/teleport from this host previously joining the cluster, in which case it will use that instead of re-joining (the token flag will be ignored). If you clear out /var/lib/teleport the iam method should not work today without a config file

@mcbattirola
Copy link
Contributor

I see, that is exactly what was happening.
Thanks for clarifying it

@nklaassen
Copy link
Contributor

but like I said above, it should be quite easy to add a --join-method=iam command line arg, we do the same for tbot

@mcbattirola
Copy link
Contributor

Here are some updates:

The user can add one or multiple rules for the token
Each rule need either an AWS Account ID, a ARN, or both

Step two (Copy and run teleport start...) can only be shown after step one since the token will be generated after step 1.

We need a button to generate the token/command after the user is done inputting their rules.

@nklaassen @xinding33 does that make sense to you?

@pierrebeaucamp pierrebeaucamp added the blocked is blocked by another item - please include the blocker label Mar 31, 2022
@rishibarbhaya-design
Copy link

step_1

step_2

@mcbattirola
Copy link
Contributor

All branches merged (#10972 (comment))

@pierrebeaucamp
Copy link
Contributor

pierrebeaucamp commented Apr 20, 2022

Cloud is waiting for release 8.3.8 or 9.1.0

@pierrebeaucamp pierrebeaucamp removed the blocked is blocked by another item - please include the blocker label Apr 28, 2022
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

No branches or pull requests

5 participants