Skip to content

Commit

Permalink
fix: set limited permissions on package installs (#23683)
Browse files Browse the repository at this point in the history
* fix: set limited permissions on package installs

* fix: set umask in systemd service to create files as 0750
  • Loading branch information
jeffreyssmith2nd authored and jsternberg committed Sep 13, 2022
1 parent 485968c commit b51fefd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .circleci/package/control/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ elif [[ -f /etc/debian_version ]]; then
# Moving these lines out of this if statement would make `rmp -V` fail after installation.
chown -R -L influxdb:influxdb $LOG_DIR
chown -R -L influxdb:influxdb $DATA_DIR
chmod 755 $LOG_DIR
chmod 755 $DATA_DIR
chmod 750 $LOG_DIR
chmod 750 $DATA_DIR

# Debian/Ubuntu logic
if command -v systemctl &>/dev/null; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ KillMode=control-group
Restart=on-failure
Type=forking
PIDFile=/var/lib/influxdb/influxd.pid
UMask=0027

[Install]
WantedBy=multi-user.target
Expand Down
Empty file.
5 changes: 4 additions & 1 deletion .circleci/scripts/build-package
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ function run_fpm()
--after-remove control/postrm \
`# package files` \
--chdir fs/ \
--package /artifacts
--package /artifacts \
--directories /var/lib/influxdb \
--rpm-defattrdir 750 \
--rpm-defattrfile 750

popd

Expand Down

0 comments on commit b51fefd

Please sign in to comment.