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

AWS OIDC: Script to configure EC2 Auto Discover with SSM #41053

Merged
merged 2 commits into from
May 9, 2024

Conversation

marcoandredinis
Copy link
Contributor

There's a new teleport command that adds an inline policy which enables the AWS OIDC Integration to handle EC2 Auto Discover using the script mode (SSM).
It also adds the SSM Document used in the teleport installation.

There's also a new endpoint which returns the one off script that uses that command.

Demo:

$ teleport integration configure ec2-ssm-iam --role=MarcoTestRoleOIDCProvider --aws-region=us-east-1 --ssm-document-name=MarcoTestDoc001 --proxy-public-url=https://lenix.marcoandredinis.com:443
2024-04-30T16:42:50+01:00 INFO  IntegrationRole: IAM Policy added to Role policy:EC2DiscoverWithSSM role:MarcoTestRoleOIDCProvider awsoidc/ec2_ssm_iam_config.go:162
2024-04-30T16:42:50+01:00 INFO  SSM Document created name:MarcoTestDoc001 awsoidc/ec2_ssm_iam_config.go:180
$ teleport integration configure ec2-ssm-iam --role=MarcoTestRoleOIDCProvider --aws-region=us-east-1 --ssm-document-name=MarcoTestDoc001 --proxy-public-url=https://lenix.marcoandredinis.com:443
2024-04-30T16:42:54+01:00 INFO  IntegrationRole: IAM Policy added to Role policy:EC2DiscoverWithSSM role:MarcoTestRoleOIDCProvider awsoidc/ec2_ssm_iam_config.go:162
2024-04-30T16:42:55+01:00 INFO  SSM Document already exists name:MarcoTestDoc001 awsoidc/ec2_ssm_iam_config.go:173

@marcoandredinis marcoandredinis added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v15 labels Apr 30, 2024
@marcoandredinis marcoandredinis force-pushed the marco/awsoidc-autodiscover-ssm-iam-conf branch 2 times, most recently from 5c85902 to d78d7e2 Compare April 30, 2024 16:12
@marcoandredinis marcoandredinis marked this pull request as ready for review April 30, 2024 16:28
@marcoandredinis marcoandredinis force-pushed the marco/awsoidc-autodiscover-ssm-iam-conf branch 3 times, most recently from a909ae6 to 1b18d51 Compare May 6, 2024 14:07
@marcoandredinis
Copy link
Contributor Author

@EdwardDowling @hugoShaka Can you please take a look?

@marcoandredinis marcoandredinis force-pushed the marco/awsoidc-autodiscover-ssm-iam-conf branch from 1b18d51 to 9ab8508 Compare May 8, 2024 13:34
Copy link
Contributor

@hugoShaka hugoShaka left a comment

Choose a reason for hiding this comment

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

LGTM, my only optional nit would be to have a flag or something so the configure command does not fail and force-update the SSM document. The user could just delete it, but having a --force or --replace would provide a simple upgrade path if we need, and make the command idempotent.

@marcoandredinis
Copy link
Contributor Author

LGTM, my only optional nit would be to have a flag or something so the configure command does not fail and force-update the SSM document. The user could just delete it, but having a --force or --replace would provide a simple upgrade path if we need, and make the command idempotent.

I think we can add that later if we ever change the script.

@marcoandredinis marcoandredinis enabled auto-merge May 9, 2024 16:41
@marcoandredinis marcoandredinis added this pull request to the merge queue May 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 9, 2024
marcoandredinis and others added 2 commits May 9, 2024 18:03
There's a new teleport command that adds an inline policy which enables
the AWS OIDC Integration to handle EC2 Auto Discover using the script
mode (SSM).
It also adds the SSM Document used in the teleport installation.

There's also a new endpoint which returns the one off script that uses
that command.
@marcoandredinis marcoandredinis force-pushed the marco/awsoidc-autodiscover-ssm-iam-conf branch from e9c83a5 to 1342dd7 Compare May 9, 2024 17:03
@marcoandredinis marcoandredinis enabled auto-merge May 9, 2024 17:03
@marcoandredinis marcoandredinis added this pull request to the merge queue May 9, 2024
Merged via the queue into master with commit 0aaf1b2 May 9, 2024
40 checks passed
@marcoandredinis marcoandredinis deleted the marco/awsoidc-autodiscover-ssm-iam-conf branch May 9, 2024 17:38
@public-teleport-github-review-bot

@marcoandredinis See the table below for backport results.

Branch Result
branch/v15 Failed

marcoandredinis added a commit that referenced this pull request May 16, 2024
* AWS OIDC: Script to configure EC2 Auto Discover with SSM

There's a new teleport command that adds an inline policy which enables
the AWS OIDC Integration to handle EC2 Auto Discover using the script
mode (SSM).
It also adds the SSM Document used in the teleport installation.

There's also a new endpoint which returns the one off script that uses
that command.

* Update lib/integrations/awsoidc/ec2_ssm_iam_config.go

Co-authored-by: Edward Dowling <[email protected]>

---------

Co-authored-by: Edward Dowling <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request May 16, 2024
…1393)

* AWS OIDC: Script to configure EC2 Auto Discover with SSM

There's a new teleport command that adds an inline policy which enables
the AWS OIDC Integration to handle EC2 Auto Discover using the script
mode (SSM).
It also adds the SSM Document used in the teleport installation.

There's also a new endpoint which returns the one off script that uses
that command.

* Update lib/integrations/awsoidc/ec2_ssm_iam_config.go



---------

Co-authored-by: Edward Dowling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v15 no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants