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

feat: Argo workflows SSO auth #24

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/11-argo-workflows/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ patches:
kind: Deployment
name: workflow-controller
path: patch-workflow-deployment.yaml

configMapGenerator:
- name: workflow-controller-configmap
behavior: merge
files:
- sso
3 changes: 1 addition & 2 deletions components/11-argo-workflows/patch-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
path: /spec/template/spec/containers/0/args
value:
- server
- --auth-mode=server
# - --auth-mode=client
- --auth-mode=sso
- --namespaced
- --managed-namespace
- argo-events
29 changes: 29 additions & 0 deletions components/11-argo-workflows/sso
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is the root URL of the OIDC provider (required).
issuer: https://dexidp.local
# This defines how long your login is valid for (in hours). (optional)
# If omitted, defaults to 10h. Example below is 10 days.
sessionExpiry: 240h
# This is name of the secret and the key in it that contain OIDC client
# ID issued to the application by the provider (required).
clientId:
name: argo-sso
key: client-id
# This is name of the secret and the key in it that contain OIDC client
# secret issued to the application by the provider (required).
clientSecret:
name: argo-sso
key: client-secret
# This is the redirect URL supplied to the provider (optional). It must
# be in the form <argo-server-root-url>/oauth2/callback. It must be
# browser-accessible. If omitted, will be automatically generated.
redirectUrl: https://workflows.local/oauth2/callback
# Additional scopes to request. Typically needed for SSO RBAC. >= v2.12
scopes:
- groups
- email
- profile
# RBAC Config. >= v2.12
rbac:
enabled: false
# Skip TLS verify, not recommended in production environments. Useful for testing purposes. >= v3.2.4
insecureSkipVerify: true
6 changes: 6 additions & 0 deletions components/12-argo-events/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ resources:
- sensor-workflow-role.yaml
- webhook-sensor.yaml
- workflow-role.yaml

configMapGenerator:
- name: workflow-controller-configmap
behavior: merge
files:
- sso
10 changes: 10 additions & 0 deletions components/13-dexidp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ config:
redirectURIs:
- "http://localhost:8000/complete/oidc/"
- "https://nautobot.local/complete/oidc/"
- id: argo
secretEnv: ARGO_SSO_CLIENT_SECRET
name: "Undercloud Argo"
redirectURIs:
- "https://workflows.local/oauth2/callback"

envVars:
- name: NAUTOBOT_SSO_CLIENT_SECRET
Expand All @@ -81,6 +86,11 @@ envVars:
secretKeyRef:
name: azure-sso
key: issuer
- name: ARGO_SSO_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: argo-sso
key: client-secret
ingress:
enabled: true
annotations:
Expand Down
23 changes: 23 additions & 0 deletions scripts/easy-secrets-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ for ns in nautobot dex; do
done
unset NAUTOBOT_SSO_SECRET

ARGO_SSO_SECRET=$(./scripts/pwgen.sh)
for ns in argo argo-events argocd dex; do
kubectl --namespace $ns \
create secret generic argo-sso \
--dry-run=client \
-o yaml \
--type Opaque \
--from-literal=client-secret="$ARGO_SSO_SECRET" \
--from-literal=client-id=argo \
> secret-argo-sso-$ns.yaml
done
unset ARGO_SSO_SECRET


kubectl --namespace openstack \
create secret generic keystone-rabbitmq-password \
--type Opaque \
Expand Down Expand Up @@ -126,6 +140,15 @@ for ns in nautobot dex; do
-w components/01-secrets/encrypted-nautobot-sso-$ns.yaml
done

for ns in argo argo-events argocd dex; do
kubeseal \
--scope cluster-wide \
--allow-empty-data \
-o yaml \
-f secret-argo-sso-$ns.yaml \
-w components/01-secrets/encrypted-argo-sso-$ns.yaml
done

cd components/01-secrets/
rm -f kustomization.yaml
kustomize create --autodetect
Expand Down
Loading