The Redis component, as a fab unit #1
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/unit-redis!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/the-redis-component"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the component half of Keel-Linux/keel-redis#1:
keel-rediscomposes this throughunit.d/redis.Redis is the third engine of decision 0013's standard set, and the first one whose component is written rather than extracted.
turnkeylinux/commonhas noconf/redis, nooverlays/redisand noplans/turnkey/redis, so there was nothing in the shared tree to take out.What the declared secret means on Redis
secrets.db_passwordrenders toDB_PASS, the same variable the MariaDB and PostgreSQL hooks read. Redis has no database account to put it on: the secret is eitherrequirepass, the built indefaultuser's password, or an ACL user with a password of its own. Decision 0013 leaves both open, and this chooses the ACL user for two reasons that are checkable properties, not preferences.requirepasswould also lockINFO.keel inspectreadsdatabase.server.rolefromINFO replicationandINFO cluster, never reads a secret to get past a refusal, and reports a Redis it cannot ask as a role it could not infer. An appliance that cannot say it isstandalonecannot later say it is aprimaryor areplica, and that reading is the seam the replication modes are built on. Sodefaultkeeps one command,INFO, no key and no channel: inspect's three questions are answered without a secret andGETis refused withNOPERM.requirepasslives in a world readable file. The package ships/etc/redis/redis.confasroot:root 0644, so the upstream appliance wrote the Redis password where every local account could read it and shippedturnkey-redis-pw getto print it back. An ACL rule takes the SHA-256 instead, written to/etc/redis/redis.conf.d/50-keel-secret.confasroot:redis 0640.Before the first boot the account is published
off, which authenticates nothing: the same reasoning as the invalid hashkeel-mariadbpublishes its account with.The bind addresses
bind ::1 127.0.0.1. Debian shipsbind 127.0.0.1 -::1, where the dash makes::1optional, so a server that cannot bind it starts anyway and answers one family. No name is used anywhere, because Debian maps::1toip6-localhostand never tolocalhost— how the PostgreSQL appliance shipped listening on IPv4 only.The Redis trap every check is shaped around
redis-cliexits 0 when the server answers with an error. A wrong password printsAUTH failed: WRONGPASS ...and exits 0. So the hook, the conf script and the tests read the answer and never the exit code, and one test drives the hook with a wrong password through a stub that exits 0 and requires the hook to fail anyway.Coverage
65 bats tests over four files;
conf,35redispassandlib/redis.shat 100 percent each, 123 of 123 lines. The workflow threshold is raised from the bootstrap 0 to 100. The two configuration fragments are asserted as content, because the one line the PostgreSQL appliance got wrong was in a file exactly like them.Test plan
COVERAGE_THRESHOLD=100 tests/coverage.shlocally: 100/100/100redis-server 8.0.2from Debian 13 before any of this was written:INFO replication,INFO clusterandINFO serveranswered unauthenticated,GETrefusedNOPERM, the admin user accepted with the digest, a wrong password refused, andss -lntHshowing[::1]:6379and127.0.0.1:6379tests / coveragegreen herekeel-redis'sappliance / build-and-bootagainst a published layer that carriesunits redis@1.0.0