Skip to content

Commit

Permalink
Added acl to journald logs
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-splunk committed Jan 20, 2023
1 parent 903b6d2 commit 9b92cc6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed

- Default recombine operator for the docker container engine (#627)
- Added acl to journald log directory (#639)

## [0.67.0] - 2022-12-19

Expand Down
12 changes: 9 additions & 3 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,21 @@ spec:
{{ if .Values.logsCollection.containers.enabled -}}
if [ -d "/var/lib/docker/containers" ];
then
setfacl -n -Rm d:g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx,g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx /var/lib/docker/containers;
setfacl -n -Rm d:m::rx,m::rx,d:g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx,g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx /var/lib/docker/containers;
fi;
if [ -d "/var/log/crio/pods" ];
then
setfacl -n -Rm d:g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx,g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx /var/log/crio/pods;
setfacl -n -Rm d:m::rx,m::rx,d:g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx,g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx /var/log/crio/pods;
fi;
if [ -d "/var/log/pods" ];
then
setfacl -n -Rm d:g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx,g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx /var/log/pods;
setfacl -n -Rm d:m::rx,m::rx,d:g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx,g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx /var/log/pods;
fi;
{{- end }}
{{- if .Values.logsCollection.journald.enabled }}
if [ -d "{{ .Values.logsCollection.journald.directory }}" ];
then
setfacl -n -Rm d:m::rx,m::rx,d:g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx,g:{{ $agent.securityContext.runAsGroup | default 20000 }}:rx {{ .Values.logsCollection.journald.directory }};
fi;
{{- end }}']
securityContext:
Expand Down

0 comments on commit 9b92cc6

Please sign in to comment.