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

Slips v1.0.13 #561

Merged
merged 151 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
03691c8
dockerfile. Add the recursive clone of p2p code
eldraco Mar 17, 2024
96434d1
requirements. Just reorder
eldraco Mar 17, 2024
fb67816
dockerfile. Add the recursive clone of p2p code
eldraco Mar 17, 2024
a57f0e2
requirements. Just reorder
eldraco Mar 17, 2024
0c91e74
Improve the requirements to fix p2p m1
eldraco Mar 18, 2024
31f6580
Merge branch 'm1-p2p-improve' of github.com:stratosphereips/Stratosph…
eldraco Mar 18, 2024
21719e8
Update to clone from master
eldraco Mar 18, 2024
8ce9f70
Merge pull request #488 from stratosphereips/m1-p2p-improve
eldraco Mar 18, 2024
92fed9e
idea_format: fix problem extracting attacker and victim's type
AlyaGomaa Mar 18, 2024
7be8339
Merge pull request #489 from stratosphereips/alya/fix_idea_format
AlyaGomaa Mar 18, 2024
30ccbd6
Updated usage.md
Sekhar-Kumar-Dash Mar 22, 2024
a1fcedb
Update config_parser.py added description for analysis_direction
Sekhar-Kumar-Dash Mar 22, 2024
39fbeec
CI-prod: no need to have a CI action for "test_slips_inside_docker" b…
AlyaGomaa Mar 22, 2024
b760ee9
ubuntu-image use COPY instead of git clone
AlyaGomaa Mar 22, 2024
d8c281d
init slips repo in the /Stratosphereips dir in docker
AlyaGomaa Mar 22, 2024
b34f189
init slips repo in the /StratosphereIPS dir in docker
AlyaGomaa Mar 22, 2024
3282ef9
fixed small typo in alert_handler.py
Sekhar-Kumar-Dash Mar 23, 2024
23bef46
Updated slips.conf
Sekhar-Kumar-Dash Mar 25, 2024
26eca20
Update direction description slips.conf
AlyaGomaa Mar 25, 2024
eca90c9
Merge pull request #491 from Sekhar-Kumar-Dash/master
AlyaGomaa Mar 25, 2024
9fba76e
Merge pull request #494 from Sekhar-Kumar-Dash/patch-1
AlyaGomaa Mar 25, 2024
20bb661
use the same docker dependencies in all images and compress the docke…
AlyaGomaa Mar 25, 2024
558473c
add pre-commit to requirements.txt
AlyaGomaa Mar 25, 2024
ebc3ed6
add detect-secrets pre-commit hook
AlyaGomaa Mar 25, 2024
5afb53c
contributing.md: add steps to install pre-hooks
AlyaGomaa Mar 25, 2024
87beb9d
p2p: delete unused imports
AlyaGomaa Mar 25, 2024
39f3585
Add pre-commit hooks for trailing whitespace, dockstring after code, …
AlyaGomaa Mar 26, 2024
de96cc0
add pre commit hook for double-quote-string-fixer
AlyaGomaa Mar 26, 2024
f1c8e6a
add a pre-hook to Analyze Python requirements for known security vuln…
AlyaGomaa Mar 26, 2024
346466b
run black on slips
AlyaGomaa Mar 26, 2024
1ca0d2f
run ruff on slips
AlyaGomaa Mar 26, 2024
d334cfa
remove python-safety-dependencies-check hook
AlyaGomaa Mar 26, 2024
2790e10
add black, ruff and pre-commit to requirements
AlyaGomaa Mar 26, 2024
6645325
add ruff as a pre-hook
AlyaGomaa Mar 26, 2024
72b2d8b
idea_format: fix problem extracting attacker and victim's type
AlyaGomaa Mar 18, 2024
1bc1c9f
Updated usage.md
Sekhar-Kumar-Dash Mar 22, 2024
be9a767
Update config_parser.py added description for analysis_direction
Sekhar-Kumar-Dash Mar 22, 2024
fada524
Updated slips.conf
Sekhar-Kumar-Dash Mar 25, 2024
392bb92
Update direction description slips.conf
AlyaGomaa Mar 25, 2024
6750c5d
fixed small typo in alert_handler.py
Sekhar-Kumar-Dash Mar 23, 2024
3a72987
run black on slips
AlyaGomaa Mar 26, 2024
6a39e51
added documentation to most/if not all helper functions
zeyadtmi Mar 26, 2024
3c94f94
CI-prod: no need to have a CI action for "test_slips_inside_docker" b…
AlyaGomaa Mar 22, 2024
eed17ca
ubuntu-image use COPY instead of git clone
AlyaGomaa Mar 22, 2024
da6a9fc
init slips repo in the /Stratosphereips dir in docker
AlyaGomaa Mar 22, 2024
dc6a8a9
init slips repo in the /StratosphereIPS dir in docker
AlyaGomaa Mar 22, 2024
763cb66
use the same docker dependencies in all images and compress the docke…
AlyaGomaa Mar 25, 2024
f196c42
add pre-commit to requirements.txt
AlyaGomaa Mar 25, 2024
b357761
add detect-secrets pre-commit hook
AlyaGomaa Mar 25, 2024
dda08e6
contributing.md: add steps to install pre-hooks
AlyaGomaa Mar 25, 2024
0f00a6f
p2p: delete unused imports
AlyaGomaa Mar 25, 2024
f705dd1
Add pre-commit hooks for trailing whitespace, dockstring after code, …
AlyaGomaa Mar 26, 2024
2b9e6f1
add pre commit hook for double-quote-string-fixer
AlyaGomaa Mar 26, 2024
07c00e6
add a pre-hook to Analyze Python requirements for known security vuln…
AlyaGomaa Mar 26, 2024
c62b369
run black on slips
AlyaGomaa Mar 26, 2024
7abf94f
run ruff on slips
AlyaGomaa Mar 26, 2024
d835f22
remove python-safety-dependencies-check hook
AlyaGomaa Mar 26, 2024
0389705
add black, ruff and pre-commit to requirements
AlyaGomaa Mar 26, 2024
f3fb456
add ruff as a pre-hook
AlyaGomaa Mar 26, 2024
a3f78a1
run black on slips
AlyaGomaa Mar 26, 2024
8d9a79d
Merge remote-tracking branch 'origin/alya/use-black_and_pycheck' into…
AlyaGomaa Mar 26, 2024
6ab4507
disable automatic formatting of imports.py
AlyaGomaa Mar 26, 2024
088104a
dont use ruff's own formatter, use black's
AlyaGomaa Mar 26, 2024
e38ec94
don't import * from common imports file
AlyaGomaa Mar 26, 2024
168bcdc
Merge pull request #496 from stratosphereips/alya/use-black_and_pycheck
AlyaGomaa Mar 27, 2024
9aaa055
.pre-commit-config.yaml: remove double-quote-string-fixer
AlyaGomaa Mar 27, 2024
f96b505
Merge remote-tracking branch 'origin/alya/improve-ci' into alya/impro…
AlyaGomaa Mar 27, 2024
d6fea3f
Merge branch 'develop' into zeyad-threat-intel-doc
zeyadtmi Mar 27, 2024
f0c67b7
added documentation to detection modules md
zeyadtmi Mar 27, 2024
f3f995e
added documentation to detection modules md
zeyadtmi Mar 27, 2024
23c3ca0
added documentation to detection modules md
zeyadtmi Mar 27, 2024
5e58851
added documentation to detection modules md
zeyadtmi Mar 27, 2024
1acddb4
indentation error fixed
zeyadtmi Mar 28, 2024
be98435
refactoring should update local ti hash
zeyadtmi Mar 28, 2024
37b8351
Update README.md
eldraco Mar 30, 2024
c114225
Updated test_horizontal_portscans.py
Sekhar-Kumar-Dash Apr 2, 2024
6f834f6
whitelist.py: refactor
AlyaGomaa Apr 2, 2024
67facb0
whitelist.py: split is_part_of_a_whitelisted_org() into smaller funct…
AlyaGomaa Apr 2, 2024
55a2a51
set_evidence: add a victim field to more evidence
AlyaGomaa Apr 2, 2024
a96f77a
whitelist.py: refactor _is_domain_whitelisted()
AlyaGomaa Apr 2, 2024
3668030
whitelist.py: whitelist alerts to all orgs by default
AlyaGomaa Apr 2, 2024
c73374d
whitelist.py: use tldextract to extract tlds and hostnames
AlyaGomaa Apr 2, 2024
4cc87c0
for each domain entry in whitelist.conf whitelist the dubdomain and t…
AlyaGomaa Apr 2, 2024
5f20853
dependency_image: fix the requirements.txt path
AlyaGomaa Apr 3, 2024
9aaf5d2
added ja3 and jarm file parsing
zeyadtmi Apr 4, 2024
96c6b4f
change the default slips threshold
AlyaGomaa Apr 4, 2024
cca18f7
remove failing integration tests
AlyaGomaa Apr 4, 2024
f1e8599
Merge pull request #509 from stratosphereips/alya/fix_whitelists_evid…
AlyaGomaa Apr 5, 2024
6d23f2e
change the default slips threshold
AlyaGomaa Apr 4, 2024
d8b9f5b
Merge remote-tracking branch 'origin/alya/use-the-new-slips-threshold…
AlyaGomaa Apr 5, 2024
43db47f
Merge remote-tracking branch 'origin/alya/improve-ci' into alya/impro…
AlyaGomaa Apr 5, 2024
02b2379
Merge pull request #517 from stratosphereips/alya/use-the-new-slips-t…
AlyaGomaa Apr 5, 2024
409da0a
Updated test_horizontal_portscans.py
Sekhar-Kumar-Dash Apr 2, 2024
16eacfc
Merge remote-tracking branch 'Sekhar-Kumar-Dash/patch-2' into fork/pa…
AlyaGomaa Apr 5, 2024
edae323
horizontal_portscan.py: handle empty dport values passed to get_cache…
AlyaGomaa Apr 5, 2024
4344a26
test_horizontal_portscans.py: remove duplicates
AlyaGomaa Apr 5, 2024
42728b5
test_horizontal_portscans.py: replace set() call with a set
AlyaGomaa Apr 5, 2024
90db6a1
test_horizontal_portscans.py: replace set() call with a set
AlyaGomaa Apr 5, 2024
3d3896a
Merge remote-tracking branch 'origin/alya/improve-ci' into alya/impro…
AlyaGomaa Apr 5, 2024
4f2521b
Merge pull request #507 from Sekhar-Kumar-Dash/patch-2
AlyaGomaa Apr 5, 2024
e3d7cf4
exporting_alerts.py: when there's no slack bot token log it with debu…
AlyaGomaa Apr 5, 2024
ce9dbfc
add files with API keys/tokens to .dockerignore
AlyaGomaa Apr 5, 2024
de0e6e2
add a test workflow for testing publishing p2p and ubuntu image using CI
AlyaGomaa Apr 5, 2024
309aa0d
dont install black library in docker because of its dependency confli…
AlyaGomaa Apr 5, 2024
dafa68b
test-publishing: clone slips with submodules in order for the dockerf…
AlyaGomaa Apr 5, 2024
ef5d48c
Merge remote-tracking branch 'origin/develop' into fork/zeyad-test-th…
AlyaGomaa Apr 8, 2024
5aafa6f
Merge pull request #514 from zeyadtmi/zeyad-test-threat-intel
AlyaGomaa Apr 8, 2024
6438295
dataset: dont ignore logfiles in the dataset/ dir
AlyaGomaa Apr 8, 2024
d6c9e5b
require the steps followed to test the PR in pull_request_template.md
AlyaGomaa Apr 9, 2024
c50ab94
delete test-publishing.yml
AlyaGomaa Apr 9, 2024
1a1613e
exporting_alerts.py: when there's no slack bot token log it with debu…
AlyaGomaa Apr 5, 2024
55c9183
add files with API keys/tokens to .dockerignore
AlyaGomaa Apr 5, 2024
45fb5ec
add a test workflow for testing publishing p2p and ubuntu image using CI
AlyaGomaa Apr 5, 2024
bf5aa6e
dont install black library in docker because of its dependency confli…
AlyaGomaa Apr 5, 2024
61791aa
test-publishing: clone slips with submodules in order for the dockerf…
AlyaGomaa Apr 5, 2024
21d2c0d
dataset: dont ignore logfiles in the dataset/ dir
AlyaGomaa Apr 8, 2024
c643463
delete test-publishing.yml
AlyaGomaa Apr 9, 2024
de97f2d
Merge remote-tracking branch 'origin/alya/improve-ci' into alya/impro…
AlyaGomaa Apr 9, 2024
adbb394
Merge pull request #556 from stratosphereips/alya/improve-ci
AlyaGomaa Apr 10, 2024
72e69e1
daemon: use Locks to determine if another instance of the daemon is r…
AlyaGomaa Apr 15, 2024
9d2a374
daemon: don't call shotdown_gracefully on stop(), instead, signal the…
AlyaGomaa Apr 15, 2024
5f1e619
process_manager.py: explain what populates self.processes and why the…
AlyaGomaa Apr 15, 2024
139b21f
process_manager.py: add a function to check which print to use, the d…
AlyaGomaa Apr 15, 2024
25cbe6f
slips: better handling of different error msgs returned by the daemon
AlyaGomaa Apr 15, 2024
8d1758b
daemon: use Locks to determine if another instance of the daemon is r…
AlyaGomaa Apr 15, 2024
f8188ae
daemon: don't call shotdown_gracefully on stop(), instead, signal the…
AlyaGomaa Apr 15, 2024
cd3c987
process_manager.py: explain what populates self.processes and why the…
AlyaGomaa Apr 15, 2024
badf10b
process_manager.py: add a function to check which print to use, the d…
AlyaGomaa Apr 15, 2024
9ff06ce
slips: better handling of different error msgs returned by the daemon
AlyaGomaa Apr 15, 2024
d5b2102
Merge remote-tracking branch 'origin/alya/fix_stopping_daemon' into a…
AlyaGomaa Apr 15, 2024
fc45754
Merge pull request #559 from stratosphereips/alya/fix_stopping_daemon
AlyaGomaa Apr 15, 2024
02319df
whitelist: early return from is_part_of_a_whitelisted_org() if given …
AlyaGomaa Apr 16, 2024
73953b8
whitelist: convert all ASNs shipped with slips to uppercase
AlyaGomaa Apr 16, 2024
f5d1cb0
whitelist: convert asns to uppercase before comparing with the asns …
AlyaGomaa Apr 16, 2024
5836c72
whitelist: dont whitelist domain if it has a whitelisted organization…
AlyaGomaa Apr 16, 2024
d82e288
whitelist: put the most famous domain/sld of each org at the top of t…
AlyaGomaa Apr 16, 2024
fcc2d9d
threat_intelligence.py: add a Victim field to "Blacklisted IP" evidence
AlyaGomaa Apr 16, 2024
d37930e
threat_intelligence.py: split long lines
AlyaGomaa Apr 16, 2024
7a6138c
threat_intelligence.py: add victim fields to most evidence
AlyaGomaa Apr 16, 2024
3d69ac4
CC: add victim fields to CC evidence
AlyaGomaa Apr 16, 2024
3653026
whitelist.conf: whitelist microsoft alerts by default
AlyaGomaa Apr 16, 2024
c6630b7
threat_intelligence.py: add a victim field to "blacklisted CNAME" evi…
AlyaGomaa Apr 16, 2024
0dbb23d
Ti feeds: remove smaphaus edrop.txt TI feed as its been merged to spa…
AlyaGomaa Apr 16, 2024
ba43ae6
update changelog
AlyaGomaa Apr 16, 2024
476aa14
Bump slips version to 1.0.13
AlyaGomaa Apr 16, 2024
2cc8987
Integration test: add an incompatible CN flow while connecting to a s…
AlyaGomaa Apr 16, 2024
672e28c
Merge pull request #560 from stratosphereips/alya/fix-whitelists
AlyaGomaa Apr 16, 2024
d278751
update macos requirements.txt with install/requirements.txt
AlyaGomaa Apr 16, 2024
5609537
update slips.gif
AlyaGomaa Apr 16, 2024
c5be72a
CI-production-testing.yml: don't install black as it has conflicts wi…
AlyaGomaa Apr 16, 2024
fed7ce1
CI-production-testing.yml: fix "installing Python dependencies" commands
AlyaGomaa Apr 16, 2024
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
30 changes: 14 additions & 16 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# slips generated alerts
output/alerts.log
output/alerts.json
2021-*/
2022-*/
# Ignore all .log files in output/ dir
output/*.log
**/alerts.json
**/.git

