-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (72 loc) · 2.17 KB
/
Copy pathci.yml
File metadata and controls
93 lines (72 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y nmap nikto
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
python test_scanner.py
- name: Test scanner functionality
run: |
python main.py httpbin.org --scan-types web --timeout 10 --no-save
- name: Test Docker build
run: |
docker build -t vulnscanner .
- name: Test Docker run
run: |
docker run --rm vulnscanner python main.py httpbin.org --scan-types web --timeout 10 --no-save
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install bandit safety
- name: Run security checks
run: |
bandit -r . -f json -o bandit-report.json || true
safety check --json --output safety-report.json || true
- name: Upload security reports
uses: actions/upload-artifact@v3
with:
name: security-reports
path: |
bandit-report.json
safety-report.json
docker:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image
run: |
docker build -t vulnscanner:latest .
- name: Test Docker image
run: |
docker run --rm vulnscanner:latest python main.py httpbin.org --scan-types web --timeout 10 --no-save