kolla-ansible/ansible/roles/barbican/templates
Mark Goddard 8e635db8f1 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
2018-09-26 10:43:08 +00:00
..
barbican-api.ini.j2 Generalize api_interface_address variable usage 2017-05-23 08:35:15 +00:00
barbican-api.json.j2 Allow fluentd to read barbican-api.log 2018-09-26 10:43:08 +00:00
barbican-keystone-listener.json.j2 Support policy.yaml file [part 4] 2018-01-22 01:57:02 +00:00
barbican-worker.json.j2 Support policy.yaml file [part 4] 2018-01-22 01:57:02 +00:00
barbican.conf.j2 Deprecate auth_uri option 2018-08-07 11:58:23 +05:30