Install Nessus Agent on Linux Hosts - Bash Script

  • 10 August 2021
  • 2 replies
  • 311 views

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.


2 replies

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!”


exit 0

else



echo “no match!”


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

"

This is helpful, thank you!

Reply