Skip to content

Commit

Permalink
Merge pull request #284 from splunk/release/1.7.0
Browse files Browse the repository at this point in the history
Release/1.7.0
* Add CyberArk PTA and EPV Support
  • Loading branch information
Ryan Faircloth authored and GitHub committed Jan 23, 2020
2 parents 5351a45 + 1374bb3 commit 0f8da77
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 4 deletions.
81 changes: 81 additions & 0 deletions docs/sources/CyberArk/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Vendor - CyberArk

## Product - EPV

| Ref | Link |
|----------------|---------------------------------------------------------------------------------------------------------|
| Splunk Add-on CyberArk | https://splunkbase.splunk.com/app/2891/ |
| Add-on Manual | https://docs.splunk.com/Documentation/AddOns/latest/CyberArk/About |


### Sourcetypes

| sourcetype | notes |
|----------------|---------------------------------------------------------------------------------------------------------|
| cyberark:epv:cef | None |

### Index Configuration

| key | sourcetype | index | notes |
|----------------|----------------|----------------|----------------|
| CyberArk_Vault | cyberark:epv:cef | netauth | none |

### Filter type

MSG Parse: This filter parses message content

### Options

| Variable | default | description |
|----------------|----------------|----------------|
| SC4S_LISTEN_MICROFOCUS_ARCSIGHT_TCP_PORT | empty string | Enable a TCP port for this specific vendor product using the number defined |

### Verification

An active site will generate frequent events use the following search to check for new events

Verify timestamp, and host values match as expected

```
index=<asconfigured> (sourcetype=cef sourcetype="cyberark:epv:cef")
```

## Product - PTA

| Ref | Link |
|----------------|---------------------------------------------------------------------------------------------------------|
| Splunk Add-on CyberArk | https://splunkbase.splunk.com/app/2891/ |
| Add-on Manual | https://docs.splunk.com/Documentation/AddOns/latest/CyberArk/About |


### Sourcetypes

| sourcetype | notes |
|----------------|---------------------------------------------------------------------------------------------------------|
| cyberark:pta:cef | None |

### Index Configuration

| key | sourcetype | index | notes |
|----------------|----------------|----------------|----------------|
| Cyber-Ark_Vault | cyberark:pta:cef | main | none |

### Filter type

MSG Parse: This filter parses message content

### Options

| Variable | default | description |
|----------------|----------------|----------------|
| SC4S_LISTEN_MICROFOCUS_ARCSIGHT_TCP_PORT | empty string | Enable a TCP port for this specific vendor product using the number defined |

### Verification

An active site will generate frequent events use the following search to check for new events

Verify timestamp, and host values match as expected

