Run NiFi 2.10 workload as non-root user _daemon_ (uid/gid 584792) - #3
Conversation
CI troubleshooting:
|
The charm now runs the workload as _daemon_ (584792), but the published ghcr.io/canonical/nifi-rocks/nifi:2.10 image is still owned by ubuntu (1000), so config writes fail and NiFi never starts in integration tests. Temporarily pin upstream-source to a non-root rebuild on Docker Hub until canonical/nifi-rocks#3 publishes the non-root image to ghcr.
nikita-jare
left a comment
There was a problem hiding this comment.
LGTM! One non-blocking nit below
Add run_user and switch the service user/group to _daemon_, and chown /opt/nifi plus the /var/lib/nifi repositories and /var/log/nifi to uid/gid 584792 so the non-root workload retains read/write/exec access to every path the charm operates on. Update the goss tests to assert the _daemon_ user, ownership and the required path permissions.
46c5d43 to
949edd4
Compare
nikita-jare
left a comment
There was a problem hiding this comment.
Thank you @deusebio !
* feat: onboard nifi rock * add trailing newline * nifi: build from non-root rock commit (canonical/nifi-rocks#3) * Update end-of-life date for NiFi release 2.10-26.04
Why
The
nifi:2.10rock ran the workload asubuntu(uid/gid 1000). To comply with the non-root charm requirements, the workload must run as the shared non-root user_daemon_(uid/gid 584792) and retain read/write/exec access to every path the charm operates on:/opt/nifi/conf— charm pushesnifi.propertiesandstate-management.xml/opt/nifi/bin/nifi.sh— charm execs it for sensitive-key rotation/var/lib/nifi/{data,content_repository,provenance_repository}— Juju storage mounts/var/log/nifi— NiFi log directoryChanges to
2.10/rockcraft.yamlrun_user: _daemon_.nifiserviceuser/groupfromubuntuto_daemon_.user-setupoverride tochown/opt/nifiand the/var/lib/nifirepositories to584792:584792(viaNIFI_UID/NIFI_GID).Tests
Updated
2.10/goss.yamlto assert the workload runs as_daemon_(uid/gid 584792), that the_daemon_user exists, that all required paths are owned by_daemon_, and that they are writable/executable by the runtime user.Verified on the rebuilt rock:
Related