Skip to content

Commit

Permalink
Merge pull request #608 from stratosphereips/develop
Browse files Browse the repository at this point in the history
Slips v1.0.15
  • Loading branch information
AlyaGomaa committed Jun 14, 2024
2 parents 997865b + 6a6f646 commit fb4246d
Show file tree
Hide file tree
Showing 74 changed files with 5,621 additions and 4,348 deletions.
119 changes: 37 additions & 82 deletions .github/workflows/CI-production-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,140 +48,96 @@ jobs:
run: redis-server --daemonize yes

- name: Run unit tests
run: coverage run --source=./ -m pytest tests/ --ignore="tests/test_database.py" --ignore="tests/integration_tests" -n 7 -p no:warnings -vv -s
run: python3 -m pytest tests/ --ignore="tests/test_database.py" --ignore="tests/integration_tests" -n 7 -p no:warnings -vv -s


- name: Run database unit tests
run: |
coverage run --source=./ -m pytest tests/test_database.py -p no:warnings -vv
coverage report --include="slips_files/core/database/*"
coverage html --include="slips_files/core/database/*" -d coverage_reports/database
python3 -m pytest tests/test_database.py -p no:warnings -vv
- name: Flowalerts test
- name: Flowalerts Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_flowalerts.py -p no:warnings -vv
coverage report --include="modules/flowalerts/*"
coverage html --include="modules/flowalerts/*" -d coverage_reports/flowalerts
python3 -m pytest tests/test_flowalerts.py -p no:warnings -vv
- name: Whitelist test
- name: Whitelist Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_whitelist.py -p no:warnings -vv
coverage report --include="slips_files/core/helpers/whitelist.py*"
coverage html --include="slips_files/core/helpers/whitelist.py*" -d coverage_reports/whitelist
python3 -m pytest tests/test_whitelist.py -p no:warnings -vv
- name: arp test
- name: ARP Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_arp.py -p no:warnings -vv
coverage report --include="modules/arp/*"
coverage html --include="modules/arp/*" -d coverage_reports/arp
python3 -m pytest tests/test_arp.py -p no:warnings -vv
- name: blocking test
- name: Blocking Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_blocking.py -p no:warnings -vv
coverage report --include="modules/blocking/*"
coverage html --include="modules/blocking/*" -d coverage_reports/blocking
python3 -m pytest tests/test_blocking.py -p no:warnings -vv
- name: flowhandler test
- name: Flowhandler Unit Test
run: |
coverage run --source=./ -m pytest tests/test_flow_handler.py -p no:warnings -vv
coverage report --include="slips_files/core/helpers/flow_handler.py*"
coverage html --include="slips_files/core/helpers/flow_handler.py*" -d coverage_reports/flowhandler
python3 -m pytest tests/test_flow_handler.py -p no:warnings -vv
- name: horizontal_portscans test
- name: Horizontal Portscans Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_horizontal_portscans.py -p no:warnings -vv
coverage report --include="modules/network_discovery/horizontal_portscan.py*"
coverage html --include="modules/network_discovery/horizontal_portscan.py*" -d coverage_reports/horizontal_portscan
python3 -m pytest tests/test_horizontal_portscans.py -p no:warnings -vv
- name: http_analyzer test
- name: HTTP Analyzer Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_http_analyzer.py -p no:warnings -vv
coverage report --include="modules/http_analyzer/http_analyzer.py*"
coverage html --include="modules/http_analyzer/http_analyzer.py*" -d coverage_reports/http_analyzer
python3 -m pytest tests/test_http_analyzer.py -p no:warnings -vv
- name: vertical_portscans test
- name: Vertical Portscans Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_vertical_portscans.py -p no:warnings -vv
coverage report --include="modules/network_discovery/vertical_portscan.py*"
coverage html --include="modules/network_discovery/vertical_portscan.py*" -d coverage_reports/vertical_portscan
python3 -m pytest tests/test_vertical_portscans.py -p no:warnings -vv
- name: virustotal test
- name: Virustotal Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_virustotal.py -p no:warnings -vv
coverage report --include="modules/virustotal/virustotal.py*"
coverage html --include="modules/virustotal/virustotal.py*" -d coverage_reports/virustotal
python3 -m pytest tests/test_virustotal.py -p no:warnings -vv
- name: updatemanager test
- name: Update Manager Unit tests
run: |
coverage run --source=./ -m pytest tests/test_update_file_manager.py -p no:warnings -vv
coverage report --include="modules/update_manager/update_manager.py*"
coverage html --include="modules/update_manager/update_manager.py*" -d coverage_reports/updatemanager
python3 -m pytest tests/test_update_file_manager.py -p no:warnings -vv
- name: threatintelligence test
- name: Threat Intelligence Unit tests
run: |
coverage run --source=./ -m pytest tests/test_threat_intelligence.py -p no:warnings -vv
coverage report --include="modules/threat_intelligence/threat_intelligence.py*"
coverage html --include="modules/threat_intelligence/threat_intelligence.py*" -d coverage_reports/threat_intelligence
python3 -m pytest tests/test_threat_intelligence.py -p no:warnings -vv
- name: slipsutils test
- name: Slips Utils Unit tests
run: |
coverage run --source=./ -m pytest tests/test_slips_utils.py -p no:warnings -vv
coverage report --include="slips_files/common/slips_utils.py*"
coverage html --include="slips_files/common/slips_utils.py*" -d coverage_reports/slips_utils
python3 -m pytest tests/test_slips_utils.py -p no:warnings -vv
- name: slips test
- name: Slips.py Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_slips.py -p no:warnings -vv
coverage report --include="slips.py*"
coverage html --include="slips.py*" -d coverage_reports/slips
python3 -m pytest tests/test_slips.py -p no:warnings -vv
- name: profiler test
- name: Profiler Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_profiler.py -p no:warnings -vv
coverage report --include="slips_files/core/profiler.py*"
coverage html --include="slips_files/core/profiler.py*" -d coverage_reports/profiler
python3 -m pytest tests/test_profiler.py -p no:warnings -vv
- name: leak detector test
- name: Leak Detector Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_leak_detector.py -p no:warnings -vv
coverage report --include="modules/leak_detector/leak_detector.py*"
coverage html --include="modules/leak_detector/leak_detector.py*" -d coverage_reports/leak_detector
python3 -m pytest tests/test_leak_detector.py -p no:warnings -vv
- name: ipinfo test
- name: Ipinfo Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_ip_info.py -p no:warnings -vv
coverage report --include="modules/ip_info/ip_info.py*"
coverage html --include="modules/ip_info/ip_info.py*" -d coverage_reports/ip_info
python3 -m pytest tests/test_ip_info.py -p no:warnings -vv
- name: input test
- name: Input Unit Tests
run: |
coverage run --source=./ -m pytest tests/test_inputProc.py -p no:warnings -vv
coverage report --include="slips_files/core/input.py*"
coverage html --include="slips_files/core/input.py*" -d coverage_reports/input
python3 -m pytest tests/test_inputProc.py -p no:warnings -vv
- name: Clear redis cache
run: ./slips.py -cc

