Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions named-hosts/matic/falcon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ let
${pkgs.e2fsprogs}/bin/chattr -i -R /opt/CrowdStrike 2>/dev/null || true
fi

rm -rf /opt/CrowdStrike
install -d -m 0770 /opt/CrowdStrike

# Copy real files so Falcon can write falconstore/CsConfig
cp -a ${falcon}/opt/CrowdStrike/. /opt/CrowdStrike/
# Update binaries from the nix store, but preserve runtime state files.
# falconstore contains the Agent ID (AID) — if lost, the sensor re-registers
# as a new host and consumes another license seat.
${pkgs.rsync}/bin/rsync -a --delete \
--exclude=falconstore \
--exclude=falconstore.bak \
--exclude=CsConfig \
"${falcon}/opt/CrowdStrike/" /opt/CrowdStrike/
Comment on lines +30 to +34

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The rsync -a command includes the -p (--perms) flag, which causes the destination directory's permissions to be updated to match the source. This could override the 0770 permissions set on /opt/CrowdStrike by the install -d command on line 25, potentially making it world-readable depending on the permissions in the Nix store. This is a change in behavior from the previous cp -a .../. .../ command, which does not affect the target directory's permissions.

To ensure /opt/CrowdStrike retains its restrictive permissions, please re-apply them after the rsync command by adding:

chmod 0770 /opt/CrowdStrike

This should be placed after the rsync command.


chown -R root:root /opt/CrowdStrike

Expand Down
Loading