Skip to content

Access Graph: sync AWS identity providers #41368

Merged
justinas merged 8 commits intomasterfrom
justinas/tag-aws-saml
May 14, 2024
Merged

Access Graph: sync AWS identity providers #41368
justinas merged 8 commits intomasterfrom
justinas/tag-aws-saml

Conversation

@justinas
Copy link
Copy Markdown
Contributor

@justinas justinas commented May 9, 2024

Updates Access Graph proto to add AWS SAML and OIDC identity providers. Adds code for fetching the providers from AWS IAM API and sending to TAG. Adds required permissions to the integration set-up script.

@justinas justinas force-pushed the justinas/tag-aws-saml branch from 28faafb to fbb4793 Compare May 9, 2024 16:04
@justinas justinas added the no-changelog Indicates that a PR does not require a changelog entry label May 9, 2024
@justinas justinas marked this pull request as ready for review May 9, 2024 16:15
@justinas justinas requested a review from tigrato May 9, 2024 16:15
Justinas Stankevicius added 5 commits May 10, 2024 16:48
The concrete implementation of IAM mock uses a map,
resulting in non-deterministic iteration order.
Sort the results before comparing to alleviate.
@justinas justinas changed the title Access Graph: sync AWS SAML Providers Access Graph: sync AWS identity providers May 10, 2024
@justinas justinas requested review from jakule and ravicious and removed request for jakule May 14, 2024 09:16
// sso_urls is a list of single sign-on service URLs for this identity provider
// sso_urls is a list of single sign-on service URLs for this identity provider.
repeated string sso_urls = 7;
// signing_certificates is a list of signing certificates for this identity provider.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What are signing_certificates used for? From reading this PR alone, I cannot tell why we need them. 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On the TAG side, we'd like to match "identity provider" defined on the AWS (relying party) side with the actual identity provider.

I looked into what could be used as a unique identifier to match them up, and SAML Entity ID was not sufficient, because e.g. in Azure / Entra, under one Entra tenant (directory), you can have multiple enterprise applications (essentially identity providers) and they will have the same Entity ID, but different SAML certificate sets. So for now we're using the SAML certificates as this unique identifier.

@justinas justinas requested a review from jakule May 14, 2024 14:06
Comment thread lib/srv/discovery/fetchers/aws-sync/iam_test.go Outdated
Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
@justinas justinas added this pull request to the merge queue May 14, 2024
Merged via the queue into master with commit 6fbfadc May 14, 2024
@justinas justinas deleted the justinas/tag-aws-saml branch May 14, 2024 17:24
justinas added a commit that referenced this pull request Jun 6, 2024
* Add AWSSAMLProviderV1 to access graph proto

* Access Graph: sync AWS SAML Providers

* Parse SAML entity descriptor before sending to TAG

* Add protos for AWS OIDC providers

* Fetch AWS OIDC providers

* Fetch signing certificates for AWS SAML providers

* Deflake identity provider fetch test

The concrete implementation of IAM mock uses a map,
resulting in non-deterministic iteration order.
Sort the results before comparing to alleviate.

* Update lib/srv/discovery/fetchers/aws-sync/iam_test.go

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
github-merge-queue Bot pushed a commit that referenced this pull request Jun 7, 2024
* Entra ID reconciler: directory reconciler prerequisites (#40778)

* Add Entra ID resource origin

* Ignore ID and Revision from `header` in cmp

* Add e_imports for MS Graph SDK

* Entra ID integration: add proto definitions (#40997)

* Entra ID integration boilerplate (#40998)

* Add e imports for MS Graph SDK

* Add ability to sign Entra ID OIDC JWTs, rework KID handling

- Synthesize Key IDs for our JWT keys. For backwards compatibility, also
  include the same keys with an empty `kid` in JWKS.
- Sign AWS OIDC tokens with a `kid=""` header claim,
  rather than omitting the `kid` claim altogether.
  See comment for details.

* Add validation for Entra ID plugin

* Fix typo in assertion function name

* Update the OIDC JWKS test to expect the same key twice

* Add Entra ID plugin type constant

* go mod tidy

* Fix expected JWKS size in integration test

* Add basic tests for KeyID

* Move Azure auth settings from Plugin to Integration

* Address review comments

* Add a unit test to ensure KeyID compatibility

* Add license header to token_generator.go

* Rename validation function per new conventions

* Access Graph: sync AWS identity providers  (#41368)

* Add AWSSAMLProviderV1 to access graph proto

* Access Graph: sync AWS SAML Providers

* Parse SAML entity descriptor before sending to TAG

* Add protos for AWS OIDC providers

* Fetch AWS OIDC providers

* Fetch signing certificates for AWS SAML providers

* Deflake identity provider fetch test

The concrete implementation of IAM mock uses a map,
resulting in non-deterministic iteration order.
Sort the results before comparing to alleviate.

* Update lib/srv/discovery/fetchers/aws-sync/iam_test.go

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

* Access Graph: Entra ID application sync prerequisites (#41650)

* Add access graph settings to Entra ID plugin

* Move Entra ID labels to OSS

* Add Entra resources and RPC to Access Graph proto

* Add azure-oidc integration to web.

Current code assumes that Integration is always either AwsOidc,
or an external audit storage integration

* Change app sso cache to a repeated field

* Entra ID integration: add onboarding script (#41811)

* Add Entra ID integration onboarding script

* Adapt after proto update

* Validate names in azure script handler, add test

* Add license headers

* Update Entra plugin test with SSO connector field

* Fix lint

* Remove leftover panics

* Adjust success message

* Downgrade log message level

* Expect exactly 1 SP for MS Graph, improve errors

* Properly extract hostname for enterprise app name

* Comment on assuming the first subscription

* Address review nits

* Factor out sso info fetch into a function

* fixup refactor

* Add retry logic to app role assignment

* Make godoc conventional

* Entra ID integration: integration script updates and web onboarding prerequisites (#42172)

* Remove integration name validation from web script

Not used by the script. It is validated by the "plugins/validate"
endpoint.

* Add required frontend constants for Entra ID

* Support Azure/Entra integrations in the list

* Add IsPolicyEnabled to web config

* Allow custom URL for ButtonLockedFeature

* Add CTA_ENTRA_ID event type

* Expose TAGInfoCache for use in e

* Add LackingIgs option

* Add Entra ID icon

* Add Entra ID plugin to storybook

* Bump e for dev build

* Return underlying error in getPrivateAPIToken

* Find default Azure subscription instead of the first one

* Require user to re-login when provisioning Azure OIDC

* Update prehog protos with Entra ID values

From https://github.com/gravitational/cloud/pull/9111

* Suppress verbose warnings / information from az

* Add an additional message after successful auth

Lets user know that `az login` has completed
and `teleport` is continuing its work.

* Move EntraId constant to the bottom

* Revert unintended changes to usageevents

CTA is 1-to-1 with prehog, but IntegrationEnrollKind is not.

* Remove integrationName validation asserts from test

This parameter is no longer accepted by the endpoint

* Revert "Bump e for dev build"

This reverts commit fc747a0.

* `go mod tidy` secondary modules

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discovery 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