docs(Authelia): Update access rules documentation (#17316)

**Description**

Default access rule policy in the Authelia setup guide is currently
`one_factor`, this give access to everything to every user.
In this PR, the doc is updated to :
- recommend default policy to `deny` in the main Authelia guide and only
give full access to member of an `admin` ldap group.
- recommend having an `admin` and `user` groups in the Authelia Rules
guide with full access for `admin` users and limited access for `user`
users.

⚒️ Fixes 

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code
- [x] 📄 Doc update 

**🧪 How Has This Been Tested?**

I built the doc website locally to make sure of the following :
- formatting is ok
- screenshots works
- links works
- recommended configuration works on my setup (my setup is following
closely the others TrueCharts guides)

**📃 Notes:**


**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [x] 📄 I have made corresponding changes to the documentation
- [x] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Antoine Saget 2024-01-27 12:44:23 +01:00 committed by GitHub
parent 8b7c412d3f
commit ebcdf7aec7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 49 additions and 13 deletions

View File

@ -26,6 +26,8 @@ LLDAP is a `Stable` train chart and therefore isn't supported at the same level
- Once in `LLDAP`, create a user inside the `lldap_password_manager` group and change your default `admin` password. That `lldap_password_manager` user will be used to bind to `Authelia`. I've created a user called `Steven`
- Create an `admin` group and add `Steven` to it. We will allow users of this group to access the site with Authelia later in the guide.
## Setup Authelia
- The setup for Authelia is very specific, and the logs won't tell you where you've messed up, but there's precise steps used to integrate `LLDAP` into `Authelia`. The info comes from the [LLDAP Authelia Docs](https://truecharts.org/charts/stable/lldap/authelia) and the upstream repo.
@ -65,15 +67,17 @@ Check your mail provider for this, generally Gmail gives you an app specific pas
### Access Control Configuration
- This section is to set rules to connect to `Authelia` and which users can go where. This is a basic general rule below where the main user (Steven) can access all the site using a wildcard
- This section is to set rules to connect to `Authelia` and which users can go where. This is a basic general rule where users of the `admin` group (Steven) can access all the site using a wildcard.
Leave the default `one_factor` unless you've setup TOTP above. Then click `Add` next to `Rules` to get the screen below
Set the default `deny`. Then click `Add` next to `Rules` to get the screen below.
![AutheliaAccessControl](./img/AutheliaAccessControl.png)
- Add your `Domain` and a `Wildcard` for your subdomains.
- Leave policy `one_factor`
- Click `Add Subject` and add a subject of `group:lldap_password_manager` since `Steven` is part of that group
- Set policy to `one_factor` or `two_factor`, up to you.
- Click `Add Subject` and add a subject of `group:admin` since `Steven` is part of that group.
Please see [Authelia Rules](./authelia-rules) for more advanced rules.
#### Setup Authelia Ingress

View File

@ -10,7 +10,17 @@ It is important that rules are created in the correct order in Authelia. Rules a
:::
All rules requiring Authelia authentication were configured with `two_factor` (2FA). If you do not want 2FA on some or all rules replace the Policy with `one_factor`
:::note[DEFAULT POLICY]
For theses rules to work as intended, your default access control policy must be set to `deny`.
:::
All rules requiring Authelia authentication were configured with `two_factor` (2FA). If you do not want 2FA on some or all rules replace the Policy with `one_factor`.
In this guide we assume you have a group `admin` and a group `user` in ldap.
Members of the `admin` group will have access to everything.
Members of the `user` group will only have access to a select set of apps you choose.
## API Rule
@ -44,11 +54,13 @@ These rules will protect the Vaultwarden admin page with Authelia but bypass whe
### Rule 1
This rule will allow users of the `admin` group to access the vaulwarden admin page.
Domain: `vaultwarden.domain.tld`
Policy: `two_factor`
Subject: `Not Used (Do Not Add)`
Subject: `group:admin`
Networks: `Not Used (Do Not Add)`
@ -58,6 +70,25 @@ Resources: `^*/admin.*$`
### Rule 2
This rule will prevent users not in the `admin` group to access the vaulwarden admin page.
This is necessary even if the your default policy is set to `deny` because of the `bypass` rule below.
Domain: `vaultwarden.domain.tld`
Policy: `deny`
Subject: `Not Used (Do Not Add)`
Networks: `Not Used (Do Not Add)`
Resources: `^*/admin.*$`
![authelia-vw1](./img/authelia-vw2.png)
### Rule 3
This rule will bypass Authelia when accessing the webportal as auth is already provided by vaultwarden.
Domain: `vaultwarden.domain.tld`
Policy: `bypass`
@ -68,20 +99,21 @@ Networks: `Not Used (Do Not Add)`
Resources: `Not Used (Do Not Add)`
![authelia-vw2](./img/authelia-vw2.png)
![authelia-vw2](./img/authelia-vw3.png)
## User Rule
This rule will allow users in the `lldap_user` group access to only the specified applications.
This rule will allow users in the `user` group access to only the specified applications.
Domain:
- `radarr.domain.tld`
- `sonarr.domain.tld`
- `jellyfin.domain.tld`
- `nextcloud.domain.tld`
- `whateveryouwant.domain.tld`
Policy: `two_factor`
Subject: `group:lldap_user`
Subject: `group:user`
Networks: `Not Used (Do Not Add)`
@ -91,7 +123,7 @@ Resources: `Not Used (Do Not Add)`
## Catch All Rule
This rule will catch any access requests not covered by other rules.
This rule will give access to everything to users of the `admin` group.
Domain:
@ -100,7 +132,7 @@ Domain:
Policy: `two_factor`
Subject: `group:lldap_admin`
Subject: `group:admin`
Networks: `Not Used (Do Not Add)`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB