Skip to content

Commit 2ddd978

Browse files
committed
VPN Tagging: Prepare release 1.2.5
1 parent a3aa9cd commit 2ddd978

File tree

10 files changed

+66
-13
lines changed

10 files changed

+66
-13
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ Splunk app: i.e., all files and folders except ones that are ignored by the `.sl
1212

1313
---
1414

15+
## [1.2.5](https://github.com/crowdsecurity/crowdsec-splunk-app/releases/tag/v1.2.5) - 2026-01-08
16+
17+
[_Compare with previous release_](https://github.com/crowdsecurity/crowdsec-splunk-app/compare/v1.2.4...v1.2.5)
18+
19+
### Changed
20+
21+
- Support basic tagging of VPN.
22+
23+
1524
## [1.2.4](https://github.com/crowdsecurity/crowdsec-splunk-app/releases/tag/v1.2.4) - 2025-12-19
1625

1726
[_Compare with previous release_](https://github.com/crowdsecurity/crowdsec-splunk-app/compare/v1.2.3...v1.2.4)
@@ -22,7 +31,7 @@ Splunk app: i.e., all files and folders except ones that are ignored by the `.sl
2231
- `cssmoke`: new "profile" option, to display a preset of columns
2332
- `cssmokedownload`: new command to download the CrowdSec offline replication
2433

25-
## [1.2.4](https://github.com/crowdsecurity/crowdsec-splunk-app/releases/tag/v1.2.3) - 2025-11-25
34+
## [1.2.3](https://github.com/crowdsecurity/crowdsec-splunk-app/releases/tag/v1.2.3) - 2025-11-25
2635

2736
[_Compare with previous release_](https://github.com/crowdsecurity/crowdsec-splunk-app/compare/v1.2.2...v1.2.3)
2837

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYTHON=python3.9
1+
PYTHON=uv run python3.9
22
SDK_VERSION=2.1.1
33
TARGET_DIR=bin/splunklib
44
TMP_DIR=/tmp/splunk-sdk
@@ -11,7 +11,7 @@ add-sdk:
1111
mkdir -p $(TARGET_DIR)
1212

1313
@echo "==> Installing Splunk SDK version $(SDK_VERSION) using $(PYTHON)..."
14-
$(PYTHON) -m pip install --no-deps --no-cache-dir --target=$(TMP_DIR) splunk-sdk==$(SDK_VERSION)
14+
uv pip install --no-deps --no-cache-dir --target=$(TMP_DIR) splunk-sdk==$(SDK_VERSION)
1515

1616
@echo "==> Copying SDK to $(TARGET_DIR)..."
1717
cp -r $(TMP_DIR)/splunklib/* $(TARGET_DIR)/

app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": {
66
"group": null,
77
"name": "crowdsec-splunk-app",
8-
"version": "1.2.4"
8+
"version": "1.2.5"
99
},
1010
"author": [
1111
{

appserver/static/javascript/setup_page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require.config({
1010
"../app/" + app_name + "/javascript/vendor/react-dom.production.min",
1111
},
1212
scriptType: "module",
13-
urlArgs: "v=v1.2.4",
13+
urlArgs: "v=v1.2.5",
1414
});
1515

1616
require(["react", "ReactDOM", "myApp"], function (react, ReactDOM, myApp) {

bin/crowdsec_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "1.2.4"
1+
VERSION = "1.2.5"
22
APP_NAME = "crowdsec-splunk-app"
33

44
DEFAULT_SPLUNK_HOME = "/opt/splunk"

bin/crowdsec_utils.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,43 @@ def load_local_dump_settings(service):
3838
stanza.content.get("local_dump", "0").lower() == "1"
3939
)
4040
return local_dump_enabled
41+
42+
43+
VPN_PROVIDER = ["m247", "Datacamp", "PacketHub", "Proton AG", "Clouvider limited"]
44+
45+
46+
import logging
47+
import sys
48+
49+
logger = logging.getLogger("crowdsec_mmdb_downloader")
50+
logger.setLevel(logging.INFO)
51+
_handler = logging.StreamHandler(sys.stderr)
52+
_handler.setFormatter(
53+
logging.Formatter("%(asctime)s %(levelname)s %(name)s - %(message)s")
54+
)
55+
logger.handlers = [_handler]
56+
logger.propagate = False
57+
58+
59+
def set_vpn(entry):
60+
as_name = entry.get("as_name")
61+
if not as_name:
62+
return entry
63+
64+
for provider in VPN_PROVIDER:
65+
if provider.lower() in as_name.lower():
66+
entry["proxy_or_vpn"] = True
67+
if "classifications" not in entry:
68+
entry["classifications"] = dict()
69+
if "classifications" not in entry["classifications"]:
70+
entry["classifications"]["classifications"] = list()
71+
entry["classifications"]["classifications"].append(
72+
{
73+
"description": "IP exposes a VPN service or is being flagged as one.",
74+
"label": "VPN",
75+
"name": "proxy:vpn",
76+
},
77+
)
78+
return entry
79+
80+
return entry

bin/cssmoke.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
)
1515

1616
from download_mmdb import get_mmdb_local_path
17-
from crowdsec_utils import (
18-
get_headers,
19-
load_local_dump_settings,
20-
load_api_key,
21-
)
17+
from crowdsec_utils import get_headers, load_local_dump_settings, load_api_key, set_vpn
2218
from crowdsec_constants import (
2319
LOCAL_DUMP_FILES,
2420
CROWDSEC_PROFILES,
@@ -317,7 +313,7 @@ def load_readers(self):
317313
mmdb_path = get_mmdb_local_path(info["output_filename"])
318314
if not os.path.isfile(mmdb_path):
319315
raise Exception(
320-
f"MMDB file '{info['name']}' not found, run 'cssmokedownload' command to download the CrowdSec lookup database."
316+
f"MMDB file '{info['crowdsec_dump_name']}' not found, run 'cssmokedownload' command to download the CrowdSec lookup database."
321317
)
322318

323319
self.readers.append(
@@ -446,6 +442,7 @@ def _execute_batch(self, buffer, allowed_fields, local_dump_enabled):
446442
for record, ip in buffer:
447443
entry = data_by_ip.get(ip)
448444
if entry:
445+
entry = set_vpn(entry)
449446
entry["query_time"] = query_time
450447
entry["query_mode"] = mode
451448
attach_resp_to_record(record, entry, self.ipfield, allowed_fields)

config/example.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"api_key": "YOUR_API_KEY_HERE",
3+
"batching": true,
4+
"batch_size": 20,
5+
"local_dump": true
6+
}

default/app.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ label = CrowdSec
1717
[launcher]
1818
author=CrowdSec
1919
description=This app leverages the CrowdSec's CTI API to perform lookups on IPs
20-
version=1.2.4
20+
version=1.2.5
2121

2222
[package]
2323
id = crowdsec-splunk-app

dev/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Once you are ready to release a new version (e.g. when all your changes are on t
142142
- Each release description must respect the same format as the previous ones.
143143
- Update the `default/app.conf` file with the new version number.
144144
- Update the `appserver/static/javascript/setup_pages.js` file with the new version number.
145+
- Update the `bin/crowdsec_constants.py` file with the new version number.
145146
- Update the `app.manifest` file with the new version number by running the following command in the root folder of the project:
146147

147148
```bash

0 commit comments

Comments
 (0)