Skip to main content

Worklet: Install SentinelOne Agent (Linux)

  • March 24, 2022
  • 0 replies
  • 12481 views

Hi, everybody! Since announcing our strategic alliance that pairs our two platforms, Automox has developed customized Worklets for SentinelOne that includes pre-built scripts for automatic deployment of the SentinelOne agent across Windows, Linux and macOS devices - without manual intervention or wasted IT cycles. Below you’ll find the worklet for Linux.

Big thanks to @Zac-Automox  for getting these written. 🤘

 

Worklet Details: Install SentinelOne Agent (Linux)

 

Evaluation Code

#!/bin/bash

#================================================================
# HEADER
#================================================================
#  SYNOPSIS
#    Installs the SentinelOne agent on the endpoint.
#
#  DESCRIPTION
#    This worklet will check to see if the SentinelOne agent is
#    installed on the target device.
#
#  USAGE
#    ./evaluation.sh
#
#================================================================
#  IMPLEMENTATION
#    version         STRAT-1_install_sentinelone_agent (www.automox.com) 1.0
#    author          Zac Youtz
#
#================================================================
#  HISTORY
#    8/13/2021 : Zac Youtz : Script creation
# 
#================================================================
# END_OF_HEADER
#================================================================

# evaluate the device to see if the Sentinel One is installed
if sudo sentinelctl version > /dev/null; then
  echo "Software is already installed"
  exit 0
else
  echo "Software not installed - Flagging for installation"
  exit 1
fi

 

Remediation Code

#!/bin/bash

#================================================================
# HEADER
#================================================================
#  SYNOPSIS
#    Installs the SentinelOne Agent on the target device
#
#  DESCRIPTION
#    This worklet checks to see if the SentinelOne Agent is installed
#    on the target device and if it isn't, installs and registers the
#    SentinelOne Agent on the device.
#
#  USAGE
#    ./remediation.sh
#
#  EXAMPLE
#    rpm_filename="SentinelAgent_linux_v21_6_3_7.rpm"
#    deb_filename="SentinelAgent_linux_v21_6_3_7.deb"
#    site_token="ABCD123"
#
#================================================================
#  IMPLEMENTATION
#    version         STRAT-1_install_sentinelone_agent (www.automox.com) 1.0
#    author          Zac Youtz
#
#================================================================
#  HISTORY
#     8/13/2021 : Zac Youtz : Script creation
#
#
#================================================================
# END_OF_HEADER
#================================================================

#########################
rpm_filename=""
deb_filename=""
site_token=""
#########################
# CONSTANTS
rpm_installer="$(pwd)/$rpm_filename"
deb_installer="$(pwd)/$deb_filename"
#########################

# Check if SentinelOne is already installed
if sudo sentinelctl version > /dev/null; then
  echo "Software is already installed"
  exit 0
fi

install_command=""
# Define install command based on system type
if [ -x "$(command -v dpkg)" ]; then
  echo "Installing $deb_installer"

  install_command="sudo dpkg -i $deb_installer"
elif [ -x "$(command -v rpm)" ]; then
  echo "Installing $rpm_installer"

  install_command="sudo rpm -i --nodigest $rpm_installer"
else
  echo "Unable to install software; either rpm or dpkg package manager must be present on system"
  exit 1
fi

if eval "$install_command"; then
  echo "Software successfully installed"

  echo "Registering SentinelOne agent"
  sudo /opt/sentinelone/bin/sentinelctl management token set "$site_token"
  sudo /opt/sentinelone/bin/sentinelctl control start
  exit 0
else
  echo "Software failed to install"
  exit 1
fi

 

How helpful was this post to you?

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings