Skip to content

Commit 1221750

Browse files
authored
Merge pull request #13 from crowdsecurity/local-dump-function
Add support of local CTI download
2 parents 004195f + ee32100 commit 1221750

29 files changed

+2398
-190
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ jobs:
106106
exit 1
107107
fi
108108
109+
# Check in bin/crowdsec_constants.py
110+
# Example: VERSION = "1.2.3"
111+
PY_VERSION=$(sed -n 's/^VERSION[[:space:]]*=[[:space:]]*"\(.*\)"/\1/p' bin/crowdsec_constants.py | tr -d '\r')
112+
if [[ "$PY_VERSION" == "${{ env.VERSION_NUMBER }}" ]]
113+
then
114+
echo "bin/crowdsec_constants.py VERSION OK"
115+
else
116+
echo "bin/crowdsec_constants.py VERSION KO"
117+
echo "Found: $PY_VERSION"
118+
echo "Expected: ${{ env.VERSION_NUMBER }}"
119+
exit 1
120+
fi
121+
109122
- name: Set up Python
110123
uses: actions/setup-python@v5
111124
with:

CHANGELOG.md

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

1313
---
1414

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

17-
[_Compare with previous release_](https://github.com/crowdsecurity/crowdsec-splunk-app/compare/v1.2.2...v1.2.3)
17+
[_Compare with previous release_](https://github.com/crowdsecurity/crowdsec-splunk-app/compare/v1.2.2...v1.2.4)
1818

1919
### Changed
2020

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55
## Overview
66
The CrowdSec Splunk app leverages the CrowdSec's CTI API's smoke endpoint which enables users to query an IP and receive enrichment
77

8+
9+
## Table of Contents
10+
- [Overview](#overview)
11+
- [Example Usage](#example-usage)
12+
- [Results](#results)
13+
- [Profiles](#profiles)
14+
- [Local Dump](#local-dump)
15+
- [Configuration file](#configuration-file)
16+
- [`api_key`](#api_key)
17+
- [`batching`](#batching)
18+
- [`batch_size`](#batch_size)
19+
- [`local_dump`](#local_dump)
20+
21+
822
## Example Usage
923

1024
The following command is used to run an IP check through the CrowdSec's CTI API's smoke endpoint. On the Homepage of Splunk Web Interface, select `Search & Reporting` and use the following command.
@@ -19,7 +33,77 @@ The following command is used to run an IP check through the CrowdSec's CTI API'
1933
- `ipfield`:
2034
- It denotes the field name where the IP address is stored in the index.
2135

36+
- `profile`:
37+
Optional preset that selects a predefined set of CrowdSec output fields (it is possible to specify mutliple profiles).
38+
2239
## Results
2340
On the event of clicking the `Search` button, users will be able to view a brief overview of various fields associated with the input IP address.
2441

2542
This includes but not limited to location, behaviors, classifications, attack details – name, label, description, references followed by scores, threats, etc.
43+
44+
## Profiles
45+
46+
Profiles are optional presets that automatically select a predefined set of CrowdSec output fields, so results stay consistent and you don’t have to manually maintain long `ipfield=` lists.
47+
48+
- `base`: returns `ip`, `reputation`, `confidence`, `as_num`, `as_name`, `location`, `classifications`.
49+
50+
- `anonymous`: (aliases: `vpn` `proxy`): returns `ip`, `reputation`, `proxy_or_vpn`, `classifications`.
51+
52+
- `iprange`: returns `ip`, `ip_range`, `ip_range_24`, `ip_range_24_score`.
53+
54+
You can provide multiple profile in the same command:
55+
56+
```
57+
| cssmoke ipfield="ip" profile="anonymous,iprange"
58+
```
59+
60+
The output will contains the columns for the `anonymous` and the `iprange` profiles.
61+
62+
## Local Dump
63+
64+
The first time you setup the local dump feature, you need to download manually the CrowdSec lookup databases (they will be updated every 24h automatically after that):
65+
66+
```
67+
| cssmokedownload
68+
```
69+
70+
After that, you can look up IPs using the local databases.
71+
72+
**Note:** Check the `query_time` and `query_mode` fields in the results to confirm whether lookups are done via `local_dump` or the live API.
73+
74+
## Configuration file
75+
76+
You can configure the CrowdSec app by uploading a JSON configuration file:
77+
78+
```
79+
{
80+
"api_key": "YOUR_API_KEY_HERE",
81+
"batching": true|false,
82+
"batch_size": 20,
83+
"local_dump": true|false
84+
}
85+
```
86+
87+
### `api_key`
88+
89+
CrowdSec CTI API key.
90+
91+
**Warning:** Local dump and live CTI API lookups are mutually exclusive (enable only one mode).
92+
93+
### `batching`
94+
95+
Enable batching for live CTI API lookups.
96+
97+
### `batch_size`
98+
99+
Batch size used when `batching` is enabled.
100+
101+
### `local_dump`
102+
103+
Enable local dump mode (use the downloaded lookup databases).
104+
105+
Lookup databases are download automatically every 24h.
106+
107+
**Warning:** Local dump requires a CTI API key that has access to the dump endpoint.
108+
109+

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.3"
8+
"version": "1.2.4"
99
},
1010
"author": [
1111
{
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"api_key": "YOUR_CROWDSEC_CTI_KEY",
3+
"batching": false,
4+
"batch_size": 10,
5+
"local_dump": false
6+
}
114 KB
Loading

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.3",
13+
urlArgs: "v=v1.2.4",
1414
});
1515

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

0 commit comments

Comments
 (0)