Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
067e0e4b3e | ||
|
|
cb78edff6f | ||
|
|
7cb99de32d | ||
|
|
6a35c7407e | ||
|
|
ddfb1c6d0a | ||
|
|
b2d29df657 | ||
|
|
2f2d980ef7 | ||
|
|
fbdee5f778 |
No files matched your search
@@ -42,6 +42,7 @@ when its own prerequisites (tests, a safe cutover wherever the role already runs
|
||||
Still to come:
|
||||
|
||||
- Wave 3: `rke2`, `proxmox_host`.
|
||||
- Not yet in a wave: `openbao`.
|
||||
|
||||
Will not be extracted (they serve one lab or install that lab's own tool pins):
|
||||
`k8s_manage`, `k8s_localhost`, `k8s_lint_tools`, `minecraft_server`, `dragonwilds_server`,
|
||||
|
||||
+10
@@ -126,3 +126,13 @@ reduction. A later decision that accepts a risk adds an entry here.
|
||||
- **Trigger:** the pull request that moves `molecule.yml` to a new `molecule-controller` image
|
||||
fails Molecule because of a changed image input.
|
||||
- **Planned reduction:** none for now.
|
||||
|
||||
### Unseal keys in vaulted inventory
|
||||
|
||||
- **Risk:** the planned `openbao` role can unseal a Shamir-sealed OpenBao from unseal keys the
|
||||
consumer keeps in vaulted inventory (`openbao_unseal_keys`), so whoever holds the Ansible
|
||||
vault password can unseal alone. This weakens the split knowledge Shamir's scheme gives.
|
||||
- **Why accepted:** it keeps restarts and updates unattended, and the Collection already keeps
|
||||
secrets in vaulted inventory. The keys are optional: without them the role leaves the node
|
||||
sealed and warns.
|
||||
- **Trigger and planned reduction:** auto-unseal, tracked in #529.
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
breaking_changes:
|
||||
- >-
|
||||
pihole - A non-empty ``config.webserver.api.app_password`` is now refused, and ``app_pwhash``
|
||||
always renders empty, which disables app passwords. Released pihole-FTL upgrades a
|
||||
legacy-hashed app password on login by writing the new hash into the main ``pwhash``, so one
|
||||
login with the app password replaced the web password. Remove
|
||||
``config.webserver.api.app_password`` from ``pihole_overrides``; the first run after upgrading
|
||||
re-renders ``pihole.toml`` and reconfigures Pi-hole.
|
||||
@@ -68,6 +68,11 @@ names a check that does not exist yet and its backlog issue.
|
||||
- **Secrets.** Never in plaintext in the repository, a role's defaults, task output or a file on
|
||||
the controller; `no_log: true` on every task that carries one; a secret is a required input
|
||||
with no default; a role generates one only straight into a secret store the consumer names.
|
||||
A secret returned as a `no_log`, non-cacheable output fact from an opt-in entry point, for the
|
||||
calling play to persist (for example vault-encrypted into inventory), counts as handed straight
|
||||
to the consumer's store, as the gitea and cloudflared `mint` entry points do. Such an entry point
|
||||
has a confirm flag, refuses under CI environment variables, sets `no_log` on every task, blanks
|
||||
its intermediates, skips under `--check` and does nothing when the secret already exists.
|
||||
Keys a host generates for itself and keeps (SSH host keys) are not covered. The README line
|
||||
"`no_log` is not used: the role handles no secrets" stays only where true. *Why:* nothing leaks
|
||||
today and a role writing to a secret store stays possible. *Held:* review.
|
||||
|
||||
@@ -58,13 +58,14 @@ The input asserts carry `always` (and `assert`), so they run whatever tags are s
|
||||
|
||||
## Tests
|
||||
|
||||
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It replaces the upstream repository with a local stub whose installer only logs its arguments and creates the database file, so it tests the merge, the asserts, the user, the configuration directory and the rendered `pihole.toml` (owner, group and mode), the clone's checked-out version, the installer sequence (install once, then reconfigure from the handler) and idempotence, not Pi-hole itself: no pihole-FTL service runs, so that the service loaded the configuration is not verified. It runs `check` before the converge (a fresh host) and after it (a configured host). Negative tests in `verify.yml` cover a host without Ubuntu facts, a missing `pihole_web_password`, an unset interface, empty upstreams, a non-string password and the placeholder password.
|
||||
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It replaces the upstream repository with a local stub whose installer only logs its arguments and creates the database file, so it tests the merge, the asserts, the user, the configuration directory and the rendered `pihole.toml` (owner, group and mode), the clone's checked-out version, the installer sequence (install once, then reconfigure from the handler) and idempotence, not Pi-hole itself: no pihole-FTL service runs, so that the service loaded the configuration is not verified. It runs `check` before the converge (a fresh host) and after it (a configured host). Negative tests in `verify.yml` cover a host without Ubuntu facts, a missing `pihole_web_password`, an unset interface, empty upstreams, a non-string password, the placeholder password and a non-empty app password.
|
||||
|
||||
## Notes
|
||||
|
||||
- Idempotent: yes.
|
||||
- Merge model: the role sets an internal fact to `pihole_default | combine(pihole_overrides | default({}), recursive=True)`. The input is only read, never overwritten, so each run recomputes the merge. Dictionaries are not merged across variable sources, so define `pihole_overrides` in one place only.
|
||||
- Secrets: the password is hashed twice with SHA-256 in the template (`pwhash`). The merge and both template tasks use `no_log`, and the templates `diff: false`, so a `pihole.toml` change shows no diff. `pihole_testing` masks the web password, app password and TOTP secret in its output. `totp_secret` and `app_password` default to empty strings.
|
||||
- App passwords: `config.webserver.api.app_password` must stay empty, and the role fails otherwise; `app_pwhash` always renders empty, which disables app passwords. Released pihole-FTL upgrades a legacy-hashed (double SHA-256) app password on login by writing the new hash into the main `pwhash`, so one login with the app password would replace the web password.
|
||||
- Install flow: the role creates the `pihole` system user (nologin), the configuration directory and, on first install, `pihole.toml`, because the unattended installer needs it first. It clones `repo.version` and runs the installer with `--unattended` only when `config.files.database` does not exist yet. A change to `pihole.toml` notifies the `reconfigure pihole` handler, which runs the installer with `--reconfigure --unattended`.
|
||||
- Updates: the role does not upgrade an installed Pi-hole; changing `repo.version` only moves the clone.
|
||||
- Check mode: `--check` is the supported preview; a play-level `check_mode: true` is not supported. On a host where the configuration directory does not exist yet, the `pihole.toml` template tasks are skipped under `--check`, because the directory they write into is not created.
|
||||
|
||||
@@ -308,7 +308,7 @@ pihole_default:
|
||||
password: "{{ pihole_web_password }}"
|
||||
# Pi-hole 2FA TOTP secret.
|
||||
totp_secret: ""
|
||||
# Pi-hole application password (to circumvent 2FA for legacy 3rd-party services)
|
||||
# Pi-hole application password: must stay empty, app_pwhash always renders empty (README Notes)
|
||||
app_password: ""
|
||||
# Should application password API sessions be allowed to modify config settings?
|
||||
app_sudo: false
|
||||
|
||||
@@ -13,8 +13,8 @@ argument_specs:
|
||||
over C(pihole_default) in C(defaults/main.yml). The spec types it as a dictionary only, because sub-options
|
||||
would reject every key it does not list. The merged result is an internal fact and never overwrites the
|
||||
input. The role fails unless the merged C(config.dns.upstreams) is a non-empty list, C(config.dns.interface)
|
||||
is a non-empty string and C(config.webserver.api.password) is a string other than
|
||||
C(changetoyourownpassword).
|
||||
is a non-empty string, C(config.webserver.api.password) is a string other than
|
||||
C(changetoyourownpassword) and C(config.webserver.api.app_password) is empty.
|
||||
- >-
|
||||
C(pihole_default) (every setting rendered into C(pihole.toml)) and C(pihole_install_script) (the quoted
|
||||
installer path under C(repo.path)) are role defaults deliberately not listed here, because argument
|
||||
@@ -47,7 +47,11 @@ argument_specs:
|
||||
C(config.dns.interface) must be set (string, for example C(eth0)): its default is an empty placeholder
|
||||
and the role fails until it is set. C(config.dns.upstreams) (list of IP addresses or hostnames,
|
||||
optionally with C(#port)) must stay non-empty. C(config.webserver.api.password) must stay a string.
|
||||
C(config.webserver.api.totp_secret) and C(config.webserver.api.app_password) are also credentials.
|
||||
C(config.webserver.api.totp_secret) is also a credential.
|
||||
- >-
|
||||
C(config.webserver.api.app_password) must stay empty and C(app_pwhash) always renders empty, which
|
||||
disables app passwords: released pihole-FTL replaces the main web password on a login with a
|
||||
legacy-hashed app password.
|
||||
- >-
|
||||
Other keys the tasks read are C(repo.remote), C(repo.version) (a tag, default C(v6.4)), C(repo.path)
|
||||
(default C(~/.cache/pi-hole) of the connecting user), C(user), C(group) (both default C(pihole)) and
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
database: passwd
|
||||
key: pihole
|
||||
|
||||
- name: The config carries the overridden upstreams and a hashed password
|
||||
- name: The config carries the overridden upstreams, a hashed password and no app password
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'9.9.9.9' in pihole_test_toml_content"
|
||||
@@ -66,6 +66,7 @@
|
||||
- "'\"eth0\"' not in pihole_test_toml_content"
|
||||
- "'molecule-test-password' not in pihole_test_toml_content"
|
||||
- pihole_test_toml_content is search('(?m)^\\s*pwhash = \"[0-9a-f]{64}\"')
|
||||
- pihole_test_toml_content is search('(?m)^\\s*app_pwhash = \"\"$')
|
||||
quiet: true
|
||||
vars:
|
||||
pihole_test_toml_content: "{{ pihole_test_toml.content | b64decode }}"
|
||||
@@ -167,3 +168,9 @@
|
||||
dns: {interface: molecule0}
|
||||
webserver: {api: {password: changetoyourownpassword}}
|
||||
expect: placeholder changetoyourownpassword
|
||||
- name: app-password-set
|
||||
overrides:
|
||||
config:
|
||||
dns: {interface: molecule0}
|
||||
webserver: {api: {password: molecule-test-password, app_password: molecule-test-app-password}}
|
||||
expect: app_password must stay empty
|
||||
@@ -53,3 +53,15 @@
|
||||
The web password is the placeholder changetoyourownpassword: set pihole_web_password, or
|
||||
pihole_overrides.config.webserver.api.password, to a secret of your own.
|
||||
quiet: true
|
||||
|
||||
# Released pihole-FTL upgrades a legacy-hashed app password on login by writing the new hash
|
||||
# into the main pwhash, so the role renders app_pwhash empty, which disables app passwords.
|
||||
- name: Check that no app password is set
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- (__pihole_candidate.config.webserver.api.app_password | default('', true)) == ''
|
||||
fail_msg: >-
|
||||
config.webserver.api.app_password must stay empty: released pihole-FTL replaces the main
|
||||
web password when someone logs in with an app password the role has hashed. Remove
|
||||
app_password from pihole_overrides.
|
||||
quiet: true
|
||||
@@ -838,9 +838,9 @@
|
||||
#
|
||||
# Possible values are:
|
||||
# <valid Pi-hole password hash>
|
||||
# NOTE! I am assuming this should be double-hashed just like the regular password, but
|
||||
# this assumption has not been tested!
|
||||
app_pwhash = "{{ __pihole_effective.config.webserver.api.app_password | hash('sha256') | hash('sha256') }}"
|
||||
# Always empty, which disables app passwords: the role refuses app_password, because
|
||||
# released pihole-FTL rewrites the main pwhash on a login with a legacy-hashed app password.
|
||||
app_pwhash = ""
|
||||
|
||||
# Should application password API sessions be allowed to modify config settings?
|
||||
# Setting this to true allows third-party applications using the application password
|
||||
|
||||
Reference in new issue
Block a user