How To Manually Change Log Source Identifier in VMware Carbon Black Cloud App v2.0 for IBM QRadar
Posted on February 2, 2022
Do I need this change?
VMware Carbon Black Cloud App v2 changed the log source identifier that was used to send the events from CBC to QRadar from cbcloud
(in v1.0) to localhost
(in v2.0). As a result if you already have any log sources of type syslog that uses localhost
as the log source identifier then the
events will be processed by the existing DSM and not by the DSM provided by the app. This is expected behavior and will be fixed in the v2.1 release.
If you do not have log sources that use localhost
for identifier, no change is necessary.
Workaround to fix the log source identifier
First go through the steps below, but the change is non-persistent and will be erased if the docker container restarts. This needs to be monitored and re-modified if the container or QRadar server is restarted. For the changes below you need to have access to the docker container, where the app is running to change the python script and restart the process that pulls the records from Carbon Black Cloud.
- Log into the QRadar console and the app’s docker container. (How to connect to app container)
- Open the
output.py
file with text editor, e.g. vi
vi /opt/app-root/app/utils/output.py
and then navigate to the method with/send_syslog
- Find the following line of code:
formatted_msg = time.strftime("%b %d %H:%M:%S").encode("utf-8") + b" localhost " + msg.encode("utf-8") + b"\n"
Change the stringlocalhost
in this message to something else that contains only letters or digits, e.g.carbonblackcloud
. After the change, the line should read:
formatted_msg = time.strftime("%b %d %H:%M:%S").encode("utf-8") + b" carbonblackcloud " + msg.encode("utf-8") + b"\n"
- Save the file and close it.
- Check all the running processes with:
ps ax
- Find the process that is running the
poll.py
script (python /opt/app-root/app/poll.py
) and kill it with:
kill -9 <pid>
, where<pid>
is the pid of the process.
This restarts the process that pulls the alerts from Carbon Black Cloud, so that the restarted process picks up the manual change inoutput.py
. - Once QRadar receives events from the restarted
poll.py
script, a Log Source of type syslog with the log source identifier ofcarbonblackcloud
should be created automatically. If not, you must create it manually.
How to check that Log Source is created
- Go to IBM QRadar Log Source Management which is found under Admin menu in the Apps section.
- Search for Carbon Black Cloud and select and open the Carbon Black Cloud log source.
- In the Log Source Summary view, select the Protocol tab. The
Log Source Identifier
parameter should display the name you used to replacelocalhost
in step 3 of the workaround fix. - If there is no such Log Source, such should be created manually.
Manually create a log source with a proper log source identifier
For QRadar v7.3, the log source may not be created automatically. Use the steps below to create it manually.
- Go to IBM QRadar Log Source Management which is found under Admin menu in the Apps section.
- Click New Log Source button and select Single Log Source
- Select Log Source Type:
Carbon Black Cloud
- Select
- Protocol type:
Syslog
- Name:
Carbon Black Cloud
- Extension:
CarbonBlackCloudCustom_ext
- Protocol type:
- Configure the protocol parameters
- Log Source Identifier:
carbonblackcloud
(use the same identifier that replaced localhost in step 3 of the workaround fix) - Select UTF-8 for Incoming Payload Encoding
- Log Source Identifier: