kolla-ansible/ansible/roles/barbican
Mark Goddard 70c1a23e76 Allow fluentd to read barbican-api.log
Barbican API uses uWSGI, which by default writes out log files using
0640 permissions and default ownership for the user. This means that the
log file in /var/log/kolla/barbican/barbican-api.log is not readable by
fluentd.

This was tested via the following command on a queens deployment:

$ docker exec -it fluentd bash
find /var/log/kolla/ -type f | while read f; do test -r $f || echo
"Cannot read $f"; done
Cannot read /var/log/kolla/barbican/barbican-api.log

Generally there are a few ways in which access is provided to log file
for fluentd:

1. Set log file ownership to $USER:kolla, permissions to 0640.
2. Set log file ownership to $USER:$USER, permissions to 0644.
3. MariaDB is a special case, and uses 0640 with the fluentd user added
to the mysql group.

Of these, 1. seems the most secure.

This change uses the --logfile-chmod argument to set the log file
permissions to 644, since it does not appear possible to specify a group
to change ownership to using --logfile-chown. We use command line
arguments since putting the option in the config file does not seem to
work. Perhaps it is an ordering issue.

Change-Id: If98ca7cd9630b5622132a00718cb09304b8285b3
Closes-Bug: #1794472
(cherry picked from commit 8e635db8f1)
2018-10-08 09:05:42 +00:00
..
defaults Mixing binary and source images for A* and B* projects 2017-06-02 17:13:44 +07:00
handlers Optimize reconfiguration for barbican 2017-01-24 13:55:53 +00:00
meta Add Barbican ansible role 2016-09-13 02:56:27 +00:00
tasks Fix deployment with public TLS enabled 2017-11-17 19:31:33 +01:00
templates Allow fluentd to read barbican-api.log 2018-10-08 09:05:42 +00:00