Skip to content

Commit

Permalink
Add wizard support for proxy and doc updates for 2.0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Van Brunt authored and avanbrunt-cb committed Jul 12, 2024
1 parent 211b32a commit 71465c3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ For more information on each section follow the guide below:

d. Enable the desired data you would like to send for the organization

e. Optionally: Add a proxy server to route Carbon Black Cloud backend requests through `proxy = "0.0.0.0:8889"`

7. If you set `alerts_enabled` to `true` then you will need to configure one or more `alert_rules`

Each `alert_rules` is a separate request for alerts such that you can configure custom criteria for a desired usecase. See [Search Fields - Alert](https://developer.carbonblack.com/reference/carbon-black-cloud/platform/latest/alert-search-fields/) for the fields marked **Searchable**.
Expand Down Expand Up @@ -297,7 +299,7 @@ The following fields are available for building the Syslog header
* `{{datetime_legacy}}` - Uses current time with format e.g. Jan 18 11:07:53
* `{{vendor}}` - CarbonBlack
* `{{product}}` - CBCSyslog
* `{{product_version}}` - Current CBC Syslog version e.g. 2.0.4
* `{{product_version}}` - Current CBC Syslog version e.g. 2.0.5


For the available Alert fields see [Search Fields - Alerts](https://developer.carbonblack.com/reference/carbon-black-cloud/platform/latest/alert-search-fields)
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## Version 2.0.5

**NEW:**
* Added support to configure a proxy for Carbon Black Cloud requests

## Version 2.0.4

**Bug Fixes**
Expand Down
3 changes: 3 additions & 0 deletions examples/cbc-syslog.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@
#
# audit_logs_enabled = Whether you want to forward Audit logs - e.g. true
#
# proxy = The url to proxy server - e.g. "0.0.0.0:8889"
#
# [SourceName1]
# server_url =
# org_key =
# custom_api_id =
# custom_api_key =
# alerts_enabled =
# audit_logs_enabled =
# proxy =

#
# At least one alert_rules is needed to match alerts multiple groups of rules can be added
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

setup(
name="cbc_syslog",
version="2.0.4",
version="2.0.5",
install_requires=install_requires,
extras_require=extras_require,
package_dir={"": "src"},
Expand Down
2 changes: 1 addition & 1 deletion src/cbc_syslog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
__author__ = 'Carbon Black Developer Network'
__license__ = 'MIT'
__copyright__ = 'Copyright 2018-2024 Broadcom Inc. Carbon Black.'
__version__ = '2.0.4'
__version__ = '2.0.5'

from .core import poll, check, history, wizard, convert

Expand Down
4 changes: 4 additions & 0 deletions src/cbc_syslog/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ def wizard(output_file_path):

print("If you want to provide more rules or add additional filters check out the README for more information\n")

if input("Do you want to add a proxy (y or n): ").lower() == "y":
proxy_url = input("Provide the URL for the Proxy Server: ")
output_file.write(f"proxy = \"{proxy_url}\"\n")

if input("Do you want to add another organization (y or n): ").lower() == "n":
break
print(f"\nTo test your configuration use:\n"
Expand Down
1 change: 1 addition & 0 deletions src/tests/fixtures/confs/wizard-json-file.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ custom_api_id = "api_id"
custom_api_key = "api_key"
audit_logs_enabled = true
alerts_enabled = false
proxy = "0.0.0.0:8889"
6 changes: 6 additions & 0 deletions src/tests/fixtures/mock_stdin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
y
3
n
n
"""

TEMPLATE_TCP_TLS = f"""{TMP_PATH}
Expand Down Expand Up @@ -67,6 +68,7 @@
0
5
n
n
"""

TEMPLATE_UDP = f"""{TMP_PATH}
Expand All @@ -86,6 +88,7 @@
n
y
8
n
y
Source2
defense-conferdeploy.net
Expand All @@ -96,6 +99,7 @@
y
3
n
n
"""

JSON_FILE = f"""{TMP_PATH}
Expand All @@ -109,6 +113,8 @@
api_key
y
n
y
0.0.0.0:8889
n
"""

Expand Down

0 comments on commit 71465c3

Please sign in to comment.