```
index=<asconfigured> (sourcetype=cef sourcetype="cyberark:pta:cef")
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ nav:
- About: sources/index.md
- Checkpoint: sources/Checkpoint/index.md
- Cisco: sources/Cisco/index.md
- CyberArk: sources/CyberArk/index.md
- Forcepoint: sources/Forcepoint/index.md
- Fortinet: sources/Fortinet/index.md
- Imperva: sources/Imperva/index.md
Expand Down
3 changes: 2 additions & 1 deletion package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ ENV DISTCHECK_CONFIGURE_FLAGS="--prefix=/opt/syslog-ng --with-ivykis=system --wi
RUN dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y ;\
dnf install 'dnf-command(config-manager)' -y ;\
dnf config-manager --set-enabled PowerTools -y; \
dnf update -y
dnf update -y ;\
dnf upgrade

RUN dnf group install "Development Tools" -y ;\
dnf install findutils autoconf \
Expand Down
4 changes: 4 additions & 0 deletions package/etc/conf.d/context/microfocus_arcsight_source.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
ArcSight_ArcSight,source,ArcSight:ArcSight
Cyber-Ark_Vault,sourcetype,cyberark:epv:cef
Cyber-Ark_Vault,index,netauth
CyberArk_PTA,sourcetype,cyberark:pta:cef
CyberArk_PTA,index,main
Microsoft_System or Application Event,source,CEFEventLog:System or Application Event
Microsoft_System or Application Event,index,oswin
Microsoft_Microsoft Windows,source,CEFEventLog:Microsoft Windows
Expand Down
11 changes: 8 additions & 3 deletions package/etc/conf.d/log_paths/lp-microfocus_arcsight.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ log {
};

rewrite {
set("microfocus_arcsight", value("fields.sc4s_vendor_product"));
r_set_splunk_dest_default(sourcetype("cef"), index("main"))
};

parser { p_add_context_splunk(key("cef_{fields.cef_device_vendor}_${fields.cef_device_product}")); };

parser (p_microfocus_arcsight_header);

rewrite {
set("${fields.cef_device_vendor}_${fields.cef_device_product}", value("fields.sc4s_vendor_product"));
};

parser {
p_add_context_splunk(key("${fields.cef_device_vendor}_${fields.cef_device_product}"));
};

# We already have the syslog msg time stamp however that may not be the best one
# If we have an rt or end field that is best we use the If trick here so if this parser fails
# We don't get sent to fallback.
Expand Down
56 changes: 56 additions & 0 deletions tests/test_cyberark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2019 Splunk, Inc.
#
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
import random

from jinja2 import Environment

from .sendmessage import *
from .splunkutils import *

env = Environment(extensions=['jinja2_time.TimeExtension'])


#<190>Jul 27 23:31:58 VAULT CEF:0|Cyber-Ark|Vault|9.20.0000|7|Logon|5|act="Logon" suser=##USER_NAME## fname= dvc= shost=##SOURCE_IP## dhost= duser= externalId= app= reason= cs1Label="Affected User Name" cs1= cs2Label="Safe Name" cs2= cs3Label="Device Type" cs3=11111 cs4Label="Database" cs4=222222 cs5Label="Other info" cs5= cn1Label="Request Id" cn1= cn2Label="Ticket Id" cn2= msg=
def test_cyberark_epv(record_property, setup_wordlist, setup_splunk):
host = "{}-{}".format(random.choice(setup_wordlist), random.choice(setup_wordlist))

mt = env.from_string(
"{{ mark }}{% now 'utc', '%b %d %H:%M:%S' %} {{ host }} CEF:0|Cyber-Ark|Vault|9.20.0000|7|Logon|5|act=\"Logon\" suser=##USER_NAME## fname= dvc= shost=##SOURCE_IP## dhost= duser= externalId= app= reason= cs1Label=\"Affected User Name\" cs1= cs2Label=\"Safe Name\" cs2= cs3Label=\"Device Type\" cs3=11111 cs4Label=\"Database\" cs4=222222 cs5Label=\"Other info\" cs5= cn1Label=\"Request Id\" cn1= cn2Label=\"Ticket Id\" cn2= msg=\n")
message = mt.render(mark="<111>", host=host)

sendsingle(message)

st = env.from_string("search index=netauth host=\"{{ host }}\" sourcetype=\"cyberark:epv:cef\"| head 2")
search = st.render(host=host)

resultCount, eventCount = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", resultCount)
record_property("message", message)

assert resultCount == 1

#<190>Jul 12 23:44:25 10.0.0.1 CEF:0|CyberArk|PTA|2.6.1|20|Privileged account anomaly|8|cs1Label=incidentId cs1=55a32ed8e4b0e4a90114e12c start=1436755482000 deviceCustomDate1Label=detectionDate deviceCustomDate1=1436759065017 msg=Incident updated. Now contains 7 anomalies cs2Label=link cs2=https://10.0.0.1/incidents/55a32ed8e4b0e4a90114e12c
def test_cyberark_pta(record_property, setup_wordlist, setup_splunk):
host = "{}-{}".format(random.choice(setup_wordlist), random.choice(setup_wordlist))

mt = env.from_string(
"{{ mark }}{% now 'utc', '%b %d %H:%M:%S' %} {{ host }} CEF:0|CyberArk|PTA|2.6.1|20|Privileged account anomaly|8|cs1Label=incidentId cs1=55a32ed8e4b0e4a90114e12c start=1436755482000 deviceCustomDate1Label=detectionDate deviceCustomDate1=1436759065017 msg=Incident updated. Now contains 7 anomalies cs2Label=link cs2=https://10.0.0.1/incidents/55a32ed8e4b0e4a90114e12c\n")
message = mt.render(mark="<111>", host=host)

sendsingle(message)

st = env.from_string("search index=main host=\"{{ host }}\" sourcetype=\"cyberark:pta:cef\"| head 2")
search = st.render(host=host)

resultCount, eventCount = splunk_single(setup_splunk, search)

record_property("host", host)
record_property("resultCount", resultCount)
record_property("message", message)

assert resultCount == 1

0 comments on commit 0f8da77

Please sign in to comment.