Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Barracuda CloudGen] Add initial Barracuda CloudGen Firewall integration #3796

Merged
merged 32 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cdf259a
#3773: Add initial Barracuda Cloudgen Firewall integration
legoguy1000 Jul 21, 2022
ed7bf0d
Add sample data, inital framework for system tests
legoguy1000 Aug 20, 2022
8c25b62
Resolve pipeline issues
legoguy1000 Aug 26, 2022
1e14290
update codeowners
legoguy1000 Sep 7, 2022
7f62b11
test
legoguy1000 Sep 16, 2022
db1c514
update test config
legoguy1000 Sep 19, 2022
48c51ac
update tests
legoguy1000 Sep 19, 2022
51e2f0b
update pipelines
legoguy1000 Sep 19, 2022
00c5469
update samples
legoguy1000 Sep 20, 2022
b9d89dc
Expand documentation
andrewkroh Sep 21, 2022
94c18aa
Change sample log file extension to .ndjson
andrewkroh Sep 21, 2022
05acc85
change "Cloudgen" to "CloudGen"
andrewkroh Sep 21, 2022
a36247f
Separate listen_address and listen_port
andrewkroh Sep 21, 2022
4d44319
Match ECS version in pipeline to build.yml
andrewkroh Sep 21, 2022
6226b95
Remove message when event.original already exists
andrewkroh Sep 21, 2022
9a78e00
Use triple braces in mustache templates to avoid escapes
andrewkroh Sep 21, 2022
6956267
Regenerate golden files with ecs.version 8.4.0
andrewkroh Sep 21, 2022
f8fa120
Use labels to hold origin metadata
andrewkroh Sep 21, 2022
71b4e40
Refactor pipeline so that @timestamp is always present
andrewkroh Sep 21, 2022
5302349
elastic-package format
andrewkroh Sep 21, 2022
d7d2bc4
Define labels in fields
andrewkroh Sep 21, 2022
8b5a6bf
Sort ecs.yml fields
andrewkroh Sep 21, 2022
c5157c3
Use ECS definition of source.geo.location
andrewkroh Sep 21, 2022
54bf2ed
Remove duplicate @timestamp and tags field declarations
andrewkroh Sep 21, 2022
848d36e
Remove container.id
andrewkroh Sep 21, 2022
4dd436c
Fix duration to ns conversion
andrewkroh Sep 21, 2022
2aea11a
Update sample event
andrewkroh Sep 21, 2022
2a1fed0
Add tag and description to all scripts
andrewkroh Sep 21, 2022
9bb842e
Don't use null-safe operator on 'ctx' - ctx?.
andrewkroh Sep 21, 2022
4453f19
Normalize indentation in YAML
andrewkroh Sep 21, 2022
c9a1ee2
Add sample event to readme
andrewkroh Sep 21, 2022
1283c14
Tailor manifest to descriptions in CloudGen docs
andrewkroh Sep 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/packages/azure @elastic/obs-cloud-monitoring
/packages/azure_metrics @elastic/obs-cloud-monitoring
/packages/barracuda @elastic/security-external-integrations
/packages/barracuda_cloudgen_firewall @elastic/security-external-integrations
/packages/bluecoat @elastic/security-external-integrations
/packages/box_events @elastic/security-external-integrations
/packages/carbon_black_cloud @elastic/security-external-integrations
Expand Down
3 changes: 3 additions & 0 deletions packages/barracuda_cloudgen_firewall/_dev/build/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies:
ecs:
reference: git@v8.4.0
28 changes: 28 additions & 0 deletions packages/barracuda_cloudgen_firewall/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Barracuda CloudGen Firewall integration