#node modules
**/node_modules

# zeek log files
zeek_files/*.log

yara-python/*
# files with API keys/tokens
config/slack_bot_token_secret
config/warden.conf
config/RiskIQ_credentials


Datasett/
Dataset/

# virtual env files
ENV/*
env/*

# compiled yara rules
modules/leak_detector/yara_rules/compiled/

# api keys
modules/RiskIQ/api_key_secret
modules/virustotal/api_key_secret

.git/
.cache/
Expand All @@ -30,16 +32,12 @@ __pycache__/

# CESNET module logs
*.log
modules/CESNET/*.log

# redis backups
redis_backups/*.rdb
**/*.rdb

# for IntelliJ IDE
.idea/

# for vscode
.vscode/



11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
[ ] - Not correct; marked as **not** done
-->


## Steps you followed to test the changes purposed in this PR:


*
*



## Check List (Check all the applicable boxes) <!-- Follow the above conventions to check the box -->

- [ ] My code follows the code style of this project.
Expand All @@ -31,6 +40,8 @@

<!-- Add all the screenshots which support your changes -->

<!-- Add screenshots with the passing unit and integration tests locally -->

## Note to reviewers

<!-- Add notes to reviewers if applicable -->
104 changes: 3 additions & 101 deletions .github/workflows/CI-production-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:

test_slips_locally:
unit_and_integration_tests:
# runs the tests on a GH VM
runs-on: ubuntu-20.04
# 2 hours timeout
Expand Down Expand Up @@ -39,9 +39,9 @@ jobs:
python-version: "3.8"

- name: Install Python dependencies
run:
run: |
python -m pip install --upgrade pip
pip install -r install/requirements.txt
grep -v 'black' install/requirements.txt | xargs pip3 install --no-cache-dir

- name: Start redis server
run: redis-server --daemonize yes
Expand Down Expand Up @@ -73,101 +73,3 @@ jobs:
name: test_slips_locally-integration-tests-output
path: |
output/integration_tests

test_slips_in_docker:
# runs the tests in a docker(built by this job) on stop of a GH VM
runs-on: ubuntu-20.04
# 2 hours timeout
timeout-minutes: 7200

strategy:
matrix:
include:
- type: ubuntu-image
name: ubuntu-image
image_name: slips
path: ./docker/ubuntu-image/Dockerfile
#
# #TODO our unit tests dont support macos yet
# - type: macosm1-image
# name: macosm1-image
# image_name: slips_macos_m1
# path: ./docker/macosm1-image/Dockerfile

steps:
# clone slips and checkout branch
# By default it checks out only one commit
- uses: actions/checkout@v3
with:
ref: 'develop'

