Skip to content

Commit 84cbbda

Browse files
authored
Merge pull request #1379 from stratosphereips/develop
Slips v1.1.8
2 parents bb8610d + aca5966 commit 84cbbda

File tree

24 files changed

+264
-167
lines changed

24 files changed

+264
-167
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
1.1.8 (Mar 31st, 2025)
2+
- Fix SQLite database errors.
3+
- Fix CPU and RAM profilers.
4+
- Fix issue with AsyncModules not shutting down gracefully.
5+
6+
17
1.1.7 (Feb 28th, 2025)
28
- Add global P2P support. Thanks to @d-strat
39
- Add new "GRE tunnel scan" detections.

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Slips v1.1.7
2323
[![License](https://img.shields.io/badge/Blog-Stratosphere-cyan)](https://www.stratosphereips.org/blog/tag/slips)
2424
[![Discord](https://img.shields.io/discord/761894295376494603?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zu5HwMFy5C)
2525
![Twitter Follow](https://img.shields.io/twitter/follow/StratosphereIPS?style=social)
26+
2627
<hr>
2728

2829

@@ -53,6 +54,7 @@ Slips is a powerful endpoint behavioral intrusion prevention and detection syste
5354

5455
<img src="https://raw.githubusercontent.com/stratosphereips/StratosphereLinuxIPS/develop/docs/images/slips.gif" width="850px" title="Slips in action.">
5556

57+
---
5658

5759

5860
# Introduction
@@ -64,6 +66,7 @@ Slips is supported on Linux, MacOS, and windows dockers only. The blocking featu
6466
Slips is Python-based and relies on [Zeek network analysis framework](https://zeek.org/get-zeek/) for capturing live traffic and analyzing PCAPs. and relies on
6567
Redis >= 7.0.4 for interprocess communication.
6668

69+
---
6770

6871
# Usage
6972

@@ -102,6 +105,7 @@ cat output_dir/alerts.log
102105

103106
[For a detailed explanation of Slips parameters](https://stratospherelinuxips.readthedocs.io/en/develop/usage.html#slips-parameters)
104107

108+
---
105109

106110

107111
# Graphical User Interface
@@ -136,6 +140,7 @@ For more info about the Kalipso interface, check the docs: https://stratospherel
136140

137141
Slips requires Python 3.10.12 and at least 4 GBs of RAM to run smoothly.
138142

143+
---
139144

140145
# Installation
141146

@@ -169,6 +174,8 @@ Slips has a [config/slips.yaml](https://github.com/stratosphereips/StratosphereL
169174

170175
[More details about the config file options here]( https://stratospherelinuxips.readthedocs.io/en/develop/usage.html#modifying-the-configuration-file)
171176

177+
---
178+
172179
# Features
173180
Slips key features are:
174181

@@ -184,6 +191,7 @@ Slips key features are:
184191
* **Detailed Documentation**: Slips provides detailed documentation guiding users through usage instructions for efficient utilization of its features.
185192
* **Federated learning** Using the feel_project submodule. for more information [check the docs](https://github.com/stratosphereips/feel_project/blob/main/docs/Federated_Learning.md)
186193

194+
---
187195

188196
# Contributing
189197

@@ -203,32 +211,47 @@ Check [Slips in GSoC2023](https://github.com/stratosphereips/Google-Summer-of-Co
203211
You can [join our conversations in Discord](https://discord.gg/zu5HwMFy5C) for questions and discussions.
204212
We appreciate your contributions and thank you for helping to improve Slips!
205213

214+
---
206215

207216
# Documentation
208217
[User documentation](https://stratospherelinuxips.readthedocs.io/en/develop/)
209218

210219
[Code docs](https://stratospherelinuxips.readthedocs.io/en/develop/code_documentation.html )
211220

221+
---
222+
212223
# Troubleshooting
213224

214-
If you can't listen to an interface without sudo,
215-
you can run the following command to let any user use Zeek to listen to an interface not just root.
225+
If you can't listen to an interface without sudo, foe example when zeek is throwing the following error:
226+
```bash
227+
fatal error: problem with interface wlan0 (pcap_error: socket: Operation not permitted (pcap_activate))
228+
```
229+
230+
you can adjust zeek capabilities using the following command
216231

217232
```
218233
sudo setcap cap_net_raw,cap_net_admin=eip /<path-to-zeek-bin/zeek
219234
```
220235

236+
237+
---
238+
221239
You can [join our conversations in Discord](https://discord.gg/zu5HwMFy5C) for questions and discussions.
222240

223241
Or email us at
224242
225243
226244
227245

246+
---
247+
228248
# License
229249

230250
[GNU General Public License](https://github.com/stratosphereips/StratosphereLinuxIPS/blob/master/LICENCE)
231251

252+
---
253+
254+
232255
# Credits
233256

234257
Founder: [Sebastian Garcia](https://github.com/eldraco), [email protected], [email protected].
@@ -248,11 +271,16 @@ Contributors:
248271
* [Lukas Forst](https://github.com/LukasForst)
249272
* [Daniel Yang](https://github.com/danieltherealyang)
250273

274+
---
275+
276+
251277
# Changelog
252278

253279
https://github.com/stratosphereips/StratosphereLinuxIPS/blob/develop/CHANGELOG.md
254280

255281

282+
---
283+
256284
# Demos
257285
The following videos contain demos of Slips in action in various events:
258286

@@ -265,6 +293,7 @@ The following videos contain demos of Slips in action in various events:
265293
- 2019 OpenAlt, Fantastic Attacks and How Kalipso can Find Them [[video](https://www.youtube.com/watch?v=p2FL2sECpS0&t=1s)]
266294
- 2016 Ekoparty, Stratosphere IPS. The free machine learning malware detection [[video](https://www.youtube.com/watch?v=IazEdK8R4YI)]
267295

296+
---
268297

269298
# Funding
270299
We are grateful for the generous support and funding provided by the following organizations:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.7
1+
1.1.8

config/slips.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ Docker:
455455
#############################
456456
Profiling:
457457
# CPU profiling
458-
# enable cpu profiling [yes,no]
458+
# enable cpu profiling [true/false]
459+
# NOTE: the cpu profiler uses port 9001 to show the results.
459460
cpu_profiler_enable: false
460461

461462
# Available options are [dev,live]
@@ -466,25 +467,31 @@ Profiling:
466467
# time. it is accessible from web interface
467468
cpu_profiler_mode: dev
468469

469-
# profile all subprocesses in dev mode [yes,no].
470-
cpu_profiler_multiprocess: true
470+
# decides whether the profiler tracks all processes or only one.
471+
# only used in dev mode [true,false].
472+
cpu_profiler_multiprocess: false
471473

472474
# set number of tracer entries (dev mode only)
473-
cpu_profiler_dev_mode_entries: 1000000
475+
# VizTracer uses a circular buffer to store the entries.
476+
# When there are too many entries, it will only store the latest ones
477+
# so you know what happened recently.
478+
# the more the entries, the more RAM viztracer is going to use.
479+
# https://viztracer.readthedocs.io/en/latest/basic_usage.html#circular-buffer-size
480+
cpu_profiler_dev_mode_entries: 500000
474481

475482
# set maximum output lines (live mode only)
476483
cpu_profiler_output_limit: 20
477484

478485
# set the wait time between sampling sequences in seconds (live mode only)
479486
cpu_profiler_sampling_interval: 20
480487

481-
# enable memory profiling [yes,no]
488+
# enable memory profiling [true,false]
482489
memory_profiler_enable: false
483490

484491
# set profiling mode [dev,live]
485492
memory_profiler_mode: live
486493

487-
# profile all subprocesses [yes,no]
494+
# profile all subprocesses [true,false]
488495
memory_profiler_multiprocess: true
489496

490497
#############################

docker/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ ENV NVM_DIR=/root/.nvm
3030
SHELL ["/bin/bash", "-c"]
3131

3232

33-
# Install wget and add Zeek and redis repositories to our sources.
3433
RUN apt update && apt install -y --no-install-recommends \
3534
wget \
3635
ca-certificates \

docs/images/slips.gif

380 KB
Loading

docs/profiling_slips.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Use WASD to zoom in and move left/right.
8585
### CPU Profiler Live Mode
8686
#### Step 1
8787
Go to slips.yaml and make sure the settings are set correctly.
88-
```cpu_profiler_enable = yes```
88+
```cpu_profiler_enable = True```
8989
```cpu_profiler_mode = live```
9090

9191
You can also set maximum output lines (live mode only) to adjust profiler behavior.
@@ -112,15 +112,15 @@ If we print out the data getting sent to the “cpu_profile” redis channel, it
112112

113113
The memory profiler settings are much simpler.
114114
in slips.yaml, first, enable memory profiling
115-
```memory_profiler_enable = yes```
115+
```memory_profiler_enable = True```
116116

117117

118118
and set profiling mode:
119119

120120
```memory_profiler_mode = dev```
121121

122122
now, profile all subprocesses
123-
```memory_profiler_multiprocess = yes```
123+
```memory_profiler_multiprocess = True```
124124

125125
#### Step 2
126126

@@ -158,9 +158,9 @@ Under the table directory, the files are much simpler. They just show a table of
158158
Go to ```slips.yaml``` and use the following settings
159159

160160
```
161-
memory_profiler_enable = yes
162-
memory_profiler_mode = yes
163-
memory_profiler_multiprocess = yes
161+
memory_profiler_enable = True
162+
memory_profiler_mode = True
163+
memory_profiler_multiprocess = True
164164
```
165165

166166
### Step 2

install/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ watchdog==5.0.0
44
redis==5.2.1
55
urllib3==2.3.0
66
pandas==2.2.3
7-
tzlocal==5.3
7+
tzlocal==5.3.1
88
cabby==0.1.23
99
stix2==3.0.1
1010
certifi==2025.1.31
1111
tensorflow==2.16.1
1212
Keras
1313
validators==0.34.0
1414
ipwhois==1.2.0
15-
matplotlib==3.9.4
15+
matplotlib==3.10.1
1616
recommonmark==0.7.1
1717
scikit_learn
1818
slackclient==2.9.4
1919
psutil==7.0.0
2020
six==1.17.0
21-
pytest==8.3.2
21+
pytest==8.3.5
2222
pytest-mock==3.14.0
2323
pytest-xdist==3.6.1
2424
scipy==1.15.1
@@ -35,9 +35,9 @@ yappi==1.6.10
3535
pytest-sugar==1.0.0
3636
aid_hash
3737
black==24.10.0
38-
ruff==0.9.6
38+
ruff==0.11.2
3939
pre-commit==4.0.1
40-
coverage==7.6.12
40+
coverage==7.7.1
4141
pyyaml
4242
pytest-asyncio
4343
git+https://github.com/SECEF/python-idmefv2.git

managers/process_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,6 @@ def shutdown_gracefully(self):
721721
format_ = self.main.conf.export_labeled_flows_to().lower()
722722
self.main.db.export_labeled_flows(format_)
723723

724-
self.main.profilers_manager.cpu_profiler_release()
725-
self.main.profilers_manager.memory_profiler_release()
726-
727724
# if store_a_copy_of_zeek_files is set to yes in slips.yaml
728725
# copy the whole zeek_files dir to the output dir
729726
self.main.store_zeek_dir_copy()
@@ -740,6 +737,9 @@ def shutdown_gracefully(self):
740737
f"finished in {analysis_time:.2f} minutes"
741738
)
742739

740+
self.main.profilers_manager.cpu_profiler_release()
741+
self.main.profilers_manager.memory_profiler_release()
742+
743743
self.main.db.close()
744744
if graceful_shutdown:
745745
print(

managers/profilers_manager.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
import os
44
import subprocess
55
import sys
6+
from slips_files.common.style import green
67

78

89
class ProfilersManager:
910
def __init__(self, main):
1011
self.main = main
12+
self.args = self.main.args
1113
self.read_configurations()
1214

1315
def read_configurations(self):
@@ -50,28 +52,38 @@ def cpu_profiler_init(self):
5052
args = sys.argv
5153
if args[-1] != "--no-recurse":
5254
tracer_entries = str(self.cpu_profiler_dev_mode_entries)
55+
output_file = str(
56+
os.path.join(
57+
self.args.output,
58+
"cpu_profiling_result.json",
59+
)
60+
)
5361
viz_args = [
5462
"viztracer",
5563
"--tracer_entries",
5664
tracer_entries,
5765
"--max_stack_depth",
58-
"10",
66+
"5",
5967
"-o",
60-
str(
61-
os.path.join(
62-
self.args.output,
63-
"cpu_profiling_result.json",
64-
)
65-
),
68+
output_file,
69+
# viztracer takes -- as a separator between arguments
70+
# to viztracer and positional arguments to your script.
71+
"--",
6672
]
73+
# add slips args
6774
viz_args.extend(args)
75+
# add --no-recurse to avoid infinite recursion
6876
viz_args.append("--no-recurse")
6977
print(
70-
"Starting multiprocess profiling recursive subprocess"
78+
f"Starting multiprocess profiling recursive "
79+
f"subprocess using command: "
80+
f"{green(' '.join(viz_args))}"
7181
)
7282
subprocess.run(viz_args)
7383
exit(0)
7484
else:
85+
# reaching here means slips is now running using the vistracer
86+
# command
7587
self.cpu_profiler = CPUProfiler(
7688
db=self.main.db,
7789
output=self.args.output,

0 commit comments

Comments
 (0)