Skip to content

Commit

Permalink
Merge branch 'master' into ci/needs-steps
Browse files Browse the repository at this point in the history
  • Loading branch information
pasha-codefresh authored Feb 6, 2024
2 parents 60d2c28 + b93874e commit 67d3e98
Show file tree
Hide file tree
Showing 15 changed files with 115 additions and 37 deletions.
Binary file removed docs/assets/api-management.png
Binary file not shown.
Binary file removed docs/assets/groups-claim.png
Binary file not shown.
Binary file removed docs/assets/groups-scope.png
Binary file not shown.
Binary file added docs/assets/okta-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/okta-auth-policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/okta-auth-rule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/okta-create-oidc-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/okta-groups-claim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/okta-groups-scope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions docs/developer-guide/site.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@ The website is built using `mkdocs` and `mkdocs-material`.
To test:

```bash
make build-docs
make serve-docs
```

Once running, you can view your locally built documentation at [http://0.0.0.0:8000/](http://0.0.0.0:8000/).

## Deploying

```bash
make publish-docs
```

## Analytics

!!! tip
Don't forget to disable your ad-blocker when testing.

We collect [Google Analytics](https://analytics.google.com/analytics/web/#/report-home/a105170809w198079555p192782995).
We collect [Google Analytics](https://analytics.google.com/analytics/web/#/report-home/a105170809w198079555p192782995).
37 changes: 37 additions & 0 deletions docs/operator-manual/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,43 @@ The argocd-server Service needs to be annotated with `projectcontour.io/upstream
The API server should then be run with TLS disabled. Edit the `argocd-server` deployment to add the
`--insecure` flag to the argocd-server command, or simply set `server.insecure: "true"` in the `argocd-cmd-params-cm` ConfigMap [as described here](server-commands/additional-configuration-method.md).

Contour httpproxy CRD:

Using a contour httpproxy CRD allows you to use the same hostname for the GRPC and REST api.

```yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: argocd-server
namespace: argocd
spec:
ingressClassName: contour
virtualhost:
fqdn: path.to.argocd.io
tls:
secretName: wildcard-tls
routes:
- conditions:
- prefix: /
- header:
name: Content-Type
contains: application/grpc
services:
- name: argocd-server
port: 80
protocol: h2c # allows for unencrypted http2 connections
timeoutPolicy:
response: 1h
idle: 600s
idleConnection: 600s
- conditions:
- prefix: /
services:
- name: argocd-server
port: 80
```

## [kubernetes/ingress-nginx](https://github.com/kubernetes/ingress-nginx)

### Option 1: SSL-Passthrough
Expand Down
14 changes: 7 additions & 7 deletions docs/operator-manual/notifications/services/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Use the following steps to configure webhook:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.webhook.<webhook-name>: |
url: https://<hostname>/<optional-path>
Expand All @@ -50,7 +50,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
template.github-commit-status: |
webhook:
Expand Down Expand Up @@ -82,7 +82,7 @@ metadata:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.webhook.github: |
url: https://api.github.com
Expand All @@ -97,7 +97,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.webhook.github: |
url: https://api.github.com
Expand Down Expand Up @@ -128,7 +128,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.webhook.jenkins: |
url: http://<jenkins-host>/job/<job-name>/build?token=<job-secret>
Expand All @@ -145,7 +145,7 @@ type: Opaque
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.webhook.form: |
url: https://form.example.com
Expand All @@ -166,7 +166,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argocd-notifications-cm
data:
service.webhook.slack_webhook: |
url: https://hooks.slack.com/services/xxxxx
Expand Down
85 changes: 66 additions & 19 deletions docs/operator-manual/user-management/okta.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,34 +118,81 @@ data:

## OIDC (without Dex)

!!! warning "Do you want groups for RBAC later?"
If you want `groups` scope returned from Okta you need to unfortunately contact support to enable [API Access Management with Okta](https://developer.okta.com/docs/concepts/api-access-management/) or [_just use SAML above!_](#saml-with-dex)
!!! warning "Okta groups for RBAC"
If you want `groups` scope returned from Okta, you will need to enable [API Access Management with Okta](https://developer.okta.com/docs/concepts/api-access-management/). This addon is free, and automatically enabled, on Okta developer edition. However, it's an optional add-on for production environments, with an additional associated cost.

Next you may need the API Access Management feature, which the support team can enable for your OktaPreview domain for testing, to enable "custom scopes" and a separate endpoint to use instead of the "public" `/oauth2/v1/authorize` API Access Management endpoint. This might be a paid feature if you want OIDC unfortunately. The free alternative I found was SAML.
You may alternately add a "groups" scope and claim to the default authorization server, and then filter the claim in the Okta application configuration. It's not clear if this requires the Authorization Server add-on.

If this is not an option for you, use the [SAML (with Dex)](#saml-with-dex) option above instead.

!!! note
These instructions and screenshots are of Okta version 2023.05.2 E. You can find the current version in the Okta website footer.

First, create the OIDC integration:

1. On the `Okta Admin` page, navigate to the Okta Applications at `Applications > Applications.`
1. Choose `Create App Integration`, and choose `OIDC`, and then `Web Application` in the resulting dialogues.
![Okta OIDC app dialogue](../../assets/okta-create-oidc-app.png)
1. Update the following:
1. `App Integration name` and `Logo` - set these to suit your needs; they'll be displayed in the Okta catalogue.
1. `Sign-in redirect URLs`: Add `https://argocd.example.com/auth/callback`; replacing `argocd.example.com` with your ArgoCD web interface URL. Also add `http://localhost:8085/auth/callback` if you would like to be able to login with the CLI.
1. `Sign-out redirect URIs`: Add `https://argocd.example.com`; substituting the correct domain name as above.
1. Either assign groups, or choose to skip this step for now.
1. Leave the rest of the options as-is, and save the integration.
![Okta app settings](../../assets/okta-app.png)
1. Copy the `Client ID` and the `Client Secret` from the newly created app; you will need these later.

Next, create a custom Authorization server:

1. On the `Okta Admin` page, navigate to the Okta API Management at `Security > API`.
![Okta API Management](../../assets/api-management.png)
1. Choose your `default` authorization server.
1. Click `Scopes > Add Scope`
1. Add a scope called `groups`.
![Groups Scope](../../assets/groups-scope.png)
1. Click `Claims > Add Claim.`
1. Add a claim called `groups`
1. Choose the matching options you need, one example is:
* e.g. to match groups starting with `argocd-` you'd return an `ID Token` using your scope name from step 3 (e.g. `groups`) where the groups name `matches` the `regex` `argocd-.*`
![Groups Claim](../../assets/groups-claim.png)
1. Edit the `argocd-cm` and configure the `data.oidc.config` section:
1. Click `Add Authorization Server`, and assign it a name and a description. The `Audience` should match your ArgoCD URL - `https://argocd.example.com`
1. Click `Scopes > Add Scope`:
1. Add a scope called `groups`. Leave the rest of the options as default.
![Groups Scope](../../assets/okta-groups-scope.png)
1. Click `Claims > Add Claim`:
1. Add a claim called `groups`.
1. Adjust the `Include in token type` to `ID Token`, `Always`.
1. Adjust the `Value type` to `Groups`.
1. Add a filter that will match the Okta groups you want passed on to ArgoCD; for example `Regex: argocd-.*`.
1. Set `Include in` to `groups` (the scope you created above).
![Groups Claim](../../assets/okta-groups-claim.png)
1. Click on `Access Policies` > `Add Policy.` This policy will restrict how this authorization server is used.
1. Add a name and description.
1. Assign the policy to the client (application integration) you created above. The field should auto-complete as you type.
1. Create the policy.
![Auth Policy](../../assets/okta-auth-policy.png)
1. Add a rule to the policy:
1. Add a name; `default` is a reasonable name for this rule.
1. Fine-tune the settings to suit your organization's security posture. Some ideas:
1. uncheck all the grant types except the Authorization Code.
1. Adjust the token lifetime to govern how long a session can last.
1. Restrict refresh token lifetime, or completely disable it.
![Default rule](../../assets/okta-auth-rule.png)
1. Finally, click `Back to Authorization Servers`, and copy the `Issuer URI`. You will need this later.

If you haven't yet created Okta groups, and assigned them to the application integration, you should do that now:

1. Go to `Directory > Groups`
1. For each group you wish to add:
1. Click `Add Group`, and choose a meaningful name. It should match the regex or pattern you added to your custom `group` claim.
1. Click on the group (refresh the page if the new group didn't show up in the list).
1. Assign Okta users to the group.
1. Click on `Applications` and assign the OIDC application integration you created to this group.
1. Repeat as needed.

Finally, configure ArgoCD itself. Edit the `argocd-cm` configmap:

<!-- markdownlint-disable MD046 -->
```yaml
url: https://argocd.example.com
oidc.config: |
name: Okta
issuer: https://yourorganization.oktapreview.com
clientID: 0oaltaqg3oAIf2NOa0h3
clientSecret: ZXF_CfUc-rtwNfzFecGquzdeJ_MxM4sGc8pDT2Tg6t
# this is the authorization server URI
issuer: https://example.okta.com/oauth2/aus9abcdefgABCDEFGd7
clientID: 0oa9abcdefgh123AB5d7
clientSecret: ABCDEFG1234567890abcdefg
requestedScopes: ["openid", "profile", "email", "groups"]
requestedIDTokenClaims: {"groups": {"essential": true}}
```
<!-- markdownlint-enable MD046 -->


You may want to store the `clientSecret` in a Kubernetes secret; see [how to deal with SSO secrets](./index.md/#sensitive-data-and-sso-client-secrets ) for more details.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ require (
github.com/whilp/git-urls v1.0.0
github.com/xanzy/go-gitlab v0.91.1
github.com/yuin/gopher-lua v1.1.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1746,8 +1746,8 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 h1:ZOLJc06r4CB42laIXg/7udr0pbZyuAihN10A/XuiQRY=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0/go.mod h1:5z+/ZWJQKXa9YT34fQNx5K8Hd1EoIhvtUygUQPqEOgQ=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
Expand Down

0 comments on commit 67d3e98

Please sign in to comment.