Hello Phil,
I have done this, I just installed the pkg and then ran a script to write the launch agent and config
#!/bin/zsh
# Where the SNow Agent config needs to be
SNowAgentDir="/Library/Application Support/servicenow/agent-client-collector"
SNowAgentConfig="$SNowAgentDir/acc.yml"
SNowAgentAllowList="$SNowAgentDir/check-allow-list.json"
mkdir "${SNowAgentDir}"
echo "Creating ${SNowAgentConfig}."
(
cat <:/ws/events
# in case the MID Web server is configured to use Secure connection, use the following format: wss://:/ws/events
backend-url:
- "wss://CHANGEME:443/ws/events"
# Single authentication configuration for all backend-URLs:
# Specify the user name as defined on the MID web server.
#user: "admin"
# Specify the password as defined on the MID web server.
#password: "admin"
# Specify the API key used by the MID to authenticate incoming Agent connections
api-key: "encrypted:CHANGEME"
##
# Agent log file
##
# macOS location : /var/log/servicenow/agent-client-collector/acc.log
# Linux location : /var/log/servicenow/agent-client-collector/acc.log
# Windows location : C:\\ProgramData\\ServiceNow\\agent-client-collector\\log\\acc.log
# Allowed log-level values: panic, fatal, error, warn, info, debug
log-level: "info"
##
# security configuration
# in case the MID Web server is configured to use secure connection, refer to the following attributes:
# Setting to false (which is not the default value) will force certificate verification on the backend-client connection
skip-tls-verify: true
# Specify location of the SSL certificate file
#trusted-ca-file: "/path/to/trusted-certificate-authorities.pem"
# Path to json file that contains the allow list of check or hook commands the agent can execute
allow-list: /Library/Application\\ Support/ServiceNow/agent-client-collector/check-allow-list.json
# Redact the following parameters when the agent logs or sends keepalives
#redact:
# - username
# - bearer_token
# - auth_algorithm
# - access_key
# - enrollment_number
# - auth_method
# - client_id
# - ea_credential
# - certificate
# - cert_alias
# - secret_key
# - password
# - passwd
# - pass
# - api_key
# - api_token
# - private_key
# - secret
# - ssh_private_key
# - ssh_passphrase
# - authentication_key
# - authentication_protocol
# - privacy_key
# - privacy_protocol
# Specify location of the SSL certificate file
#trusted-ca-file: "/path/to/trusted-certificate-authorities.pem"
# Specify if plugins should be verified, Default = true.
#verify-plugin-signature: true
# Specify the maximum number of checks that can run in parallel.
max-running-checks: 10
# Defines the threshold for agent CPU usage. If threshold is exceeded, data collection will be turned off.
agent_cpu_threshold:
cpu_percentage_limit: 5 # CPU percentage limit. Default = 5.
repeated_high_cpu_num: 3 # Number of consecutive times the CPU percentage limit must be exceeded. Default = 3.
monitor_interval_sec: 60 # Indicates that the monitor will run every X seconds. Default = 60.
agent_cpu_threshold_disabled: false # Indicates whether gathering CPU threshold values for the agent protection feature is disabled.
proxy_cpu_percentage_limit: 80 # CPU percentage limit when agent is running proxy check(s). Default = 80
disable-sockets: true
statsd-disable: true
enable-auto-mid-selection: true # Enables or disables the Auto MID Selection feature. Disabling this feature means manual input of MID servers URLs using this file backend-url attribute.
# Specifies whether executables in the system PATH or ACC plugin executables have preference. Default is plugin executables (value: false).
#check-commands-prefer-installed: false
agent-key-id: CHANGEME
ENDOFSNOWAGENTCONFIG
) > "${SNowAgentConfig}"
echo "Creating ${SNowAgentAllowList}."
(
cat < 500\\"",
"\\"select pid, name, uid, resident_size from processes order by resident_size desc limit 10\\"",
"\\"select * from system_info\\"",
"\\"select * from certificates\\"",
"\\"select path, type, round((blocks_available * blocks_size *10e-10),2) as gigs_free from mounts where path='/'\\"",
"\\"select * from chrome_extensions\\"",
"\\"select name from kernel_info\\""
],
"exec":"osqueryi",
"skip_arguments":false
},
{
"args":[
""
],
"exec":"read-file.rb",
"skip_arguments":true
},
{
"args":[
""
],
"exec":"rebootcount.sh",
"skip_arguments":false
},
{
"args":[
"agent"
],
"exec":"Restart",
"skip_arguments":false
},
{
"args":[
""
],
"exec":"winchecks",
"skip_arguments":true
},
{
"args":[
"self-test",
"self-test debug",
"self-test verbose"
],
"exec":"acc",
"skip_arguments":false
}
]
ENDOFSNOWAGENTALLOWLIST
) > "${SNowAgentAllowList}"
chown -R _servicenow:_servicenow "${SNowAgentDir}" I'm by no means saying this is the best or only way to do it, but it worked for us. Search for the CHANGEME's to personalise it.
Hey @charliwest
the script gives me an error in the CAT command and the single line command gives me a write output permission error.