This integration ingests and parses logs from
[Barracuda CloudGen Firewalls](https://www.barracuda.com/products/cloudgenfirewall).

Barracuda CloudGen Firewall allows you to stream event logs from Firewall
Insights to Elastic Agent. This provides information on firewall activity,
threat logs, and information related to network, version, and location of
managed firewall units. Data is sent to Elastic Agent over a TCP connection
using CloudGen Firewall's built-in generic Logstash output.

### Setup

For a detailed walk-through of the setup steps the see
[How to Enable Filebeat Stream to a Logstash Pipeline](https://campus.barracuda.com/product/cloudgenfirewall/doc/96025953/how-to-enable-filebeat-stream-to-a-logstash-pipeline/).
These steps were written with a Logstash server as the intended destination, and
where it references the "Hostname" use the address and port of the Elastic Agent
that is running this integration. Logstash is not used as part of this
integration.

## Logs

This is the Barracuda CloudGen Firewall `log` dataset. Below is a sample
event and a list of fields that can be produced.

{{event "log"}}

{{fields "log"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '2.3'
services:
barracuda-cloudgen-lumberjack:
image: docker.elastic.co/observability/stream:v0.8.0
volumes:
- ./sample_logs:/sample_logs:ro
environment:
- STREAM_PROTOCOL=lumberjack
- STREAM_LUMBERJACK_PARSE_JSON=true
- STREAM_ADDR=tcp://elastic-agent:5044
- STREAM_DELAY=5s
- STREAM_START_SIGNAL=SIGHUP
# The ndjson files contain data that simulates the format of the Logstash
# output from the embedded Filebeat instance in Barracuda CloudGen.
# It contains a JSON string in the 'message' field and some additional
# firewall metadata (like serial number) stored in root level fields.
command: log /sample_logs/*.ndjson
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"beat": {"hostname": "cgf-scout-int"}, "message":"{\"version\":1,\"timestamp\":1606230141,\"action\":\"End\",\"duration\":8436,\"src_iface\":\"eth0\",\"src_ip\":\"10.17.35.171\",\"src_port\":40532,\"src_mac\":\"00:0c:29:9a:0a:78\",\"dst_iface\":\"eth0\",\"dst_ip\":\"67.43.156.78\",\"dst_port\":443,\"dst_mac\":\"00:0c:29:00:d6:00\",\"fw_rule\":\"BOX-LAN-2-INTERNET\",\"app_rule\":\"<App>:ALL-APPS\",\"fw_info\":2007,\"src_ip_nat\":\"10.17.35.175\",\"dst_ip_nat\":\"67.43.156.100\",\"fwd_bytes\":7450,\"rev_bytes\":561503,\"fwd_packets\":129,\"rev_packets\":439,\"ip_proto\":6,\"protos\":[\"HTTPS direct\",\"HTTPS\",\"All HTTP protocols\"],\"apps\":[\"Web browsing\"]}","product":"ngfw","sn":"4f94abdf7a8c465fa2cd76f680ecafd1","type":"ngfw-act"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"beat": {"hostname": "cgf-scout-int"}, "message":"{\"app_target\":\"eicar.exe\",\"component\":\"firewall\",\"date\":\"2018 05 15\",\"description\":\"Eicar-Test-Signature\",\"dst_ip\":\"10.0.6.96\",\"operation\":\"Block\",\"port\":\"443\",\"severity\":\"Warning\",\"src_ip\":\"10.17.35.169\",\"threat_severity\":\"3\",\"time\":\"15:42:27\",\"timestamp\":\"2018-05-15T15:42:27+00:00\",\"timezone\":\"+00:00\",\"trans_proto\":\"TCP\",\"type\":\"Virus\",\"user\":\"user42\"}","product":"ngfw","sn":"4f94abdf7a8c465fa2cd76f680ecafd1","type":"ngfw-threat"}
{"beat": {"hostname": "cgf-scout-int"}, "message":"{\"app_target\":\"boese.pdf\",\"component\":\"firewall\",\"date\":\"2018 05 15\",\"description\":\"ad43f5fc1d679c8d766824abb41b2b28b364c3c8;.pdf\",\"dst_ip\":\"89.160.20.129\",\"operation\":\"Block\",\"port\":\"80\",\"severity\":\"Warning\",\"src_ip\":\"10.17.35.169\",\"threat_severity\":\"3\",\"time\":\"15:42:32\",\"timestamp\":\"2018-05-15T15:42:32+00:00\",\"timezone\":\"+00:00\",\"trans_proto\":\"TCP\",\"type\":\"ATD\",\"user\":\"user42\"}","product":"ngfw","sn":"4f94abdf7a8c465fa2cd76f680ecafd1","type":"ngfw-threat"}
{"beat": {"hostname": "cgf-scout-int"}, "message":"{\"component\":\"firewall\",\"date\":\"2018 05 15\",\"description\":\"ID: 1054837 WEB Remote File Inclusion /etc/passwd\",\"dst_ip\":\"89.160.20.130\",\"ips_category\":\"Web Attack\",\"operation\":\"Block\",\"port\":\"80\",\"severity\":\"Warning\",\"src_ip\":\"10.17.35.169\",\"threat_severity\":\"3\",\"time\":\"15:46:06\",\"timestamp\":\"2018-05-15T15:46:06+00:00\",\"timezone\":\"+00:00\",\"trans_proto\":\"TCP\",\"type\":\"IPS\",\"user\":\"user45\"}","product":"ngfw","sn":"4f94abdf7a8c465fa2cd76f680ecafd1","type":"ngfw-threat"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"beat": {"hostname": "cgf-scout-int"}, "message":"{\"timestamp\":1526383397000,\"traffic_type\":0,\"action\":0,\"source_ip\":\"192.168.42.124\",\"source_port\":\"50646\",\"destination_ip\":\"175.16.199.12\",\"destination_port\":\"443\",\"method\":\"GET\",\"status_code\":\"200\",\"user_agent\":\"wget/1.19.2 (linux-gnu)\",\"content_type\":\"text/html; charset=UTF-8\",\"name\":\"https://www.heise.de/\",\"size\":59558,\"domain\":\"www.heise.de\",\"category\":[\"79\"],\"user\":\"192.168.42.124\",\"user_type\":0,\"fw_rule\":\"LAN-2-INTERNET\",\"app_rule\":\"<App>:<pass-no-match>\"}","product":"ngfw","sn":"4f94abdf7a8c465fa2cd76f680ecafd1","type":"ngfw-wf"}
{"beat": {"hostname": "cgf-scout-int"}, "message":"{\"timestamp\":1526377804000,\"traffic_type\":0,\"action\":0,\"source_ip\":\"192.168.42.105\",\"source_port\":\"50159\",\"destination_ip\":\"89.160.20.114\",\"destination_port\":\"443\",\"method\":\"GET\",\"status_code\":\"200\",\"user_agent\":\"mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, like gecko) chrome/66.0.3359.139 safari/537.36\",\"content_type\":\"\",\"name\":\"https://clientservices.googleapis.com/chrome-variations/seed?osname=win&channel=stable&milestone=66\",\"size\":0,\"domain\":\"clientservices.googleapis.com\",\"category\":[],\"user\":\"192.168.42.105\",\"user_type\":0,\"fw_rule\":\"LAN-2-INTERNET\",\"app_rule\":\"<App>:<pass-no-match>\"}","product":"ngfw","sn":"4f94abdf7a8c465fa2cd76f680ecafd1","type":"ngfw-wf"}
6 changes: 6 additions & 0 deletions packages/barracuda_cloudgen_firewall/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# newer versions go on top
- version: "0.1.0"
changes:
- description: initial release
type: enhancement # can be one of: enhancement, bugfix, breaking-change
link: https://github.com/elastic/package-storage/pull/3796
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"timestamp":1606230141,"action":"End","duration":8436,"src_iface":"eth0","src_ip":"10.17.35.171","src_port":40532,"src_mac":"00:0c:29:9a:0a:78","dst_iface":"eth0","dst_ip":"67.43.156.78","dst_port":443,"dst_mac":"00:0c:29:00:d6:00","fw_rule":"BOX-LAN-2-INTERNET","app_rule":"<App>:ALL-APPS","fw_info":2007,"src_ip_nat":"10.17.35.175","dst_ip_nat":"67.43.156.100","fwd_bytes":7450,"rev_bytes":561503,"fwd_packets":129,"rev_packets":439,"ip_proto":6,"protos":["HTTPS direct","HTTPS","All HTTP protocols"],"apps":["Web browsing"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fields:
tags:
- preserve_original_event
lumberjack:
type: ngfw-act
sn: 4f94abdf7a8c465fa2cd76f680ecafd1
product: ngfw
beat:
hostname: cgf-scout-int
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"expected": [
{
"@timestamp": "2020-11-24T15:02:21.000Z",
"barracuda_cloudgen_firewall": {
"log": {
"app_rule": "\u003cApp\u003e:ALL-APPS",
"fw_info": 2007
}
},
"destination": {
"address": "67.43.156.78",
"as": {
"number": 35908
},
"bytes": 561503,
"geo": {
"continent_name": "Asia",
"country_iso_code": "BT",
"country_name": "Bhutan",
"location": {
"lat": 27.5,
"lon": 90.5
}
},
"ip": "67.43.156.78",
"mac": "00-0C-29-00-D6-00",
"nat": {
"ip": "67.43.156.100"
},
"packets": 439,
"port": 443
},
"ecs": {
"version": "8.4.0"
},
"event": {
"action": "End",
"category": [
"network"
],
"duration": 8436000000,
"kind": "event",
"original": "{\"version\":1,\"timestamp\":1606230141,\"action\":\"End\",\"duration\":8436,\"src_iface\":\"eth0\",\"src_ip\":\"10.17.35.171\",\"src_port\":40532,\"src_mac\":\"00:0c:29:9a:0a:78\",\"dst_iface\":\"eth0\",\"dst_ip\":\"67.43.156.78\",\"dst_port\":443,\"dst_mac\":\"00:0c:29:00:d6:00\",\"fw_rule\":\"BOX-LAN-2-INTERNET\",\"app_rule\":\"\u003cApp\u003e:ALL-APPS\",\"fw_info\":2007,\"src_ip_nat\":\"10.17.35.175\",\"dst_ip_nat\":\"67.43.156.100\",\"fwd_bytes\":7450,\"rev_bytes\":561503,\"fwd_packets\":129,\"rev_packets\":439,\"ip_proto\":6,\"protos\":[\"HTTPS direct\",\"HTTPS\",\"All HTTP protocols\"],\"apps\":[\"Web browsing\"]}",
"type": [
"end"
]
},
"network": {
"community_id": "1:HGU1tX9W2VUF5ND2ey3X6Niv/AQ=",
"iana_number": "6",
"transport": "tcp",
"type": "ipv4"
},
"observer": {
"egress": {
"interface": {
"name": "eth0"
}
},
"hostname": "cgf-scout-int",
"ingress": {
"interface": {
"name": "eth0"
}
},
"product": "ngfw",
"serial_number": "4f94abdf7a8c465fa2cd76f680ecafd1",
"type": "firewall",
"vendor": "Barracuda"
},
"related": {
"ip": [
"10.17.35.171",
"67.43.156.78"
]
},
"rule": {
"name": "BOX-LAN-2-INTERNET"
},
"source": {
"address": "10.17.35.171",
"bytes": 7450,
"ip": "10.17.35.171",
"mac": "00-0C-29-9A-0A-78",
"nat": {
"ip": "10.17.35.175"
},
"packets": 129,
"port": 40532
},
"tags": [
"preserve_original_event"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"app_target":"eicar.exe","component":"firewall","date":"2018 05 15","description":"Eicar-Test-Signature","dst_ip":"10.0.6.96","operation":"Block","port":"443","severity":"Warning","src_ip":"10.17.35.169","threat_severity":"3","time":"15:42:27","timestamp":"2018-05-15T15:42:27+00:00","timezone":"+00:00","trans_proto":"TCP","type":"Virus","user":"user42"}
{"app_target":"boese.pdf","component":"firewall","date":"2018 05 15","description":"ad43f5fc1d679c8d766824abb41b2b28b364c3c8;.pdf","dst_ip":"89.160.20.129","operation":"Block","port":"80","severity":"Warning","src_ip":"10.17.35.169","threat_severity":"3","time":"15:42:32","timestamp":"2018-05-15T15:42:32+00:00","timezone":"+00:00","trans_proto":"TCP","type":"ATD","user":"user42"}
{"component":"firewall","date":"2018 05 15","description":"ID: 1054837 WEB Remote File Inclusion /etc/passwd","dst_ip":"89.160.20.130","ips_category":"Web Attack","operation":"Block","port":"80","severity":"Warning","src_ip":"10.17.35.169","threat_severity":"3","time":"15:46:06","timestamp":"2018-05-15T15:46:06+00:00","timezone":"+00:00","trans_proto":"TCP","type":"IPS","user":"user45"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fields:
tags:
- preserve_original_event
lumberjack:
type: ngfw-threat
sn: 4f94abdf7a8c465fa2cd76f680ecafd1
product: ngfw
beat:
hostname: cgf-scout-int
Loading