Qualys Cloud Agent Linux Install Guide
Qualys Cloud Agent Linux Install Guide
Installation Guide
Agent Version 2.1, 2.3, 2.4, 2.6, 3.1, 3.3
Verity Confidential
Copyright 2016-2021 by Qualys, Inc. All Rights Reserved.
Qualys and the Qualys logo are registered trademarks of Qualys, Inc. All other trademarks
are the property of their respective owners.
Qualys, Inc.
919 E Hillsdale Blvd
4th Floor
Foster City, CA 94404
1 (650) 801 6100
Table of Contents
Preface................................................................................................................. 5
About Qualys ........................................................................................................................... 5
Contact Qualys Support .......................................................................................................... 5
Installation .......................................................................................................... 8
Tips and best practices ........................................................................................................... 8
How to download Agent Installer .......................................................................................... 9
Installation steps ................................................................................................................... 11
What you’ll need ............................................................................................................. 11
Steps to install Agents .................................................................................................... 11
Install Agents in Gold Images ........................................................................................ 12
What happens next? ....................................................................................................... 12
Troubleshooting .............................................................................................................. 12
Proxy configuration ............................................................................................................... 14
Multiple Proxy Server support in Proxy URL (Linux Agent 2.5 or later) .......................... 15
Anti-Virus and HIPS Exclusion / Whitelisting .................................................................... 16
Using the hostid from previous installation ....................................................................... 17
Configuration Tool...........................................................................................18
Command line options ......................................................................................................... 18
Use cases ................................................................................................................................ 21
Verity Confidential
Certificate Support on RHEL 5.4 ................................................................ 28
Certificate Support on SUSE Linux Enterprise 11 ....................................30
Proxy Configuration Encryption Utility ......................................................31
Preface
About Qualys
Preface
Welcome to Qualys Cloud Agent for Linux. This user guide describes how to install cloud
agents on hosts in your network.
About Qualys
Qualys, Inc. (NASDAQ: QLYS) is a pioneer and leading provider of cloud-based security and
compliance solutions. The Qualys Cloud Platform and its integrated apps help businesses
simplify security operations and lower the cost of compliance by delivering critical
security intelligence on demand and automating the full spectrum of auditing,
compliance and protection for IT systems and web applications.
Founded in 1999, Qualys has established strategic partnerships with leading managed
service providers and consulting organizations including Accenture, BT, Cognizant
Technology Solutions, Deutsche Telekom, Fujitsu, HCL, HP Enterprise, IBM, Infosys, NTT,
Optiv, SecureWorks, Tata Communications, Verizon and Wipro. The company is also a
founding member of the Cloud Security Alliance (CSA). For more information, please visit
www.qualys.com.
5
Get Started
Qualys Cloud Agent Introduction
Get Started
Thank you for your interest in Qualys Cloud Agent!
This document tells you all about installing Qualys Cloud Agent for Linux. We’ll tell you
about Requirements, Installation Steps, Proxy Configuration, Anti-Virus and HIPS
Exclusion / Whitelisting, how to use our Agent Configuration Tool, Best Practices and
more.
Video Tutorials
Cloud Agent Platform Introduction (2m 10s)
Getting Started Tutorial (4m 58s)
6
Get Started
Credentials - what are my options?
Learn more
Troubleshooting
Error messages
7
Installation
Tips and best practices
Installation
It’s easy to install Cloud Agent for Linux. We’ll walk you through the steps quickly.
Qualys provides installers and packages for each supported operating system that are
coded for each Qualys platform. It's not possible to connect an agent coded for one
platform to another platform. Organizations can use their existing software distribution
tools (SCCM, BigFix, rpm, Casper, etc.) to install the agent into target machines. Cloud
Agent can be installed into gold images including VM templates and cloud provider
images such as Amazon AWS, Microsoft Azure, and Google Compute Platform.
The platform supports detection of duplicate agent IDs and automatically re-provisions
the duplicate agents. The section Install Agents in Gold Images describes how to install an
agent into a gold image without initial provisioning. This is the recommended method to
prevent duplicate asset records.
Customers using software distribution tools must package the Qualys-provided installer
along with the specific Activation Key and Customer ID strings to install properly. Do not
package up the artifacts that are installed by the agent into your own installer as the
installation environment is keyed for that specific machine when the agent is installed;
doing so will create duplicates that the platform may not be able to easily de-duplicate.
Keep in mind - Depending on your environment, you might need to take steps to support
communications between agent hosts on your network and the Qualys Cloud Platform.
Tips and best practices
How to download Agent Installer
Installation steps
Proxy configuration
Multiple Proxy Server support in Proxy URL (Linux Agent 2.5 or later)
Need to Bypass Proxy?
Using the hostid from previous installation
If you are reinstalling the agent on the same machine, and you want to reuse the earlier
hostid, set HostIdSearchDir to /root/hostdir.
8
Installation
How to download Agent Installer
Running the agent installer You’ll need to run the installer from an elevated command
prompt, or use a systems management tool using elevated privileges.
Be sure to activate agents to provision agents for modules - Vulnerability Management
(VM), Policy Compliance (PC), or File Integrity Monitoring (FIM). Activating an agent for a
module consumes an agent license. You can set up auto activation by defining modules
for activation keys, or do it manually in the Cloud Agent UI.
What happens if I skip activation? Agents will sync inventory information only to the
cloud platform (IP address, OS, DNS and NetBIOS names, MAC address), host assessments
will not be performed.
How many agents can I install? You can install any number of agents but can activate an
agent only if you have a license. The Agents tab in the Cloud Agent UI tells you about your
installed agents.
Check to be sure agents are connected Once installed agents connect to the Qualys Cloud
Platform and provision themselves. You can see agent status on the Agents tab - this is
updated continuously. If your agent doesn’t have a status, it has not successfully
connected to the cloud platform and you need to troubleshoot.
net-tools package You may need to install the net-tools package on agent endpoints, if not
already present, in order to run network commands. This is required on systems running
Red Hat Enterprise Linux, Oracle Enterprise Linux, and CentOS version 7.1 since some
commands like netstat, /sbin/ifconfig, route are deprecated.
9
Installation
How to download Agent Installer
Log into the Qualys Cloud Platform and select CA for the Cloud Agent module.
Choose an activation key (create one if needed) and select Install Agent from the Quick
Actions menu.
10
Installation
Installation steps
Installation steps
What you’ll need
To install cloud agents, you’ll need to download the Cloud Agent installer and get the
associated ActivationID and CustomerID. Just log into the Qualys Cloud Platform, go to the
Cloud Agent (CA) module, and follow the installation steps for Linux (.rpm) or Linux (.deb)
to get everything you need.
Cloud Agent requirements
Linux (.deb)
> sudo dpkg --install qualys-cloud-agent.x86_64.deb
> sudo /usr/local/qualys/cloud-agent/bin/qualys-cloud-agent.sh
ActivationId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CustomerId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
11
Installation
Installation steps
6. Stop the instance and create an image out of the instance. This completes the bake-in
process.
When the instance is started it will activate the Cloud Agent which will provision itself
and continue functioning as expected.
Troubleshooting
You’ll find helpful information in Qualys online help.
Learn more
Troubleshooting
Error messages
Cloud agents installed on RHEL 5.4 may throw SSL communication errors while trying to
communicate with the Qualys Platform. This happens when the certificate files are not
present on the host asset. Click here for solution to fix the issue.
12
Installation
Installation steps
Cloud agents installed on SUSE Linux Enterprise 11 may throw a file not found error for
the certificate ca-bundle.crt when trying to communicate with the Qualys Platform. This
happens when the certificate files are not present on the host asset. Click here for solution
to fix the issue.
13
Installation
Proxy configuration
Proxy configuration
Good to Know By default the Cloud Agent for Linux will operate in non-proxy mode. The
agent can be configured to use an HTTPS proxy for internet access.
Note:
- For Azure Security Center (ASC), use an HTTP proxy.
- If proxy connection fails then agent will NOT attempt a direct connection outbound (Fail
Closed).
where <username> and <password> are specified if the https proxy uses authentication. If
special characters are embedded in the username or password (e.g. @, :, $) they need to be
url-encoded. where <host> is the proxy server's IPv4 address or FQDN. where <port> is the
proxy's port number.
If the proxy is specified with the https_proxy environment variable, it will be used for all
commands performed by the Cloud Agent. If the proxy is specified with the
qualys_https_proxy environment variable, it will only be used by the Cloud Agent to
communicate with our cloud platform.
Note: You can use the Proxy Configuration Encryption Utility to encrypt the user name
and password that you provide to the proxy environment variable.
3) change the permissions using these commands:
Linux (.rpm)
chown <cloud_agent_user> /etc/sysconfig/qualys-cloud-agent
chmod 600 /etc/sysconfig/qualys-cloud-agent
Linux (.deb)
14
Installation
Multiple Proxy Server support in Proxy URL (Linux Agent 2.5 or later)
Note: For init.d based systems, you need to prefix 'export' to ‘no_proxy’ line.
15
Installation
Anti-Virus and HIPS Exclusion / Whitelisting
The list of proxies must be given in double quotes (“...”) and separated by a semi-colon (;),
and if ";" is embedded in username/password, you must url-encode it. You can use the
Proxy Configuration Encryption Utility to encrypt the user name and/or password that
you provide to the proxy environment variable.
You can combine multiple proxy certificates into a single file, and place it at same location
as earlier /etc/qualys/cloud-agent/cert/ca-bundle.crt. Ensure that all certificates are valid,
else you might get SSL/certificate errors.
16
Installation
Using the hostid from previous installation
17
Configuration Tool
Command line options
Configuration Tool
The Agent Configuration Tool gives you many options for configuring Cloud Agent for
Linux after installation. You’ll find this tool at /usr/local/qualys/cloud-agent/qualys-
cloud-agent.sh.
Our configuration tool allows you to:
- Provision agents
- Configure logging - set a custom log level and log file path
- Enable Sudo to run all data collection commands
- Configure the daemon to run as a specific user and/or group
- Change the ActivationID, CustomerID and/or platform configuration
The Agent will automatically pick up changes made through the configuration tool so
there is no need to restart the agent or reboot the agent host.
Note: While switching from low privileged user to high privileged user, it is not
recommended to directly run the configuration tool on the already running agents. The
user should first stop the agent and then run the configuration tool to switch to a high
privileged user.
18
Configuration Tool
Command line options
19
Configuration Tool
Command line options
20
Configuration Tool
Use cases
Use cases
Example 1 – Provision Agent
The following example shows how to provision Qualys Cloud Agent. Please note that this
method of activation will assume that root user should be used by the agent.
$ /usr/local/qualys/cloud-agent/bin/qualys-cloud-agent.sh
ActivationId="022224c8-31c7-11e5-b4f7-0021ccba987e"
CustomerId="146556fa-31c7-11e5-87b6-0021ccba987e"
Keep in mind - A new group needs to exist when the configuration command runs. The
expectation is that the non-root user will be added to the specified group to allow it to
access binary and temporary files that comprise Qualys Cloud Agent. In order to perform
unattended data collection the non-root user needs to have sudo privilege without a
password.
Note: We’ve omitted the ActivationID and CustomerID parameters to illustrate the
configuration tool can be used to adjust the log level after provisioning.
21
On Demand Scan
On Demand Scan
You can run an On Demand Scan to instruct the agent to immediately scan as long as the
agent is not already scanning. The On Demand Scan runs independently of the interval
scan that you configure in the Configuration Profile and will reset the scan interval on the
local agent after a successful scan.
Prerequisite: The agent must be activated for that specific Qualys application for which
you are running the On Demand Scan. When activated, the Agent downloads manifests
for that application from the Qualys platform; if the manifest is not present for that type,
On Demand Scan will not execute.
Use the cloudagentctl.sh script to run the OnDemand Scan. You’ll find this script at
/usr/local/qualys/cloud-agent/bin/.
># ./cloudagentctl.sh action={demand} type={vm|pc|inv|udc|sca|vmpc}
cputhrottle={0-1000}
If the agent is currently performing an interval scan for the same type, the On Demand
Scan will delay waiting for the currently running scan to finish. The script will print a log
line with this status.
2020-04-27 15:11:36.474 [qualys-cloud-
agent][9710]:[Information]:[140048573286144]:Interval Event of same type
is in progress with state INTERVAL_EVENT_SCAN
22
On Demand Scan
If the script errors due to the manifest file not being present, check whether the Cloud
Agent is activated for that particular application. If agent is activated but you still get
manifest related errors while running the On Demand Scan command, the agent may not
have downloaded the manifest for that application. You can manually force a manifest
download by deactivating then reactivating the agent for that application from the Cloud
Agent user interface module. If that doesn't correct the issue, contact Qualys Support.
Once an On Demand Scan is complete the results are logged in the log file located at
/var/log/qualys/qualys-cloud-agent.log.
23
Best Practices
Upgrading Cloud Agent
Best Practices
Here are some best practices for managing your cloud agents. Refer to the Cloud Agent
Technical Whitepaper for additional documentation and best practices.
24
Best Practices
Agentless Tracking and Cloud Agents
25
Best Practices
Agentless Tracking and Cloud Agents
26
Known Issues
Known Issues
Here are some known issues/limitations in the cloud agents.
– FIM rules displayed using the command auditctl do not show system calls. The
rules work successfully even though system calls are not seen.
– There is audit limitation to set the full directory path while configuring profile for
FIM. You can set the limited path in the Rule Details from module - FIM >
Configuration > Profiles. Use Case: If you have a file (for example, a file with
filename) under directory /root/test/directoryname and if you delete
directoryname, audit system does not provide correct file path. In that case the
file present with /root/test/directoryname/filename is considered as
/root/test/filename by fimc process.
– Audit rules should not have rules to exclude EOE and CWD audit records in order
to parse a event in the agent. You need to restart your agent after removing these
rules.
– For CentOS 7.6.1810, rename event with mv command does not work if you have
created FIM config profile with rule to rename a directory or a file.
– Cloud Agent with version 3.0 or later terminates when user configures invalid
sudo command using qualys-cloud-agent.sh script or HostID file has insufficient
permissions.
– If the remediation manifest is received during polling before clone detection, it will
be executed by both the agents. If the clone machine acknowledges manifest
before the master starts polling, master agent won't receive remediation manifest,
but the status will be updated as per status reported by the clone instance.
– Remediation manifest execution fails if you switch from root user to non-sudo
user while execution is in progress. You must execute the remediation manifest
with the root user.
27
Certificate Support on RHEL 5.4
To fix this issue, you must manually create the certificate files, and place them in the
appropriate location on the host asset.
Create the two cert files: cert1.crt and cert2.crt. Paste the contents in a text editor, and
then save the file with the extension “.crt”.
Use the following commands to append the contents of cer1.crt and cert2.crt at the end of
/etc/pki/tls/certs/ca-bundle.crt
cat cert1.crt >> /etc/pki/tls/certs/ca-bundle.crt
cat cert2.crt >> /etc/pki/tls/certs/ca-bundle.crt
cert1.crt
subject= /C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA
issuer= /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA
-----BEGIN CERTIFICATE-----
MIIElDCCA3ygAwIBAgIQAf2j627KdciIQ4tyS8+8kTANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0xMzAzMDgxMjAwMDBaFw0yMzAzMDgxMjAwMDBaME0xCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxJzAlBgNVBAMTHkRpZ2lDZXJ0IFNIQTIg
U2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
ANyuWJBNwcQwFZA1W248ghX1LFy949v/cUP6ZCWA1O4Yok3wZtAKc24RmDYXZK83
nf36QYSvx6+M/hpzTc8zl5CilodTgyu5pnVILR1WN3vaMTIa16yrBvSqXUu3R0bd
KpPDkC55gIDvEwRqFDu1m5K+wgdlTvza/P96rtxcflUxDOg5B6TXvi/TC2rSsd9f
/ld0Uzs1gN2ujkSYs58O09rg1/RrKatEp0tYhG2SS4HD2nOLEpdIkARFdRrdNzGX
kujNVA075ME/OV4uuPNcfhCOhkEAjUVmR7ChZc6gqikJTvOX6+guqw9ypzAO+sf0
/RR3w6RbKFfCs/mC/bdFWJsCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8C
AQAwDgYDVR0PAQH/BAQDAgGGMDQGCCsGAQUFBwEBBCgwJjAkBggrBgEFBQcwAYYY
aHR0cDovL29jc3AuZGlnaWNlcnQuY29tMHsGA1UdHwR0MHIwN6A1oDOGMWh0dHA6
Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RDQS5jcmwwN6A1
oDOGMWh0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RD
QS5jcmwwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8v
d3d3LmRpZ2ljZXJ0LmNvbS9DUFMwHQYDVR0OBBYEFA+AYRyCMWHVLyjnjUY4tCzh
xtniMB8GA1UdIwQYMBaAFAPeUDVW0Uy7ZvCj4hsbw5eyPdFVMA0GCSqGSIb3DQEB
28
Certificate Support on RHEL 5.4
CwUAA4IBAQAjPt9L0jFCpbZ+QlwaRMxp0Wi0XUvgBCFsS+JtzLHgl4+mUwnNqipl
5TlPHoOlblyYoiQm5vuh7ZPHLgLGTUq/sELfeNqzqPlt/yGFUzZgTHbO7Djc1lGA
8MXW5dRNJ2Srm8c+cftIl7gzbckTB+6WohsYFfZcTEDts8Ls/3HB40f/1LkAtDdC
2iDJ6m6K7hQGrn2iWZiIqBtvLfTyyRRfJs8sjX7tN8Cp1Tm5gr8ZDOo0rwAhaPit
c+LJMto4JQtV05od8GiG7S5BNO98pVAdvzr508EIDObtHopYJeS4d60tbvVS3bR0
j6tJLp07kzQoH3jOlOrHvdPJbRzeXDLz
-----END CERTIFICATE-----
cert2.crt
subject= /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA
issuer= /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA
-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0wNjExMTAwMDAwMD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ICATE-----
29
Certificate Support on SUSE Linux Enterprise 11
To fix this issue, you must manually install the certificate files in the appropriate location
on the host asset. You can either use the certificate files from your existing RHEL or
CentOS assets or download the certificate files from the following location:
https://curl.haxx.se/docs/caextract.html
Download the file cacert.pem and rename it to ca-bundle.pem.
Copy the certificate files (ca-bundle.pem) at the following default location on SUSE Linux
Enterprise 11:
/etc/ssl/
If you want to use a non default location, ensure that the directory path is added in the
/etc/qualys/cloud-agent/qagent.config file in the following manner:
{
"os": "Suse",
"cafile": "<CustomizedPath>"
}
Now restart the QAgent Service.
30
Proxy Configuration Encryption Utility
Use the following command to run the utility to encrypt the user name and/or password.
If you want to encrypt both, run the utility twice to separately encrypt the user name and
password.
Note: You need root privileges to run string-util. If the user name or password contain
special characters (e.g., @, :, $) they need to be url-encoded prior to using the utility.
To encrypt the user name (use double quotes):
./string-util "<user name_to_be_encrypted>"
For example,
./string-util "sys_account"
Once you get the encrypted user name add/or password, unset the LD_LIBRARY_PATH
variable by using the following command:
export LD_LIBRARY_PATH=
31
Proxy Configuration Encryption Utility
Provide the encrypted user name and password to your proxy environment variable.
qualys_https_proxy=https://[<#encrypted_username>:<#encrypted_password>@
]<host>[:<port>]
The # delimiter indicates to the Cloud Agent that the user name and password are
encrypted. Not including the # indicates that the user name and password are in plain text
format.
For example (only encrypting password):
qualys_https_proxy=https://sys_account:#[email protected]
yco.com:8080
32