mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-12-18 20:58:10 +00:00
make the kubelet cafile test posix compliant (#643)
This commit is contained in:
parent
66692951c8
commit
2a325bd60d
@ -458,9 +458,7 @@ groups:
|
|||||||
text: Ensure that the client certificate authorities file ownership is set to root:root (Scored)
|
text: Ensure that the client certificate authorities file ownership is set to root:root (Scored)
|
||||||
audit: |
|
audit: |
|
||||||
CAFILE=$(ps -ef | grep kubelet | grep -v apiserver | grep -- --client-ca-file= | awk -F '--client-ca-file=' '{print $2}' | awk '{print $1}')
|
CAFILE=$(ps -ef | grep kubelet | grep -v apiserver | grep -- --client-ca-file= | awk -F '--client-ca-file=' '{print $2}' | awk '{print $1}')
|
||||||
if [[ -z $CAFILE ]]; then
|
if test -z $CAFILE; then CAFILE=$kubeletcafile; fi
|
||||||
CAFILE=$kubeletcafile
|
|
||||||
fi
|
|
||||||
if test -e $CAFILE; then stat -c %U:%G $CAFILE; fi
|
if test -e $CAFILE; then stat -c %U:%G $CAFILE; fi
|
||||||
tests:
|
tests:
|
||||||
test_items:
|
test_items:
|
||||||
|
@ -449,9 +449,7 @@ groups:
|
|||||||
text: Ensure that the client certificate authorities file ownership is set to root:root (Scored)
|
text: Ensure that the client certificate authorities file ownership is set to root:root (Scored)
|
||||||
audit: |
|
audit: |
|
||||||
CAFILE=$(ps -ef | grep kubelet | grep -v apiserver | grep -- --client-ca-file= | awk -F '--client-ca-file=' '{print $2}' | awk '{print $1}')
|
CAFILE=$(ps -ef | grep kubelet | grep -v apiserver | grep -- --client-ca-file= | awk -F '--client-ca-file=' '{print $2}' | awk '{print $1}')
|
||||||
if [[ -z $CAFILE ]]; then
|
if test -z $CAFILE; then CAFILE=$kubeletcafile; fi
|
||||||
CAFILE=$kubeletcafile
|
|
||||||
fi
|
|
||||||
if test -e $CAFILE; then stat -c %U:%G $CAFILE; fi
|
if test -e $CAFILE; then stat -c %U:%G $CAFILE; fi
|
||||||
tests:
|
tests:
|
||||||
test_items:
|
test_items:
|
||||||
|
@ -119,9 +119,7 @@ groups:
|
|||||||
text: "Ensure that the client certificate authorities file ownership is set to root:root (Scored)"
|
text: "Ensure that the client certificate authorities file ownership is set to root:root (Scored)"
|
||||||
audit: |
|
audit: |
|
||||||
CAFILE=$(ps -ef | grep kubelet | grep -v apiserver | grep -- --client-ca-file= | awk -F '--client-ca-file=' '{print $2}' | awk '{print $1}')
|
CAFILE=$(ps -ef | grep kubelet | grep -v apiserver | grep -- --client-ca-file= | awk -F '--client-ca-file=' '{print $2}' | awk '{print $1}')
|
||||||
if [[ -z $CAFILE ]]; then
|
if test -z $CAFILE; then CAFILE=$kubeletcafile; fi
|
||||||
CAFILE=$kubeletcafile
|
|
||||||
fi
|
|
||||||
if test -e $CAFILE; then stat -c %U:%G $CAFILE; fi
|
if test -e $CAFILE; then stat -c %U:%G $CAFILE; fi
|
||||||
tests:
|
tests:
|
||||||
test_items:
|
test_items:
|
||||||
|
Loading…
Reference in New Issue
Block a user