-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from carbonblack/release-note-and-config-test
Release note and config test
- Loading branch information
Showing
8 changed files
with
187 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,86 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
## Version 1.1.0 | ||
|
||
**Breaking Changes:** | ||
* Leef output has been rewritten to better utilize common properties and include as much information as possible | ||
* Code and files have been refactored and renamed to better align with the product | ||
|
||
**Bug fixes:** | ||
* Config file no longer fails when output_format is leef | ||
* Added Python 3 support with the addition of the python six package. | ||
* Tests have been rewritten and additional tests around the config file have been added | ||
* https_ssl_verify allows for false value | ||
|
||
## Version 1.0.1 | ||
|
||
### Bug Fix | ||
|
||
Removed the package fcntl and replaced it with the package psutils. This ensures multi-platform functionality for | ||
Removed the package fcntl and replaced it with the package psutils. This ensures multi-platform functionality for | ||
the connector. | ||
|
||
## Version 1.0.0 | ||
|
||
### New Installation instructions | ||
### New Installation instructions | ||
|
||
The Syslog Connector will now be moved to a pip install. Please see README.md for more information about the | ||
installation instructions. The previous yum installation will be deprecated. | ||
|
||
### Back Up Directory Feature | ||
|
||
In the configuration file, a Backup Directory location can now be added. This allows backup files to be stored | ||
in the case that the Connector fails to send the data to Syslog. | ||
in the case that the Connector fails to send the data to Syslog. | ||
|
||
Please see the following example: | ||
Please see the following example: | ||
|
||
back_up_dir = /Users/jdoe/Documents/ | ||
|
||
> **Note**: These fields are not optional and must be present in the config file. | ||
### API Key | ||
|
||
In the configuration file, a API Key is now available to be added. This will allow Audit Logs to be pulled from each | ||
server in the configuration file. | ||
In the configuration file, a API Key is now available to be added. This will allow Audit Logs to be pulled from each | ||
server in the configuration file. | ||
|
||
Please see the following example: | ||
|
||
[cbdefense1] | ||
api_connector_id = GO5M953111 | ||
api_key = BYCRM7BRNSH0CXZR5V1Y3111 | ||
|
||
> **Note**: These fields are not optional and must be present in the config file. If no API Key is needed, please | ||
> **Note**: These fields are not optional and must be present in the config file. If no API Key is needed, please | ||
leave the field blank as shown below: | ||
|
||
[cbdefense1] | ||
api_connector_id = | ||
api_key = | ||
api_connector_id = | ||
api_key = | ||
|
||
|
||
### Audit Logs | ||
|
||
Audit Logs are now available to be pulled from the Syslog Connector. To set up the program to pull Audit Logs, please | ||
see the API Key section above. When the Syslog Connector is executing, the program will grab the Audit Logs that have | ||
been generated since the last time the Connector was run. The following file formats are compatible with Audit Logs: | ||
Audit Logs are now available to be pulled from the Syslog Connector. To set up the program to pull Audit Logs, please | ||
see the API Key section above. When the Syslog Connector is executing, the program will grab the Audit Logs that have | ||
been generated since the last time the Connector was run. The following file formats are compatible with Audit Logs: | ||
CEF,LEEF, JSON | ||
|
||
> **Note**: All events types will be pulled from the Syslog Connector. As of now, no additional filtering is | ||
> **Note**: All events types will be pulled from the Syslog Connector. As of now, no additional filtering is | ||
compatible for Audit Logs. | ||
|
||
|
||
### ThreatHunter | ||
|
||
ThreatHunter notifications are now available to be pulled from the Syslog Connector. To set up the Connector to pull | ||
ThreatHunter notifications you need to add the API Key as shown below in the configuration file: | ||
ThreatHunter notifications are now available to be pulled from the Syslog Connector. To set up the Connector to pull | ||
ThreatHunter notifications you need to add the API Key as shown below in the configuration file: | ||
|
||
|
||
cbdefense1] | ||
[cbdefense1] | ||
siem_connector_id = UEUWR4U111 | ||
siem_api_key = XNS5UKWZXZMCC3CYC7DFM111 | ||
|
||
|
||
The file formats that are compatible with ThreatHunter Notifications are: LEEF, CEF, JSON. Just like with Audit Logs, the | ||
program will grab only the notifications that have been generated since the last time the Connector was run. | ||
The file formats that are compatible with ThreatHunter Notifications are: LEEF, CEF, JSON. Just like with Audit Logs, the | ||
program will grab only the notifications that have been generated since the last time the Connector was run. | ||
|
||
> **Note**: All events types will be pulled from the Syslog Connector. As of now, no additional filtering is | ||
> **Note**: All events types will be pulled from the Syslog Connector. As of now, no additional filtering is | ||
compatible for the ThreatHunter Notifications. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[general] | ||
|
||
template = {{source}} {{version}}|{{vendor}}|{{product}}|{{dev_version}}|{{signature}}|{{name}}|{{severity}}|{{extension}} | ||
|
||
back_up_dir = /Users/jdoe/Documents/ | ||
|
||
policy_action_severity = 4 | ||
|
||
output_format=cef | ||
|
||
output_type=udp | ||
udp_out=0.0.0.0:8886 | ||
|
||
|
||
[CarbonBlackCloudServer] | ||
api_connector_id = RANDOM_ID | ||
api_key = RANDOM_SECRET | ||
siem_connector_id = RANDOM_ID | ||
siem_api_key = RANDOM_SECRET | ||
server_url = http://0.0.0.0:5001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[general] | ||
back_up_dir = /Users/avanbrunt/Desktop/backdir | ||
policy_action_severity = 4 | ||
output_format=json | ||
|
||
output_type=http | ||
http_out= http://0.0.0.0:5001/http_out | ||
http_headers= { 'content-type': 'application/json' } | ||
https_ssl_verify=False | ||
|
||
[CarbonBlackCloudServer] | ||
api_connector_id = RANDOM_ID | ||
api_key = RANDOM_SECRET | ||
siem_connector_id = RANDOM_ID | ||
siem_api_key = RANDOM_SECRET | ||
server_url = http://0.0.0.0:5001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[general] | ||
|
||
back_up_dir = /Users/jdoe/Documents/ | ||
|
||
output_format=leef | ||
|
||
output_type=tcp+tls | ||
tcp_out=0.0.0.0:8888 | ||
|
||
|
||
[tls] | ||
ca_cert = /etc/cb/integrations/cbc-syslog/ca.pem | ||
cert = /etc/cb/integrations/cbc-syslog/cert.pem | ||
key = /etc/cb/integrations/cbc-syslog/cert.key | ||
tls_verify = true | ||
|
||
[CarbonBlackCloudServer] | ||
api_connector_id = RANDOM_ID | ||
api_key = RANDOM_SECRET | ||
siem_connector_id = RANDOM_ID | ||
siem_api_key = RANDOM_SECRET | ||
server_url = http://0.0.0.0:5001 | ||
|
||
|
||
[CarbonBlackCloudServerSecondary] | ||
api_connector_id = RANDOM_ID | ||
api_key = RANDOM_SECRET | ||
server_url = http://0.0.0.0:5001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env python | ||
import logging.handlers | ||
import unittest | ||
import os | ||
|
||
from cbc_syslog.config import parse_config, verify_config | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.INFO) | ||
|
||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') | ||
|
||
|
||
class TestConfig(unittest.TestCase): | ||
|
||
def setUp(self): | ||
super(TestConfig, self).setUp() | ||
self.addTypeEqualityFunc(str, self.assertMultiLineEqual) | ||
self.addTypeEqualityFunc(dict, self.assertDictEqual) | ||
self.addTypeEqualityFunc(list, self.assertListEqual) | ||
self.addTypeEqualityFunc(tuple, self.assertTupleEqual) | ||
self.addTypeEqualityFunc(set, self.assertSetEqual) | ||
self.addTypeEqualityFunc(frozenset, self.assertSetEqual) | ||
self.maxDiff = None | ||
|
||
def test_cef_config(self): | ||
config = parse_config(os.path.dirname(__file__) + '/fixtures/cef.conf') | ||
output_params, server_list = verify_config(config) | ||
|
||
self.assertEqual(output_params['output_format'], 'cef') | ||
self.assertEqual(output_params['output_type'], 'udp') | ||
self.assertEqual(output_params['output_host'], '0.0.0.0') | ||
self.assertEqual(output_params['output_port'], 8886) | ||
|
||
self.assertEqual(len(server_list), 1) | ||
|
||
def test_leef_config(self): | ||
config = parse_config(os.path.dirname(__file__) + '/fixtures/leef.conf') | ||
output_params, server_list = verify_config(config) | ||
|
||
self.assertEqual(output_params['output_format'], 'leef') | ||
self.assertEqual(output_params['output_type'], 'tcp+tls') | ||
self.assertEqual(output_params['output_host'], '0.0.0.0') | ||
self.assertEqual(output_params['output_port'], 8888) | ||
|
||
self.assertEqual(output_params['ca_cert'], '/etc/cb/integrations/cbc-syslog/ca.pem') | ||
self.assertEqual(output_params['tls_cert'], '/etc/cb/integrations/cbc-syslog/cert.pem') | ||
self.assertEqual(output_params['tls_key'], '/etc/cb/integrations/cbc-syslog/cert.key') | ||
self.assertEqual(output_params['tls_verify'], True) | ||
|
||
self.assertEqual(len(server_list), 2) | ||
|
||
def test_json_config(self): | ||
config = parse_config(os.path.dirname(__file__) + '/fixtures/json.conf') | ||
output_params, server_list = verify_config(config) | ||
|
||
self.assertEqual(output_params['output_format'], 'json') | ||
self.assertEqual(output_params['output_type'], 'http') | ||
self.assertEqual(output_params['output_host'], 'http://0.0.0.0:5001/http_out') | ||
self.assertEqual(output_params['output_port'], None) | ||
self.assertEqual(output_params['http_headers'], {'content-type': 'application/json'}) | ||
self.assertEqual(output_params['https_ssl_verify'], False) | ||
|
||
self.assertEqual(len(server_list), 1) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters