CB Response 6.5 Server Cluster Management Guide
CB Response 6.5 Server Cluster Management Guide
Management Guide
Server Version: 6.5
Document Date: August 2019
CB Response 6.5 Server/Cluster Management Guide Copyrights and Notices
August 2019 2
CB Response 6.5 Server/Cluster Management Guide Copyrights and Notices
August 2019 3
CB Response 6.5 Server/Cluster Management Guide Copyrights and Notices
Permission is hereby granted, free of charge, to any person obtaining a copy of the above third-party software and
associated documentation files (collectively, the "Software"), to deal in the Software without restriction, including without
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notices and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE LISTED ABOVE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
August 2019 4
Before You Begin
Sections
Topic Page
What this Document Covers 6
Other Documentation 6
Community Resources 7
Contacting Support 7
August 2019 5
CB Response 6.5 Server/Cluster Management Guide Before You Begin
Chapter Description
1 Server Overview Provides an overview of the CB Response server
technology stack, daemons, configuration, and logs.
2 Installing the Explains how to install/initialize a new CB Response
CB Response Server server, as well as how to upgrade, troubleshoot, and
uninstall the server.
3 Server Backup and Explains how to perform various backup and restore
Restoration procedures.
4 Ports and Protocols Provides a collection of tables that detail port and
protocol information for several different server
communications
5 Installing a CB Response Introduces CB Response clusters and explains how
Cluster to configure clusters, add minions to existing clusters,
remove minion nodes from clusters, and upgrade
cluster nodes
6 Using CBCLUSTER as a Describes how to use the CBCLUSTER command as
Non-Root User a non-root user.
Other Documentation
Visit the Carbon Black User Exchange website at https://community.carbonblack.com to
locate documentation for tasks not covered in this guide as well as other documents
maintained as a knowledge base for technical support solutions. Some of these
documents are updated with every newly released build, while others are updated only for
minor or major version changes. Documents include:
• CB Response Release Notes – Provides information about new and modified
features, issues resolved and general improvements in this release, and known issues
and limitations. It also includes required or suggested preparatory steps before
installing the server.
• CB Response Operating Environment Requirements (OER) – Describes performance
and scalability considerations in deploying a CB Response server. This was called the
Server Sizing Guide in previous releases.
• CB Response Server Configuration Guide (cb.conf) – Describes the CB Response
server configuration file (cb.conf), including options, descriptions, and parameters.
• CB Response Server / Cluster Management Guide – (this document) Describes how
to install, manage, backup/restore, etc. a CB Response server/cluster. This guide is
for on-premises CB Response installations only.
• CB Response User Guide – Describes the CB Response product and explains how to
use all of its features and perform administration tasks. Beginning with CB Response
Server 6.5, this User Guide is also available online through the Help menu in the
console.
August 2019 6
CB Response 6.5 Server/Cluster Management Guide Before You Begin
• CB Response Unified View User Guide – Describes how to install and manage
Cb Response Unified View.
• CB Response Integration Guide – Provides information for administrators who are
responsible for integrating CB Response with various tools, such as CB Protection,
EMET, VDI, SSO, and more.
• CB Response API – Documentation for the CB Response REST API is located at
https://developer.carbonblack.com/reference/enterprise-response. Documentation for
the Python module that can be used for easy access to the REST API is hosted at
https://cbapi.readthedocs.io.
• CB Response connectors – A connector enables communication between a third-
party product and CB Response server. Documentation describing how to install,
configure and maintain various Carbon Black connectors is located at
https://developer.carbonblack.com/guide/enterprise-response/#connectors.
Community Resources
The Carbon Black User Exchange website at https://community.carbonblack.com provides
access to information shared by Carbon Black customers, employees and partners. It
includes information and community participation for users of all Carbon Black products.
When you log into this resource, you can:
• Ask questions and provide answers to other users’ questions.
• Enter a “vote” to bump up the status of product ideas.
• Download the latest user documentation.
• Participate in the Carbon Black developer community by posting ideas and solutions
or discussing those posted by others.
• View the training resources available for Carbon Black products.
You must have a login account to access the User Exchange. Contact your Technical
Support representative if you need to get an account.
Contacting Support
Carbon Black Technical Support offers several channels for resolving support questions:
August 2019 7
CB Response 6.5 Server/Cluster Management Guide Before You Begin
Reporting Problems
When you call or email technical support, provide the following information to the support
representative:
Required Description
Information
Contact Your name, company name, telephone number, and email address
Product version Product name and version number
Hardware Hardware configuration of the server or computer the product is
configuration running on (processor, memory, and RAM)
Document For documentation issues, specify the title, version and date of the
version manual you are using. The date and version of the document
appear on the cover page, or for longer manuals, at the end of the
Copyrights and Notices section.
Problem Action causing the problem, error message returned, and any other
appropriate output
Problem severity Critical, serious, minor, or enhancement
August 2019 8
CB Response 6.5 Server/Cluster Management Guide Contents
Contents
Copyrights and Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1 Server Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Server Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Server Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Log Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Error in the CB Response Console Interface . . . . . . . . . . . . . . . . . . . . . . . 16
Sensors Are Not Checking in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Ensure that Everything is Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
August 2019 9
CB Response 6.5 Server/Cluster Management Guide Contents
August 2019 10
CB Response 6.5 Server/Cluster Management Guide How to . . .
L i s t o f Ta s k s
How to . . .
This section lists procedures documented as stepwise tasks in this guide. Some single-step tasks
and tasks that are more easily explained in the context of a paragraph are not included here. If you
do not see the task you are looking for, see the main Contents pages.
August 2019 11
Chapter 1
Server Overview
Sections
Topic Page
Server Overview 13
Server Configuration 15
Server Logs 16
August 2019 12
CB Response 6.5 Server/Cluster Management Guide Server Overview
Server Overview
This section describes the technology stack on a CB Response server. Five major
daemons exist in CB Response server, as described in the following table:
Daemon Description
cb-nginx Used as an HTTP reverse proxy to internal daemons.
cb-coreservices (Python, Gunicorn) All non-data application logic for
HTTP transactions.
cb-datastore (Java/Jetty) All incoming data, including event logs and
binary files.
cb-solr (Java/Jetty) Apache Solr, the primary data store.
cb-postgres Traditional relational database.
cb- Handles all non-data sensor requests, such as sensor
sensorservices check-ins, registrations, and upgrades.
nginx is the only daemon with public sockets. The remaining daemons are bound to the
CB Response server using the default IP address, which is 127.0.0.1, and can only be
accessed locally or by using the nginx reverse proxy.
nginx owns tcp/80 and tcp/443 and redirects to coreservices, cb-datastore or
cb-sensorservices to the CB Response web root:q based on the URL prefix, as
described in the following table:
nginx Redirects to
/ /var/www/cb/
/api/* coreservices on tcp/5000
/sensor/* sensorservices on tcp/6500 and 6501
/data/* cb-datastore on tcp/9000
Note
coreservices handles /api/*
All /api/ URLs are used by the CB Response console interface and by
REST clients.
sensorservices handles /sensor/*
All /sensor/ URLs are used by the sensors that are pushing data. These
URLs are isolated to allow binding a separate nginx server instance to
tcp/443 on a public / DMZ interface for sensors that are outside of the
internal network (for example, sensors on laptops used by traveling
employees, and work laptops that are at employees’ homes) without
exposing the /api/ interfaces externally. You can isolate these URLs by
using a simple nginx configuration change, as shown in the example in
the file:
/etc/cb/nginx/conf.d/cb-multihome.conf.example
August 2019 13
CB Response 6.5 Server/Cluster Management Guide Server Overview
Note
Listening ports are configured differently in a clustered setup. See cluster-
specific documentation for more details.
In general, sensors first register and check into sensorservices by using nginx. If
sensors have data, after they check in, they post event logs to cb-datastore by using
nginx.
cb-datastore caches data for a few minutes before sending a collection of related data
to cb-solr.
The following diagram illustrates the CB Response server architecture at a high level:
August 2019 14
CB Response 6.5 Server/Cluster Management Guide Server Overview
Server Configuration
Daemon configuration data is generally static, and is stored in flat files that follow typical
Linux conventions. Dynamic run-time configuration data is stored in PostgreSQL and
configured by using the CB Response console.
Most major configuration is done after the CB Response server is installed, when the
cbinit script is run. cbinit configures a combination of initial settings in both static
configuration files and PostgreSQL. For more information about installing and configuring
the CB Response server, see Chapter 2, “Installing the CB Response Server.”
The following table describes the major static configuration files.
August 2019 15
CB Response 6.5 Server/Cluster Management Guide Server Overview
Server Logs
Log Overview
The CB Response server uses log files extensively. These files provide both reassurance
of system health and a record of activity under error conditions.
The following table describes critical logs that are on the CB Response server:
Log Description
/var/log/cb/nginx/ nginx HTTP access and error logs for all
access.log (and error.log) sensor and API traffic.
/var/log/cb/coreservices/ Application logic for API traffic.
debug.log
/var/log/cb/sensorservices/ Application logic for sensor traffic.
debug.log
/var/log/cb/datastore/ Incoming sensor data cache.
debug.log
/var/log/cb/solr/debug.log Sensor data storage, indexing, and queries.
Troubleshooting
Error in the CB Response Console Interface
Look in the log file: /var/log/cb/coreservices/debug.log for a Python stack trace
with details. Contact your Carbon Black Technical Support representative for guidance.
In the output example, there are several fields highlighted in red, and these are useful for
diagnosing the issue:
• Sensor Id is reported after the checkin field. It is 35998 in the above case.
• The actual error code is reported in the field following HTTP/1.1 text. In the example
above, 502 is the error code.
• In a clustered environment, some requests proxy calls to a different minion in the
cluster. This minion's address is reported after the ‘>’ character (170.16.20.21 in the
above case).
If you do find a checkin error, or an error to any other call with the "/sensor/" prefix, check
the following log for more information about the error:
/var/log/cb/sensorservices/debug.log
August 2019 16
CB Response 6.5 Server/Cluster Management Guide Server Overview
If you see an error related to requests prefixed with "/data/", check the following log:
/var/log/cb/datastore/debug.log
In a cluster environment, you will need to look at log files on the node referenced in the
nginx error log entry.
Alternatives
If sensors are not checking in but there are no entries in access.log, check
error.log.
If the sensor SSL client certificates are not signed by the Certificate Authority (CA) in
/etc/cb/certs and configured in /etc/cb/nginx/conf.d/cb.conf, nginx will
refuse the request.
If there are no entries in error.log, check the status of sensor communications as
described in the “Troubleshooting Sensors” section in the CB Response User Guide.
August 2019 17
Chapter 2
This chapter explains how to install/initialize a new CB Response server, as well as how to
upgrade, troubleshoot, and uninstall the server.
Sections
7
Topic Page
Overview 19
Installing and Initializing a CB Response Server 22
Upgrading a CB Response Server 31
Supporting Multiple Volumes for Event Data 33
Troubleshooting the Server 35
Uninstalling a CB Response Server 37
August 2019 18
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Overview
This chapter describes the steps for installing the CB Response server. It covers new
installations and server upgrades. You can complete the entire process in about ten
minutes, assuming reasonable download speed.
The separate CB Response Server Operating Environment Requirements guide provides
guidelines for hardware and software required for the CB Response server. Your
environment must meet these requirements before you begin installation. See the Carbon
Black User Exchange to locate this guide.
A CB Response server installation consists of these main steps:
1. Obtain and install an RPM from Carbon Black. This RPM does not install the
CB Response server. It sets up a Yum repository and installs an SSL client certificate
that allows the full CB Response server to be downloaded and installed.
2. Install the CB Response server. This is a two-step process that involves running the
yum install command and the cbinit configuration script. The CB Response
server is downloaded when you run the yum install command.
For more information on cbinit, see Automating cbinit on the Carbon Black User
Exchange.
When you have installed the server, you can then install sensors on the endpoints you
intend to monitor. Instructions for installing and upgrading sensors are provided in the
“Manage Sensors” chapter in the CB Response User Guide.
August 2019 19
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
A server certificate used for sensor communications must meet the following
requirements:
• The files you provide must be a valid certificate and key pair (i.e. they must be
recognized as a certificate/key pair by the OpenSSL library).
• Certificate files must be in unencrypted ASCII PEM format – this includes both the
certificate file and the key file.
• The certificate must have valid dates when uploaded – that is, its "not valid before"
date should be in the past and its "not valid after" date should be in the future.
• The certificate must have two distinct SAN DNS entries to address the CB Response
cluster scenario where sensors must resolve master and minion virtual addresses to
different IP addresses or FQDNs. This is required for every server certificate, even in
standalone configurations, so that the certificate remains valid if a standalone instance
is upgraded to a cluster. The second SAN field is a single virtual address used for all
minions, but it is mapped to a different IP address or FQDN hostname as needed by
the sensor itself.
• SAN DNS entries must meet the standards for hostname formatting. Allowed
characters include the hyphen and alphanumeric characters (a to z and 0 to 9). Invalid
SAN DNS entries may fail silently.
• The CN field is not used for validation of a new certificate because it has been
deprecated. Sensors perform their own local resolution of virtual names to real server
addresses, so no additional DNS entries are required.
The example below shows how you could set up the SAN portion of the certificate. The
first SAN.DNS entry is used for the master and the second for the minions.
Certificate A
CN=<something>
SAN.DNS.1=virtual-a.master
SAN.DNS.2=virtual-a.minion
When you substitute your own certificate using cbinit, CB Response runs tests to
confirm that the certificate is valid for this use. If the certificate passes the test, it is used
for this server. If not, the default, server-provided legacy certificate will be used instead, an
error message will appear, and the certificate import failure will be logged to /var/log/
cb/cli. The cbinit process still continues if the substitution fails, just with the default
certificate instead of the one you tried to substitute.
August 2019 20
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
The server certificate and key are copied into the server as /etc/cb/certs/cb-
server.crt and /etc/cb/certs/cb-server.key, and are also stored in the CB
Response database.
Important
There are other certificate management features available in
CB Response, including support for adding multiple certificates after
server initialization. Please see “Managing Certificates for Server-Sensor
Communication” in the CB Response User Guide for complete details.
August 2019 21
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Caution
The steps in this section are for a new installation only. If you already have the
CB Response Server installed, do not perform these steps. Instead, see “Server
Upgrades and New Sensor Versions” on page 32.
Using the new installation procedure on an existing server will likely result in
loss of all data, including the configuration and event data collected from sensors.
[CarbonBlack]
name=CarbonBlack
baseurl=https://yum.distro.carbonblack.io/enterprise/stable/
$releasever/$basearch/
gpgcheck=1
enabled=1
metadata_expire=60
sslverify=1
sslclientcert=/etc/cb/certs/carbonblack-alliance-client.crt
sslclientkey=/etc/cb/certs/carbonblack-alliance-client.key
c. (Optional) You should see the CB Response SSL certificates and keys in the
following directory:
/etc/cb/certs/
August 2019 22
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
August 2019 23
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
August 2019 24
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
August 2019 25
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
August 2019 26
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
h. The SSL Certificates section is automated and requires no user input. If you
used arguments pointing to valid certificate and key files when you ran cbinit, the
certificate from your organization is substituted for the default certificate created
by the server. See “Substituting a Server Communication Certificate” on page 20
and the CB Response User Guide for more information.
Run the following script to create an encrypt backup of your certificates. The exact
certificates are critical to disaster recovery efforts.
/usr/share/cb/cbssl backup --out <backup_file_name>
i. In the IP Tables section, answer Y. This opens port 433 in the server’s IP tables.
August 2019 27
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
August 2019 28
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
August 2019 29
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
7. Configure your firewall if you have not already done so. There are many ways to
configure your firewall. The following is just an example for CentOS 6.
a. Open port 443 if you did not allow the cbinit script to manage iptables for you.
b. (Optional) Open port 80 to allow use of web interface and sensor communications
through an unsecured channel. This is not required and only recommended for
exploration or troubleshooting. Connections to the web interface through port 80
are redirected to port 443.
8. Log into the CB Response server web user interface at https://<your server address>/
and use the username and password that you set up in the cbinit script.
Note
Google Chrome is the only supported browser for this release. Although not
supported, internal testing indicates that Firefox, Opera, and IE10 or higher
should work. However, IE browsers must not be in compatibility mode, and
servers in the same subnet as the browser are automatically connected in this
mode.
August 2019 30
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
• The database schema or CB Threat Intel feed data must be migrated after the new
server version is installed.
These steps require SSH or console access to the server and minions with root privileges.
Caution
On pre-6.1 versions of CB Response, it was possible to change the home
directory of the cb service account, which is /var/cb by default. This is the
account under whose auspices server installations occur. This is no longer
supported and will cause upgraded servers to fail with an nginx error.
The home directory of the cb service account must be /var/cb. This is
where upgrades place runtime configuration files for nginx, so if you changed
the cb service home directory, these files will not be found. If you edited the
home directory in /etc/password, restore it to /var/cb before upgrading.
August 2019 31
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Using cbupgrade
Upgrades to the CB Response server will occasionally require you to use a utility called
cbupgrade after executing yum update cb-enterprise to migrate the database
schema or CB Threat Intel feed data. The operator will be notified of this requirement
when attempting to start the cb-enterprise services. In a clustered-server configuration,
you must run the cbupgrade tool on all nodes before restarting the cluster. When running
this utility in a clustered environment, be sure to answer No when asked to start the
CB Response services. You will need to use cbcluster to start the clustered server.
See “Upgrading Cluster Nodes” on page 65 for a description of cbupgrade options.
• Automatically install the latest version – Automatically upgrades the sensors to the
latest version.
• Automatically install a specific version – Install a specific version for all sensors in
a group. This keeps all sensors at the selected version. Select a version number using
the drop-down list. Selecting the upgrade policy of a specific version is useful when
sensor versions must be tested or vetted.
August 2019 32
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Naming Conventions
Solr uses new cbevents directories (mount points) if their name is prefixed with:
cbevents*
or
_cbevents*.
Note
The cbevents directory (without the suffix) is the default directory but does
not need to remain on the original data partition. You can remove it if
needed.
In this example, the default data drive is mounted to /dev/xvdb, and /data is configured
as the data root inside of cb.conf. In addition, two more volumes are added and
mounted to /data/solr5/cbevents2 and /data/solr5/cbevents3.
Caution
The system assigns the correct user:group upon cb-enterprise restart. If
you created the mount points on a live server, ensure that the user assigned
to the CB Response server has write permissions on the mounted directory.
Failure to do so causes the system to ignore the new mount points.
August 2019 33
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Partitioning
New data directories are used when the next partition occurs (every three days by default)
or sooner if the current data disk is at risk of becoming full. The server uses simple
heuristics in calculating when to partition and where to place the new event partition:
1. A new partition is created in the cbevents* directory with the most free space at the
time of partitioning.
2. If the current data volume is more than 95% full and additional partitions exist that
have more than 5% free space available, the server immediately partitions.
You can control this threshold using the following configuration parameter:
SolrTimePartitioningFreeSpaceThresholdPerc
• Rule 1 ensures that new volumes are used in a balanced fashion. As old data is aging
out (being purged), some partitions free up. This ensures optimal use of free space.
• Rule 2 ensures that the system uses fragmented disk space efficiently in case many
cbevents* directories exist. For example, assume you have five volumes, and each
has 20% free space. This could result in none of the volumes fitting into the three-day
partition. The system will continue trying to use one of the partitions (up to its
maximum available space) before moving to the next one. As a result, the server
might end up with smaller partitions. However, this scenario should be rare.
Partition Purging
The system purges partitions based on disk space, time, or the maximum number of
allowed partitions.
When purging based on disk space, a purging algorithm considers the overall amount of
free disk space. For example, three 100 GB volumes exist, each with 30 GB of free space,
gives you a total of 90 GB of free space and a total disk space of 300 GB. The total event
data size is the sum of index sizes on all three volumes. (This could be less than 210 GB
since the main data volume may also contain store files and other data.)
The following shows how the current purging thresholds (in cb.conf) are interpreted
when multiple volumes exist:
August 2019 34
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
• MaxEventStoreSizeInMB - Purge the oldest partition when the total event store
size (on all volumes) exceeds the given threshold.
• MinAvailableSizeInMB - Purge the oldest partition when the total free disk space
(on all volumes) falls below the given threshold.
Component Description
allianceclient The Alliance client communicates with the CB Response Alliance
server.
audit Contains log files for the following activities: banning, sensor
isolation, and live response. If
EnableExtendedApiAuditLogging is enabled in cb.conf, this
directory also includes a user activity log file based on user-
generated API calls in the console.
cbfs-http Contains log files of the second generation Java datastore engine.
coreservices Provides access to functionality via web APIs to both the web
interface and sensors. Nearly all interface issues should result in log
entries for coreservices.
sensorservices Provides entry-point for sensor registrations and checkins. Look for
issues here if there are problems with sensor connectivity
datastore Used for core event data processing and managing incoming sensor
data.
nginx The reverse proxy and SSL termination point for the CB Response
server.
August 2019 35
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Component Description
notifications The location of the syslog output for feeds and watchlists.
redis The logging location for the redis component of the CB Response
server.
services The logging location for the start/stop services of the CB Response
server.
The following table shows the scripts found in /usr/share/cb, most of which are
diagnostics scripts; it only includes scripts that are used for diagnostics
Component Description
cbbanning Assists in managing the CB Response server banning features. To
get a list of available commands, run this command:
cbbanning commands
cbpost This utility is used to send file(s) to the Alliance server; typically used
during interaction with Carbon Black Technical Support.
py_runtime_info Generates a runtime report that shows the stack trace, process
memory map, and open file descriptors for the running CB Response
processes.
August 2019 36
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Component Description
cbget This utility is used to download or list files from Alliance server;
typically used during interaction with Carbon Black Technical
Support.
• carbon-black-release
• cb-datagrid
• cb-datastore
• cb-enterprise
• cb-solr
• cb-swagger
• cbui
• libselinux-cb-python
• python-cb-coreservices
• python-cb-response-venv
August 2019 37
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
Warning
This procedure might remove packages that are also required by other
software applications. Use caution when performing this procedure.
August 2019 38
CB Response 6.5 Server/Cluster Management Guide Installing the CB Response Server
August 2019 39
Chapter 3
Sections
Topic Page
Overview 41
Backup 42
Restore 45
August 2019 40
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
Overview
This chapter provides procedures for backing up and restoring a CB Response server.
The procedures are designed to ensure minimal data loss in the event of a catastrophic
failure.
Backup files and data should be stored on a different server than the one that is used for
daily operations.
All procedures in this document are performed at the command prompt and require root-
level access.
Notes
• /var/cb is assumed to be the default installation data path
throughout this appendix. If you have your datastore root configured in
a different location, use that in place of what is provided here.
• Network integrations will not be fully backed up. Any network
integration needing a bridge or connector installed must be installed
on the new restore server before restoring the configurations.
Configuration items for network integrations will be restored
throughout this appendix.
Restoration Servers
For all restoration options, it is assumed that a new server install has been performed with
the same number of master and minion systems, each with the same number of Solr data
shards in place on each system, and configured to use the same hostname and IP
addresses.
The same server version must be used between backed up and restored systems.
To install a new system, see “Installing the CB Response Server” on page 18.
All installation steps involve running cbinit (and cbcluster add-node for clustered
systems). These must be completed before performing a system restoration.
August 2019 41
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
Backup
This section highlights two backup and restore methods:
• A configuration-only backup covers all configuration and sensor metadata for the
system. It is designed to be minimal in storage size and allows the quickest return to
operation in the event of a catastrophic server failure. It does not include any data that
the sensors submit (event or binary data) or any feed or alert information from a
running server. The configuration backup step is required for both backup and restore
methods. For more information, see “Configuration Backup” on page 42.
• A data backup is a continuation of the configuration backup and includes all data
stored by the server. Backing up this data ensures a full recovery of the system. Off-
server storage requirements are much larger due to the full data set that is being
backed up. Also, the time it takes to perform a restoration will likely be longer due to
copying and unarchiving large amounts of data to a new system.
Note
/cbdata/_backup/ServerName is used in this procedure as an
example for a backup data storage location. Determine the correct
location for storing your backups and note the size requirements if also
performing a data backup.
You must run all commands on the master and minion systems unless otherwise
noted. Perform all steps on all standalone servers. For more information, see “Data
Backup” on page 44.
Configuration Backup
A configuration backup backs up only the files and data required for a system restore that
has functioning sensors, without recorded data. You can perform this configuration backup
by itself or use it as the first step in a full backup. It is the quickest way to capture and
restore data and consumes the smallest amount of disk space. Configuration backups can
be performed while CB Response is running.
August 2019 42
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
i. Locate all custom syslog templates paths in use by searching the following:
/etc/cb/cb.conf file for any instance of SyslogTemplate=
For example:
WatchlistSyslogTemplateBinary
and
FeedIngressSyslogTemplateBinary
iii. Tar each custom path that is identified using this command:
tar -P --selinux -cvf syslog_custom1.tar /var/custom/syslog
August 2019 43
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
Data Backup
A data backup captures all recorded data that is stored on a server and is required to
complete a full restore of a functioning system. You must complete a “Configuration
Backup” on page 42 before performing the steps in this section. The data captured here
can be very large, depending on the amount of data that is retained by the system or
cluster. Full backups require that CB Response is in a stopped state.
August 2019 44
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
Restore
To restore a system, the following prerequisites must be met:
• A fresh CB Response server (or an old snapshot) installation must be available on
which to restore the backup files.
• The server must have the same configuration for the master and minions (for a
clustered environment) as the system that was backed up.
• The same hostname and IP addresses must be used.
• The new server(s) must be installed on the same version of the server(s) from which
the backups were taken (for example, v6.5.0).
If detailed configuration items are required to complete the installation, use the following
files, which are generated in “Configuration Backup” on page 42, to obtain the
configurations from the backed-up server:
• The IP address used for each system. In cbhosts.tar, this is in /etc/hosts.
• The number of systems used and the master/minion assignment. In cbconfig.tar,
this is in the /etc/cb/cbcluster.conf file.
To install a new system, see “Installing the CB Response Server” on page 18. You must
complete all installation steps including those that involve running cbinit (and
cbcluster add-node for clustered environments) before performing a server restore.
The configuration items chosen when running cbinit are overwritten after restoration of
the configuration files is complete.
August 2019 45
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
August 2019 46
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
Configuration Restore
This section contains a procedure for restoring the configuration files and data files. The
restore should match the backup procedures performed in “Backup” on page 42.
/cddata/_backup/ServerName is used in this procedure as an example for a backup
data storage location. Determine the correct location for storing your backups and note the
size requirement if you are also performing a data backup.
The following prerequisites must be met before performing this procedure:
• For standalone server environments, all commands in the following sections must be
run except for those specifically identified as being for cluster environments only.
• For clustered server environments, all commands in the following sections must be
run for the master and minion servers unless otherwise noted.
• All restoration activities require that CB Response be placed in a stopped state.
August 2019 47
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
f. Configure Rsyslog:
tar -P -xvf cbrsyslog.tar
g. Configure Rsyslog.d:
tar -P -xvf cbrsyslogd.tar
h. Configure Rabbitmq cookie:
tar -P -xvf cbrabbitmqcookie.tar
i. Configure Rabbitmq node:
tar -P -xvf cbrabbitmqnode.tar
j. (Optional) SSH authorization keys:
tar -P -xvf cbrootauthkeys.tar
k. (Master only) Syslog CEF template:
tar -P -xvf cbceftemp.tar
l. (Optional - Master only) CB Response installer backups:
tar -P -xvf cbinstallers.tar
m. (Optional - Master only) Custom syslog templates; for each custom template TAR:
tar -P -xvf syslog_custom1.tar
5. (Master only) Restore Postgres database:
Note: If you are performing a full data restore, skip this procedure.
a. Start the Postgres database:
service cb-pgsql start
b. Drop the old database:
dropdb cb -p 5002
c. Restore roles:
Note: An error indicates that the account is already created.
psql template1 -p 5002 -f psqlroles.sql
d. Restore the data dump:
psql template1 -p 5002 -f psqldump_config.sql
e. Restore the database sequence values. Copy and paste the following into a file
called psqlcbvalues on the server:
SELECT
pg_catalog.setval('allianceclient_comm_history_id_seq', 1,
false);
SELECT
pg_catalog.setval('allianceclient_pending_uploads_id_seq',
1, false);
SELECT pg_catalog.setval('allianceclient_uploads_id_seq', 1,
false);
SELECT pg_catalog.setval('cb_useractivity_id_seq', 1,
false);
SELECT
pg_catalog.setval('detect_dashboard_average_alert_resolution
_history_id_seq', 1, false);
SELECT
pg_catalog.setval('detect_dashboard_binary_dwell_history_id_
seq', 1, false);
SELECT
pg_catalog.setval('detect_dashboard_host_hygiene_history_id_
seq', 1, false);
SELECT pg_catalog.setval('investigations_id_seq', 1, false);
August 2019 48
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
SELECT pg_catalog.setval('maintenance_job_history_id_seq',
1, false);
SELECT pg_catalog.setval('moduleinfo_events_id_seq', 1,
false);
SELECT pg_catalog.setval('sensor_comm_failures_id_seq', 1,
false);
SELECT pg_catalog.setval('sensor_driver_diagnostics_id_seq',
1, false);
SELECT pg_catalog.setval('sensor_event_diagnostics_id_seq',
1, false);
SELECT pg_catalog.setval('sensor_licensing_counts_id_seq',
1, false);
SELECT pg_catalog.setval('sensor_queued_data_stats_id_seq',
1, false);
SELECT pg_catalog.setval('sensor_resource_statuses_id_seq',
1, false);
SELECT pg_catalog.setval('server_storage_stats_id_seq', 1,
false);
SELECT pg_catalog.setval('tagged_events_id_seq', 1, false);
f. Restore psqlcbvalues:
psql cb -p 5002 -f psqlcbvalues
g. Rebuild default investigations:
psql cb -p 5002 -c "INSERT INTO investigations VALUES
('1','Default Investigation',to_timestamp((select value from
cb_settings where key='ServerInstallTime'),'YYYY-MM-DD
hh24:mi:ss'),NULL,to_timestamp((select value from
cb_settings where key='ServerInstallTime'),'YYYY-MM-DD
hh24:mi:ss'),'Automatically Created at Installation Time');"
h. Remove all previous query-based feeds:
psql cb -p 5002 -c "delete from watchlist_entries where
group_id <> '-1';"
i. Stop the Postgres database:
service cb-pgsql stop
6. Start the CB Response services:
Note: If performing a data restoration, skip these steps.
- (Master only) In a clustered server environment, run:
/usr/share/cb/cbcluster start
- or -
- In a standalone server environment, run:
service cb-enterprise start
Data Restore
This section describes how to restore the configuration files and data files. The restore
should match the backup procedures in “Backup” on page 42.
/cddata/_backup/ServerName is used in this procedure as an example for a backup
data storage location. Determine the correct location for storing your backups and note the
size requirement if you are also performing a data backup.
The following prerequisites must be met before performing this procedure:
• You must perform the procedure in “Configuration Restore” on page 47 before
performing a data restore.
August 2019 49
CB Response 6.5 Server/Cluster Management Guide Server Backup and Restoration
• For clustered server environments, all commands in the following sections must be
run for the master and minion servers unless otherwise noted.
• For standalone server environments, all commands in the following sections must be
run as well.
August 2019 50
Chapter 4
This chapter provides port and protocol information for several different server
communications.
Note
Underlying IP addresses of any servers identified can change. Avoid listing any
specific IP addresses; instead, configure your firewalls to use DNS names.
August 2019 51
CB Response 6.5 Server/Cluster Management Guide Ports and Protocols
August 2019 52
CB Response 6.5 Server/Cluster Management Guide Ports and Protocols
August 2019 53
CB Response 6.5 Server/Cluster Management Guide Ports and Protocols
August 2019 54
Chapter 5
This chapter introduces CB Response clusters and explains how to configure clusters,
add minions to existing clusters, remove minion nodes from clusters, and upgrade cluster
nodes.
Note
Some folders and scripts use the term “slave”, which is another term for “minion”.
Sections
7
Topic Page
Overview 56
Configuring CB Response Clusters 59
Adding Minions to Existing Clusters 62
Removing Minions from Existing Clusters 63
Upgrading Cluster Nodes 65
August 2019 55
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
Overview
A CB Response cluster is a group of servers fulfilling certain roles, operating as a single
CB Response instance. Clusters are used to support a larger number of sensors and data
than a single standalone server can support. This chapter provides details about setting
up a CB Response cluster.
CB Response collects a large volume of data at varying degrees of velocity. As volume
and velocity increase, the server begins to reach the limit of what a single server can
support. In order to scale to support increasing volume and velocity, the infrastructure
must grow horizontally. This means adding additional servers to the infrastructure. A
cluster of CB Response servers must be configured when the desired number of sensors,
activity level, or amount of retention exceeds a certain threshold, which negatively impacts
the performance of a single CB Response server instance.
Horizontal scaling is used by Solr, which is the core component that CB Response uses to
store data. Solr is a big data solution that uses distributed indexes and distributes queries
to those indexes. This increases query performance for high volume and velocity indexing.
To support optimal scaling performance, the CB Response infrastructure is modeled
around this concept.
See the CB Response Operating Environment Requirements (OER) document for more
information on server performance and hardware requirements.
Cluster Architecture
CB Response cluster servers have one of two roles:
• Master – Also known as a head-node
• Minion – Also known as an index(ing) node
Each cluster membership role fulfills specific functions for a single CB Response instance.
Together, the nodes in a cluster form a functioning CB Response server with specific
functionalities and internal components configured to perform their membership roles.
The following table provides a matrix for CB Response services and certain components
compared to each role:
August 2019 56
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
* replicated by Master
Solr clustering is performed by breaking up a single Solr core into multiple cores called
shards. Shards, which are identified by a numerical integer starting at 0, are then evenly
distributed to the indexing nodes (minions) for individual management and distributed
querying.
For smaller cluster implementations, the master can also perform the role of an indexing
server and fulfill all roles similar to a standalone server. However, for larger organizations
with more than 60,000 sensors or four minions, the cluster must have a dedicated master
that is not performing minion duties.
When CB Response is clustered, internal nodal communication must occur so that the
application behaves as a single instance. Most internal components can operate in this
distributed capacity by making standard calls to the other components and/or nodes.
August 2019 57
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
In order for RabbitMQ to function properly as a single system, it must also be clustered.
RabbitMQ is an application message bus used to exchange data (or messages) between
the processes, application, and servers. Creating a RabbitMQ cluster allows
CB Response to exchange and queue internal (server process and application) and inter-
nodal (node-to-node) messaging for proper operation as a single CB Response instance.
Cluster Operation
A CB Response cluster must operate with multiple servers in the same way as a
standalone instance. As a result, each role must be responsible for certain aspects of a
CB Response instance.
The master contains the user interface and is the primary front end for the API and most
integrations. As users navigate the web console, standard API endpoint calls will be made
to the master, which in turn queries the appropriate back-end storage location. When
process data is queried, the master distributes the query to the minions and renders the
aggregated results. However, if a binary, threat intel, or alert search is performed, it only
queries its local Solr cores.
August 2019 58
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
The master also contains the only instance of the PostgreSQL database that houses most
of the application-specific configuration and certain state information that is used for
sensor management. The master is in charge of managing the sensor configuration and
communications, which include the CB Live Response capabilities. Managing sensors not
only requires sensor state information but also minion state metrics to independently
distribute minion bandwidth to allow its assigned sensors to submit data.
The minions serve as the primary ingestion point for sensor data. When a sensor is told to
send data to the minion by the master, the minion receives the data and begins to ingest
the data for storage. A minion will store all process-related data in its cbevents Solr
core(s), where it manages its indexes separately from the rest of the cluster. This data is
retrieved when a distributed query is initiated by the master. Binary data is forwarded to
the master for storage and management. This is only done once per unique binary per
sensor. Unlike the binary metadata, the copies of the binaries are stored locally on the
minion. The copies are only submitted and stored once per CB Response cluster or
instance. The distribution of the binary storage depends on the sensor to which that binary
was submitted. This data flow is illustrated in the following figure:
August 2019 59
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
Note
The following instructions assume that you have installed the CB Response RPM
and have run the yum install cb-enterprise command on the master
node. The minion is simply a generic install of CentOS. For more information, see
“Installing and Initializing a CB Response Server” on page 22.
2. From cb-master, run the following command to initiate the cluster configuration (see
“Best Practices” on page 62):
[root@cb-master~]# /usr/share/cb/cbcluster add-node
3. Enter the following information when prompted:
- For the hostname or IP address of the remote node, enter the IP address of the
server to become a minion node. For example:172.xx.xxx.xxx.
- For the password of the server that will become a minion node, enter the root
password for the server in question; do not enter the CB Response password.
The CB Response software is now installed on each minion. The yum repo
configuration used on the master is used on each node added.
4. When the minion nodes have all been configured, start the cluster services:
[root@cb-master~]# /usr/share/cb/cbcluster start
5. You can now view the results in the config file:
[root@cb-master~]# cd /etc/cb/
[root@cb-master~]# less cluster.conf
August 2019 60
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
###############################################################
#############
#
# /etc/cb/cluster.conf:
# This file contains CB Response server cluster configuration,
# which includes the list of participating nodes and Solr
# shards present on every one of those nodes.
#
# NOTE: The contents of this file are being managed by
# /usr/share/cb/cbcluster command line tool and any changes
# made here may be overwritten next time that tool is used.
#
###############################################################
############
[Cluster]
NodeCount=2
NextSlaveAutoInc=2
[Master]
Host=172.16.100.110
HasEvents=False
User=root
[Slave1] Host=172.16.100.111
HasEvents=True
User=root
August 2019 61
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
5. Install the sensors on the cluster node(s). See the “Installing Sensors” chapter in the
CB Response User Guide if you are unfamiliar with the steps for installing sensors.
6. After you have installed all sensors on the cluster node(s), verify that they appear in
the CB Response console on the master node by again navigating to Sensors in the
left navigation menu:
Best Practices
When configuring a CB Response cluster, Carbon Black recommends that you refer to the
CB Response Operating Environment Requirements guide, which describes performance
and scalability considerations in deploying CB Response.
August 2019 62
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
Best Practices
Be sure to adhere to these best practices before attempting to remove minions from an
existing cluster. Consult the CB Response Operating Environment Requirements (OER)
Guide to ensure that the reduced cluster has the capacity to support the total number of
endpoints.
• The remaining minions must have enough disk space to contain the full data.
- Calculate the daily usage of the disk per sensor and re-calculate the required disk
space to new minions for full retention. Here is an example:
Assume you want to collapse the six-minion cluster that has 40K endpoints down
to three minions and have 30-day retention. CB Response v6.0+ supports this
because each minion will still have less than the maximum of 18,750 endpoints.
You calculate the current daily disk usage per sensor to be 20MB (dividing total
cluster data volume storage by current daily retention and number of endpoints).
The new total storage requires a minimum of 20MB * 40K (endpoints) * 30 (days)
= 24 TB (or 8 TB per node).
Add 20-30% to the available disk space on top of the calculated amount to allow
for increased sensor activity in the future.
- Additional extra disk space must be provided for desired cold storage in days.
• The master cluster node must have enough disk space to contain binary files for all
removed minions. Binary files typically take less space than events but should still be
taken into account. You can calculate the required extra space on the master by
logging into CB Response, navigating to Server Dashboard in the left navigation
menu, and viewing the Storage Statistics for the minions. Add up the total binary size
on the minions that will be removed to obtain the maximum additional space required
on the master node.
• The remaining minions must have enough CPU and memory space to support the
sensor load (per OER).
August 2019 63
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
Read-Only Minions
Before removing minions from an existing cluster, you must convert them to a read-only
state. Read-only minions are searchable throughout the API and user interface but are not
used for sensor checkins or event/datastore pushes. While minions are in the read-only
state, the system copies the binary files to the master.
The event data is not added to the minions and existing data is purged periodically as in
normal operations. As a result, the read-only minions become completely inactive after the
retention period. After the desired data retention period expires, you can safely remove
the read-only minions.
Read-only minions can be reverted to active minions at any time if needed.
Removing Minions
Perform these steps to mark/unmark minions as read-only and to remove a cluster minion.
If the node_id parameter is required, it can be found inside /etc/cb/cluster.conf for
a given node.
August 2019 64
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
Notes
• Only read-only minions can be removed.
• The system can remove a minion only if all storefiles have been copied
to the master node. If this is not the case, an error is printed stating
how many more files must be moved; you can try to remove the minion
at a later time.
Important
If an RPMNEW file is encountered on a node during upgrade, you must
reconcile the current configuration files on the node with the new
configuration information, and you must remove the RPMNEW file from
that node, before cbcluster start will complete successfully.
August 2019 65
CB Response 6.5 Server/Cluster Management Guide Installing a CB Response Cluster
Warning
At the end of the cbupgrade process, if you are prompted to start
services, do NOT start the services.
This step is important to perform after an upgrade. This is due to the fact that when the
cluster is started using the cbcluster tool, it will redistribute configuration files that must
be synchronized across all nodes within the cluster. If a new software version
introduces configuration changes, this will ensure that each minion node has the
updates.
August 2019 66
Chapter 6
Sections
Topic Page
Overview 68
Required User Privileges 68
Defining Users 70
August 2019 67
CB Response 6.5 Server/Cluster Management Guide Using CBCLUSTER as a Non-Root User
Overview
cbcluster is a command line utility used to manage and configure CB Response
clusters on the master node. It supports the following options:
• cbcluster start
• cbcluster stop
• cbcluster status
• cbcluster add-node
These commands run in root context and require users to have sudo privileges in order to
invoke /usr/share/cb/cbcluster on the master node. Additionally, the cbcluster
add-node command, which is used to add a new minion node to a cluster, connects and
remotely executes on the minion a series of commands for cluster configuration.
Notes
• Please ensure that the Master and Minion are on the same version of
CB Response prior to running the cbcluster add-node command.
If the versions are not the same, you will see an error message.
• The cbcluster reshard command is deprecated and no longer
supported.
August 2019 68
CB Response 6.5 Server/Cluster Management Guide Using CBCLUSTER as a Non-Root User
August 2019 69
CB Response 6.5 Server/Cluster Management Guide Using CBCLUSTER as a Non-Root User
Defining Users
Note
To avoid potential conflicts, do not select “cb” for a username.
There are two ways to invoke cbcluster and configure minion nodes as a user other
than root:
• If this is a new minion which has not been added to the cluster, the new user can be
configured when running add-node, by including the new add-node option:
--user=<arg>
For example:
$ /usr/share/cb/cbcluster add-node --hostname <my_host> --user
<my_user>
This will configure cbcluster to perform all remote actions for <my_host> as
<my_user>. The /etc/cb/cluster.conf file will be updated to reflect the new
configuration with the key-value pair "User=<my_user>".
• If this is an existing minion, the /etc/cb/cluster.conf file can be modified
directly. Open the file in an editor, and for each minion node, add the key-value pair
"User=<my_user>" where <my_user> is the actual username you want
cbcluster to use when connecting to that minion.
August 2019 70