Register Zot as OIDC client in Authentik (#236)
## Summary - Add Authentik blueprint (`zot.yaml`) with OAuth2 provider, application, `artifact-workloads` group, and `zot-ci` service account - Wire `zot-client-secret` through ExternalSecret → worker Deployment env var → blueprint `!Env` - Add Ansible pre_task to fetch OIDC secret from 1Password (item ID `oor7os5kapczgpbwv7obkca4y4`) - Add `oidc-credentials.json.j2` template and deploy task in zot role (with `when` guard) ## Manual Steps Required Before Deploy 1. Generate client secret: `openssl rand -hex 32` 2. Store in 1Password: add field `zot-client-secret` to "Authentik (blumeops)" item in vault `blumeops` ## What This Does NOT Do - Does NOT modify `config.json.j2` (that's the root goal `harden-zot-registry`) - Does NOT wire CI auth (that's `wire-ci-registry-auth`) - Does NOT set service account password or API keys (manual post-deploy) ## Verification After ArgoCD sync: - [ ] Authentik admin UI shows "Zot Registry" application - [ ] OIDC discovery at `https://authentik.ops.eblu.me/application/o/zot/.well-known/openid-configuration` returns valid JSON - [ ] Blueprint status is `successful` - [ ] `artifact-workloads` group exists with `zot-ci` service account 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: https://forge.ops.eblu.me/eblume/blumeops/pulls/236
This commit is contained in:
parent
04e036c603
commit
21b6533aea
7 changed files with 116 additions and 0 deletions
|
|
@ -116,6 +116,23 @@
|
|||
no_log: true
|
||||
tags: [forgejo_actions_secrets]
|
||||
|
||||
# Zot OIDC client secret
|
||||
- name: Fetch zot OIDC client secret
|
||||
ansible.builtin.command:
|
||||
cmd: op read "op://vg6xf6vvfmoh5hqjjhlhbeoaie/oor7os5kapczgpbwv7obkca4y4/zot-client-secret"
|
||||
delegate_to: localhost
|
||||
register: _zot_oidc_secret
|
||||
changed_when: false
|
||||
no_log: true
|
||||
check_mode: false
|
||||
tags: [zot]
|
||||
|
||||
- name: Set zot OIDC client secret fact
|
||||
ansible.builtin.set_fact:
|
||||
zot_oidc_client_secret: "{{ _zot_oidc_secret.stdout }}"
|
||||
no_log: true
|
||||
tags: [zot]
|
||||
|
||||
# Caddy Gandi token for ACME DNS-01 challenges
|
||||
- name: Fetch Gandi PAT for Caddy
|
||||
ansible.builtin.command:
|
||||
|
|
|
|||
|
|
@ -46,6 +46,14 @@
|
|||
mode: '0644'
|
||||
notify: Restart zot
|
||||
|
||||
- name: Deploy zot OIDC credentials
|
||||
ansible.builtin.template:
|
||||
src: oidc-credentials.json.j2
|
||||
dest: "{{ zot_config_dir }}/oidc-credentials.json"
|
||||
mode: '0600'
|
||||
notify: Restart zot
|
||||
when: zot_oidc_client_secret is defined
|
||||
|
||||
- name: Deploy zot LaunchAgent plist
|
||||
ansible.builtin.template:
|
||||
src: zot.plist.j2
|
||||
|
|
|
|||
4
ansible/roles/zot/templates/oidc-credentials.json.j2
Normal file
4
ansible/roles/zot/templates/oidc-credentials.json.j2
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"clientid": "zot",
|
||||
"clientsecret": "{{ zot_oidc_client_secret }}"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue