mirror of https://github.com/CISOfy/lynis.git
[TOOL-5002] Ansible detection added
This commit is contained in:
parent
358dc46b81
commit
43228c2ca7
|
@ -18,6 +18,7 @@
|
|||
#
|
||||
#################################################################################
|
||||
#
|
||||
ANSIBLE_ARTIFACT_FOUND=0
|
||||
AUTOMATION_TOOL_FOUND=0
|
||||
AUTOMATION_TOOL_RUNNING=""
|
||||
CFENGINE_AGENT_FOUND=0
|
||||
|
@ -51,13 +52,27 @@
|
|||
|
||||
Display --indent 2 --text "- Checking automation tooling"
|
||||
|
||||
# Ansible
|
||||
LIST="~/.ansible ~/.ansible-retry ${ROOTDIR}etc/ansible ${ROOTDIR}root/.ansible ${ROOTDIR}tmp/.ansible ${ROOTDIR}var/log/ansible.log"
|
||||
|
||||
for ITEM in ${LIST}; do
|
||||
if FileIsReadable ${ITEM}; then
|
||||
LogText "Result: found a possible trace of Ansible"
|
||||
AUTOMATION_TOOL_FOUND=1
|
||||
ANSIBLE_ARTIFACT_FOUND=1
|
||||
Report "automation_tool_running[]=ansible"
|
||||
Display --indent 4 --text "- Ansible artifact" --result "${STATUS_FOUND}" --color GREEN
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Cfengine
|
||||
if [ ! -z "${CFAGENTBINARY}" ]; then
|
||||
LogText "Result: CFEngine (cfagent) is installed (${CFAGENTBINARY})"
|
||||
AUTOMATION_TOOL_FOUND=1
|
||||
CFENGINE_AGENT_FOUND=1
|
||||
Report "automation_tool_running[]=cf-agent"
|
||||
Display --indent 4 --text "Found: Cfengine (cfagent)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- Cfengine (cfagent)" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
OTHER_CFENGINE_LOCATIONS="/var/cfengine/bin /var/rudder/cfengine-community/bin"
|
||||
for I in ${OTHER_CFENGINE_LOCATIONS}; do
|
||||
|
@ -67,7 +82,7 @@
|
|||
AUTOMATION_TOOL_FOUND=1
|
||||
CFENGINE_AGENT_FOUND=1
|
||||
Report "automation_tool_running[]=cf-agent"
|
||||
Display --indent 4 --text "Found: CFEngine (cf-agent)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- CFEngine (cf-agent)" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
IsRunning "cf-server"
|
||||
if [ ${RUNNING} -eq 1 ]; then
|
||||
|
@ -75,7 +90,7 @@
|
|||
AUTOMATION_TOOL_FOUND=1
|
||||
CFENGINE_SERVER_RUNNING=1
|
||||
Report "automation_tool_running[]=cf-server"
|
||||
Display --indent 4 --text "Found: CFEngine (cf-server)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- CFEngine (cf-server)" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@ -88,7 +103,7 @@
|
|||
CHEFCLIENTBINARY="${I}/chef-client"
|
||||
AUTOMATION_TOOL_FOUND=1
|
||||
Report "automation_tool_running[]=chef-client"
|
||||
Display --indent 4 --text "Found: Chef client (chef-client)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- Chef client (chef-client)" --result "${STATUS_FOUND}" --color GREEN
|
||||
LogText "Result: found chef-client (chef client daemon) in ${I}"
|
||||
fi
|
||||
if [ -f ${I}/erchef ]; then
|
||||
|
@ -96,7 +111,7 @@
|
|||
LogText "Result: Chef Server (erchef) is installed (${CHEFSERVERBINARY})"
|
||||
AUTOMATION_TOOL_FOUND=1
|
||||
Report "automation_tool_running[]=chef-server"
|
||||
Display --indent 4 --text "Found: Chef Server (erchef)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- Chef Server (erchef)" --result "${STATUS_FOUND}" --color GREEN
|
||||
LogText "Result: found erchef (chef server daemon) in ${I}"
|
||||
fi
|
||||
fi
|
||||
|
@ -115,7 +130,7 @@
|
|||
LogText "Result: Puppet is installed (${PUPPETBINARY})"
|
||||
AUTOMATION_TOOL_FOUND=1
|
||||
Report "automation_tool_running[]=puppet-agent"
|
||||
Display --indent 4 --text "Found: Puppet (agent)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- Puppet (agent)" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
|
||||
IsRunning "puppet master"
|
||||
|
@ -124,7 +139,7 @@
|
|||
AUTOMATION_TOOL_FOUND=1
|
||||
PUPPET_MASTER_RUNNING=1
|
||||
Report "automation_tool_running[]=puppet-master"
|
||||
Display --indent 4 --text "Found: Puppet (master)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- Puppet (master)" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
|
||||
# SaltStack
|
||||
|
@ -133,14 +148,14 @@
|
|||
AUTOMATION_TOOL_FOUND=1
|
||||
SALT_MINION_RUNNING=1
|
||||
Report "automation_tool_running[]=saltstack-minion"
|
||||
Display --indent 4 --text "Found: SaltStack minion (salt-minion)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- SaltStack minion (salt-minion)" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
if [ ! -z "${SALTMASTERBINARY}" ]; then
|
||||
LogText "Result: SaltStack (salt-master) is installed (${SALTMASTERBINARY})"
|
||||
AUTOMATION_TOOL_FOUND=1
|
||||
SALT_MASTER_RUNNING=1
|
||||
Report "automation_tool_running[]=saltstack-minion"
|
||||
Display --indent 4 --text "Found: SaltStack master (salt-master)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- SaltStack master (salt-master)" --result "${STATUS_FOUND}" --color GREEN
|
||||
else
|
||||
IsRunning "salt-master"
|
||||
if [ ${RUNNING} -eq 1 ]; then
|
||||
|
@ -148,7 +163,7 @@
|
|||
AUTOMATION_TOOL_FOUND=1
|
||||
SALT_MASTER_RUNNING=1
|
||||
Report "automation_tool_running[]=saltstack-master"
|
||||
Display --indent 4 --text "Found: SaltStack (master)" --result "${STATUS_FOUND}" --color GREEN
|
||||
Display --indent 4 --text "- SaltStack (master)" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue