Configure ArgoCD (via dex) to use Teleport's SAML IDP #32810
programmerq
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
is this possible if we are exposing argo with Teleport? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
July 2024 update: This issue has been created to track adding a preset for ArgoCD to Teleport #44077. It is expected that once complete, that will supersede this guide.
Generally, the approach is to follow Teleport as a SAML identity provider. This post is to replace steps 2-4 in that guide with ArgoCD-specific steps.
Step 2/4. Configure ArgoCD to recognize Teleport's identity provider
Obtain the Teleport saml-idp certificate authority.
tctl auth export --type saml-idp | openssl x509 -inform der > ca.pem
ArgoCD loads its configuration from ConfigMaps and secrets1. Be sure to set the
url
of your ArgoCD instance, and add the following connector to yourdex.config
in yourargocd-cm
ConfigMap2.Once this new config is applied, you should see a "LOG IN VIA TELEPORT" button in your ArgoCD interface.
Step 3/4. Obtain the service provider metadata and add it to Teleport
ArgoCD and dex do not have a method to generate the service provider metadata directly. You can use the SAML Service Provider (SP) Metadata XML Builder on
samltool.com
to assist you in creating this file.The EntityId should match the entityIssuer in the dex config. The ACS and Logout values should match the
redirectURI
in the dex config. For simplicity, they can all be set to the same value:https://argo.example.com/api/dex/callback
. Choose the "transient" option in theNameId Format
dropdown.Scroll down, and click on the "BUILD SP METADATA" button.
This will look something like this:
Using the template below, create a file called saml-sp.yaml. Assign the metadata you just generated to the
entity_descriptor
field in thesaml_idp_service_provider
object:Add this to Teleport using tctl:
Teleport now trusts the
argocd
service provider.Step 4/4. Verify ArgoCD login works
To verify everything works, navigate to ArgoCD and click "LOG IN VIA TELEPORT"
If you are not already logged into Teleport, you will be prompted to log in. Once you are logged in, you should see the ArgoCD user interface. Click on "User Info" and you should see your Teleport username and groups:
This has verified service provider initiated SSO.
To verify identity provider initiated SSO, log out of ArgoCD and then navigate to https://teleport.example.com/enterprise/saml-idp/login/argocd, where
argocd
is the friendly name of thesaml_idp_service_provider
object created earlier. You should be redirected to the same successful login page seen earlier.At this point, you can refer back to the rest of the Teleport as a SAML identity provider guide.
Limitations
If you are not already authenticated to Teleport, you will encounter an error due to a bug in Teleport. This bug is being tracked in #44279. If a user encounters an error on their first login attempt, it should succeed on the second try.
Resources
While creating this guide, I referred to several upstream resources.
Specific examples for configuration of ArgoCD with other SAML identity providers
Upstream
dex
documentation on its SAML connector support.Footnotes
ArgoCD uses a declarative configuration approach. https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/ ↩
https://argo-cd.readthedocs.io/en/stable/operator-manual/argocd-cm-yaml/ ↩
Beta Was this translation helpful? Give feedback.
All reactions