mirror of
https://github.com/m8tin/cis.git
synced 2026-08-01 11:47:31 +02:00
hardened printf
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
[ "$(id -u)" != "0" ] \
|
||||
&& printf "(INSUFFICENT RIGHTS) " \
|
||||
&& printf -- "(INSUFFICENT RIGHTS) " \
|
||||
&& exit 1
|
||||
|
||||
crontab -l | grep -E "[0-9]{1,2}[ \*]{8}[[:blank:]]*\/cis\/setupCoreOntoThisHost.sh" > /dev/null 2>&1 \
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
_CURRENT_FILE='/home/jenkins/.ssh/authorized_keys'
|
||||
|
||||
[ "$(id -u)" != "0" ] \
|
||||
&& printf "(INSUFFICENT RIGHTS) " \
|
||||
&& printf -- "(INSUFFICENT RIGHTS) " \
|
||||
&& exit 1
|
||||
|
||||
#File has to be readable, then
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
_CURRENT_FILE='/root/.ssh/authorized_keys'
|
||||
|
||||
[ "$(id -u)" != "0" ] \
|
||||
&& printf "(INSUFFICENT RIGHTS) " \
|
||||
&& printf -- "(INSUFFICENT RIGHTS) " \
|
||||
&& exit 1
|
||||
|
||||
#No file is ok
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
_CURRENT_FILE='/root/.ssh/id_ed25519'
|
||||
|
||||
[ "$(id -u)" != "0" ] \
|
||||
&& printf "(INSUFFICENT RIGHTS) " \
|
||||
&& printf -- "(INSUFFICENT RIGHTS) " \
|
||||
&& exit 1
|
||||
|
||||
#File has to be readable and no passphrase should be needed.
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
_CURRENT_FILE='/etc/sudoers.d/allow-jenkins-updateRepositories'
|
||||
|
||||
[ "$(id -u)" != "0" ] \
|
||||
&& printf "(INSUFFICENT RIGHTS) " \
|
||||
&& printf -- "(INSUFFICENT RIGHTS) " \
|
||||
&& exit 1
|
||||
|
||||
#File has to be readable, then
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
_CURRENT_USER='jenkins'
|
||||
|
||||
[ "$(id -u)" != "0" ] \
|
||||
&& printf "(INSUFFICENT RIGHTS) " \
|
||||
&& printf -- "(INSUFFICENT RIGHTS) " \
|
||||
&& exit 1
|
||||
|
||||
id -u "${_CURRENT_USER}" > /dev/null 2>&1 \
|
||||
|
||||
Reference in New Issue
Block a user