# build slips from target dockerfile, but don't push
- name: Build our ${{ matrix.name }} from dockerfile
id: docker_build_slips
uses: docker/build-push-action@v2
with:
context: ./
file: ${{ matrix.path }}
tags: stratosphereips/${{ matrix.image_name }}:latest
push: false


# use the built image to run unit tests inside docker
# we ignore the blocking module unit tests because we cannot run
# docker with -cap-add=NET_ADMIN and use iptables in GH actions
- name: Run unit tests inside docker
uses: addnab/docker-run-action@v3
with:
image: stratosphereips/slips:latest
run: |
git reset --hard
git pull & git checkout -f origin/develop
redis-server --daemonize yes
python3 -m pytest tests/ --ignore="tests/test_database.py" --ignore="tests/integration_tests" -n 7 -p no:warnings -vv -s

- name: Run database tests inside docker
uses: addnab/docker-run-action@v3
with:
image: stratosphereips/slips:latest
run: |
git reset --hard
git pull & git checkout -f origin/develop
redis-server --daemonize yes
python3 -m pytest tests/test_database.py -p no:warnings -vv



- name: Run integration tests inside docker
uses: addnab/docker-run-action@v3
with:
image: stratosphereips/slips:latest
# mount the host's output/ dir to docker's output/ dir, the goal is to access integration
# tests output in docker from the host to upload it later
options: -v ${{ github.workspace }}/output:/StratosphereLinuxIPS/output
run: |
git reset --hard
git pull & git checkout -f origin/develop
redis-server --daemonize yes
python3 -m pytest -s tests/integration_tests/test_dataset.py -p no:warnings -vv

