CrowdSec identity: no shared credentials in the Core image, register on first enable (0041 step 4) #47
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/tracker#47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while building keel-overlay-crowdsec (Keel-Linux/common#20, 0041 step 2).
trixie's crowdsec 1.4.6 postinst registers the machine with the local API (
cscli machines add, keyed on /etc/machine-id) and with CrowdSec's central API (cscli capi register) at installation. crowdsec-firewall-bouncer's postinst adds itself as a bouncer and writes the key. In an image build all of this happens once, so every machine made from the image would share one CAPI identity, one set of LAPI credentials and one bouncer key.Belongs to step 4 (keel-core image) and the enable path of step 3 (keel apply):
cscli machines add --auto --force,cscli capi registerandcscli bouncers add;cscli capi registerfails without network. Its postinst already fails that way at install. Enabling must report the failure and must not leave a half-registered state.Add
/var/lib/crowdsec/pending-registrationto the image-build deletion list. crowdsec's postinst skips the pending queue when its unit is not active, and the bouncer's unit hasConditionPathExists=!on that file, so a leftover blocks the bouncer from starting (it also holds a stale key). keel's first enable now replaces it (Keel-Linux/keel#58), but the image should not carry it.