AutomoxAutomox

Install Nessus Agent on Linux Hosts - Bash Script

chevychaser
August 10, 2021 at 4:34 pm UTC

has anyone created any worklets or required software policy for installing Nessus on linux hosts? This would include configuring the agent with the necessary switches.

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (2)

rafael.gAugust 12, 2021
#1

I have sort of a process - it’s clunky and I probably stole most of it.

A required software policy that uploads the .deb file and starts the service (need to add the .deb to the policy)

"
dpkg -i ‘NessusAgent-8.2.4-ubuntu1110_amd64.deb’
service nessusagent start
"

and then a worklet that links the agent
eval code:
"#!/bin/bash
TARGET=cloud
MESSAGE=$(./nessuscli agent status | sed -n 2,2p | awk ‘{print $3}’)
#echo $MESSAGE
if [[ $MESSAGE == “$TARGET” ]]; then

echo “match!”

1 line
exit 0

else

echo “no match!”

1 line
exit 1

fi
"

remediation code:
"
#!/bin/bash
cd /opt/nessus_agent/sbin
service nessusagent stop
./nessuscli agent link --key=thisisyourlongkey123456asdsffg --cloud
service nessusagent start
exit 0
"

chevychaserSeptember 16, 2021
#2

This is helpful, thank you!