- name: Run config file integration tests inside docker
uses: addnab/docker-run-action@v3
with:
image: stratosphereips/slips:latest
# mount the host's output/ dir to docker's output/ dir, the goal is to access integration
# tests output in docker from the host to upload it later
options: -v ${{ github.workspace }}/output:/StratosphereLinuxIPS/output
run: |
git reset --hard
git pull & git checkout -f origin/develop
redis-server --daemonize yes
python3 -m pytest -s tests/integration_tests/test_config_files.py -p no:warnings -vv

- name: Upload Artifact
# run this job whether the above jobs failed or passed
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test_slips_in_docker-integration-tests-output
path: |
${{ github.workspace }}/output/integration_tests
47 changes: 47 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: .*dataset/.*|
(?x)(
^config/local_ti_files/own_malicious_JA3.csv$|
.*test.* |
.*\.md$
)

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-docstring-first
- id: check-merge-conflict
- id: end-of-file-fixer
- id: detect-private-key
exclude: .*dataset/.*|
(?x)(
^config/$|
.*test.* |
.*\.md$
)

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.4
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# excludes formatting slips_files/common/imports.py
exclude: imports

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
args: ['--line-length' , '79']
language_version: python3.8
# excludes formatting slips_files/common/imports.py
exclude: imports
Loading
Loading