Jan Alexander Steffens (heftig)andAntigravity 5e461e81b3 matrix: Add matrix-authentication-service
Staff Role Restriction (Keycloak)
---------------------------------

Because matrix-authentication-service lacks an equivalent to Synapse's
attribute_requirements (and claims_imports only runs during initial
registration/linking, so it would not block offboarded users on later
logins), enforce the Staff role requirement directly in Keycloak before
any OIDC tokens or client sessions are issued:

- Add a `staff_only` client scope (`include_in_token_scope = false`) and
  attach it as a default scope on `openid_matrix_mas` so users cannot
  strip it from the authorization request.

- In `Arch Browser`, wrap Cookie, Identity Provider Redirector, and
  Password+2FA in a REQUIRED `Browser Auth Subflow`, followed by a
  CONDITIONAL `Browser Staff Role Check Subflow` combining
  `conditional-client-scope` (`staff_only`), `conditional-user-role`
  (`Staff`, negated), and `deny-access-authenticator`. Wrapping the auth
  steps ensures SSO cookie reuse still hits the role check.

- In `Arch Post IPR Flow`, wrap the 2FA steps in a REQUIRED `IPR 2FA
  Subflow` and add the same conditional check (`IPR Staff Role Check
  Subflow`), since GitHub broker logins skip the rest of the browser
  flow. Non-Staff users can still sign into other clients via GitHub
  while being denied access to `openid_matrix_mas`.

Cutover Checklist
-----------------

1. Run `terraform init && terraform apply` in tf-stage1 (DNS for
   auth.matrix.archlinux.org) and tf-stage2 (Keycloak flows, scope, and
   openid_matrix_mas client).
2. Run the playbook tags/steps up to installing
   matrix-authentication-service, creating the mas DB, rendering
   /etc/matrix-authentication-service/config.yaml, and migrating the MAS
   DB (`mas-cli database migrate`), or deploy with Synapse stopped while
   migrating.
3. Stop synapse.service (and workers), run `mas-cli syn2mas check` and
   `mas-cli syn2mas migrate --dry-run` (checking
   /etc/matrix-authentication-service/config.yaml and
   /etc/synapse/homeserver.yaml before homeserver.yaml removes
   `oidc_providers`), then run the live `mas-cli syn2mas migrate`.
4. Run playbooks/matrix.archlinux.org.yml to switch homeserver.yaml,
   reload nginx, and start synapse + matrix-authentication-service
   + matrix-authentication-service-worker.
5. Test login with a Staff account and verify non-Staff accounts are
   denied via password+2FA, existing Keycloak SSO cookie, and GitHub
   broker login.

Co-Authored-By: Antigravity (Gemini 4 Neon) <noreply@google.com>
2026-11-29 01:20:03 +01:00
2026-10-31 12:35:39 +00:00
2025-10-24 23:32:05 +02:00
2026-09-29 23:03:44 +02:00
2019-07-04 21:41:04 +02:00
2019-02-14 06:45:18 +01:00
2021-02-11 21:01:19 +01:00

Arch Infrastructure

This repository contains the complete collection of ansible playbooks and terraform configuration for the Arch Linux infrastructure.

Table of contents

[[TOC]]

Requirements

Install these packages:

  • terraform
  • python-click
  • python-jmespath
  • moreutils (for playbooks/tasks/reencrypt-vault-key.yml)

Note about terraform

See docs/terraform.md for details about terraform.

SMTP Configuration

All hosts should be relaying email through our primary mx host (currently 'mail.archlinux.org'). See docs/email.md for full details.

Servers

This section has been moved to docs/servers.md.

Documentation on upgrades and the maintenance mode is now in docs/maintenance.md.

Backup documentation

We use BorgBackup for all of our backup needs. We have a primary backup storage as well as an additional offsite backup.

See docs/backups.md for detailed backup information.

To view the current Gitlab version visit this url

S
Description
Official Arch Linux Infrastructure Repository
Readme
21 MiB
1 Stars 1 Watchers 0 Forks
Languages
Jinja 73.2%
HCL 9.3%
Shell 7.6%
AGS Script 4.8%
Python 2.4%
Other 2.6%