- name: Portscan tests
run: |
coverage run --source=./ -m pytest -s tests/integration_tests/test_portscans.py -p no:warnings -vv
coverage report --include="modules/network_discovery/*"
coverage html --include="modules/network_discovery/*" -d coverage_reports/network_discovery
python3 -m pytest -s tests/integration_tests/test_portscans.py -p no:warnings -vv
- name: Integration tests
run: |
python3 -m pytest -s tests/integration_tests/test_dataset.py -p no:warnings -vv
# coverage run --source=./ -m pytest -s tests/integration_tests/test_dataset.py -p no:warnings -vv
# coverage report --include="dataset/*"
# coverage html --include="dataset/*" -d coverage_reports/dataset
- name: Config file tests
run: |
python3 -m pytest -s tests/integration_tests/test_config_files.py -p no:warnings -vv
# coverage run --source=./ -m pytest -s tests/integration_tests/test_config_files.py -p no:warnings -vv
# coverage report --include="dataset/*"
# coverage html --include="dataset/*" -d coverage_reports/dataset
- name: Upload Artifact
# run this job whether the above jobs failed or passed
Expand All @@ -191,4 +147,3 @@ jobs:
name: test_slips_locally-integration-tests-output
path: |
output/integration_tests
coverage_reports/
26 changes: 23 additions & 3 deletions .github/workflows/CI-publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '!develop'

jobs:
# auto add release tag
# auto add release tag
create_tag:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -47,7 +47,25 @@ jobs:
root-reserve-mb: 512
swap-size-mb: 1024

- name: Get slips version
- name: Free some space
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf "/usr/local/share/boost"
rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Free disk space on Ubuntu runner
uses: kfir4444/free-disk-space@main
with:
# frees about 6 GB, warning: may remove required tools
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true

- name: Get Slips version
run: |
VER=$(curl -s https://raw.githubusercontent.com/stratosphereips/StratosphereLinuxIPS/develop/VERSION)
echo "SLIPS_VERSION=$VER" >> $GITHUB_ENV
Expand All @@ -60,6 +78,7 @@ jobs:
# Fetch all history for all tags and branches
fetch-depth: ''


- name: Login to DockerHub
uses: docker/login-action@v2
with:
Expand All @@ -78,8 +97,9 @@ jobs:
timeout-minutes: 15
uses: docker/build-push-action@v5
with:
debug: true
verbose-debug: true
no-cache: true
swap-size-gb: 20
context: ./
file: ${{ matrix.path }}
tags: stratosphereips/${{ matrix.image_name }}:latest, stratosphereips/${{ matrix.image_name }}:${{ env.SLIPS_VERSION }}
Expand Down
Loading

0 comments on commit fb4246d

Please sign in to comment.