Skip to content

Commit

Permalink
docs(faq): add oauth example (#378)
Browse files Browse the repository at this point in the history
Co-authored-by: Jo <[email protected]>
  • Loading branch information
Julien Bouquillon and devthejo authored Jul 31, 2023
1 parent 8556549 commit 0f5bcdf
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pg:
app:
~chart: app
~needs: [build-app, seed-db]
# use CNPG db created secret
# use CNPG db created secret
envFrom:
- secretRef:
name: pg-app
Expand Down Expand Up @@ -170,6 +170,57 @@ jobs:
context: packages/api
```

## Add an oauth2 proxy to protect some application

You can delegate application authentication to [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy) that can connect to multiple identity providers like GitHub, Azure, AD, KeyCloak...

This has many security advantages :

- hides all your application from external users
- delegates all security processes to state-of-the-art providers
- application can receive verifiable user identity

You'll have to disable the default application ingress and replace it with `oauth2-proxy` one then register your application, see [compatible providers](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider).

```mermaid
graph LR
Internet["🌍" Internet]-->Proxy["πŸ”’" Proxy]
subgraph Cluster
Proxy-->WebApp["πŸ§‘β€πŸ’Ό" WebApp]
Proxy<-->IDP["πŸ”‘" Identity providers]
end
```

In `.kontinuous/values.yaml` :

```yaml
# Application to protect
metabase:
ingress:
enabled: false # disable ingress (internet exposition)
# metabase secrets and settings
envFrom:
- secretRef:
name: metabase
oauth2-proxy:
# public URL that will show metabase once loggedin
host: "metabase.myapp.somewhere.fr"
# internal protected service URL
upstream: http://metabase
# oauth2-proxy secrets and settings
envFrom:
- secretRef:
name: oauth2-proxy
env:
- name: OAUTH2_PROXY_PROVIDER
value: github
- name: OAUTH2_PROXY_GITHUB_ORG
value: some-org
```

**NOTE** in this example, only users from `some-org` GitHub organisation can access the metabase, but they also have to login on the metabase separately.

## Define a custom docker registry

[TODO]
Expand Down

0 comments on commit 0f5bcdf

Please sign in to comment.