mirror of
https://github.com/m8tin/cis.git
synced 2026-04-02 11:01:29 +02:00
Checks fixed and added
This commit is contained in:
21
script/check/host/all/core_ssh_config_access_restriction.check.sh
Executable file
21
script/check/host/all/core_ssh_config_access_restriction.check.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
_CURRENT_FILE='/etc/ssh/sshd_config.d/AccessRestriction.conf'
|
||||
|
||||
#No file is NOT ok
|
||||
[ ! -e "${_CURRENT_FILE}" ] \
|
||||
&& exit 1
|
||||
|
||||
#File has to be readable, then
|
||||
#search for '/definitions/' in the path of current file, after readlink expanded a potential symlink.
|
||||
[ -r "${_CURRENT_FILE}" ] \
|
||||
&& readlink -f "${_CURRENT_FILE}" | grep -q "/definitions/" \
|
||||
&& exit 0
|
||||
|
||||
#File has to be readable, then
|
||||
#search for '/core/default/' in the path of current file, after readlink expanded a potential symlink.
|
||||
[ -r "${_CURRENT_FILE}" ] \
|
||||
&& readlink -f "${_CURRENT_FILE}" | grep -q "/core/default/" \
|
||||
&& exit 0
|
||||
|
||||
exit 1
|
||||
@@ -12,4 +12,10 @@ _CURRENT_FILE='/etc/sudoers.d/allow-jenkins-updateRepositories'
|
||||
&& readlink -f "${_CURRENT_FILE}" | grep -q "/definitions/" \
|
||||
&& exit 0
|
||||
|
||||
#File has to be readable, then
|
||||
#search for '/core/default/' in the path of current file, after readlink expanded a potential symlink.
|
||||
[ -r "${_CURRENT_FILE}" ] \
|
||||
&& readlink -f "${_CURRENT_FILE}" | grep -q "/core/default/" \
|
||||
&& exit 0
|
||||
|
||||
exit 1
|
||||
|
||||
11
script/check/host/all/core_user_name_may_contain_dots.check.sh
Executable file
11
script/check/host/all/core_user_name_may_contain_dots.check.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
_FILE_NAME='/etc/adduser.conf'
|
||||
|
||||
# The first expression should filter the line conaining the key.
|
||||
# - here a regular expression (-E) is used to enforce the line starts with the key.
|
||||
# Second expression looks for the uninterpreted fix string (-F), but without output.
|
||||
grep -E '^NAME_REGEX=.*$' "${_FILE_NAME}" | grep -q -F '^[a-z][-a-z0-9_.]*\$?$' 2> /dev/null \
|
||||
&& exit 0
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user