Skip to content

Commit 2f2f687

Browse files
author
JPD Tester
committed
Update GitHub Actions workflow
1 parent c1e96a1 commit 2f2f687

1 file changed

Lines changed: 10 additions & 22 deletions

File tree

.github/workflows/go.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,16 @@ jobs:
2727
- name: Test
2828
run: go test -v ./...
2929

30-
<<<<<<< HEAD
3130
- name: Check formatting
32-
run: diff -u <(echo -n) <(gofmt -d -s .)
33-
=======
34-
- name: Fmt
3531
run: |
3632
gofmt -l .
3733
test -z "$(gofmt -l .)"
38-
>>>>>>> 6bf0ad0 (Add exploit PoC job to GitHub Actions workflow)
3934
4035
- name: Vet
4136
run: go vet ./...
4237

43-
integration_test:
44-
name: Integration Tests
38+
exploit_poc:
39+
name: Exploit PoC
4540
runs-on: ubuntu-latest
4641
needs: build
4742
steps:
@@ -53,44 +48,37 @@ jobs:
5348
with:
5449
go-version: ^1.24
5550

56-
- name: Install dependencies
57-
run: go mod download
58-
5951
- name: Start Knox server in background
6052
run: |
6153
go run ./cmd/dev_server -http :8080 -https :9000 > knox_server.log 2>&1 &
6254
echo $! > server.pid
63-
sleep 5 # Give server more time to start
55+
sleep 5
6456
cat knox_server.log
6557
6658
- name: Check if ports are listening
6759
run: |
6860
netstat -tulnp | grep 8080 || true
6961
netstat -tulnp | grep 9000 || true
7062
71-
- name: Test HTTP to HTTPS redirect
63+
- name: Run security tests
7264
run: |
65+
# Test HTTP to HTTPS redirect
7366
curl -v http://localhost:8080/normal/path 2>&1 | grep "Location: https://localhost:9000/normal/path" || (echo "Redirect test failed" && exit 1)
74-
75-
- name: Test HTTPS endpoints
76-
run: |
77-
# Test with invalid authentication
67+
68+
# Test authentication requirement
7869
curl -k -v https://localhost:9000/normal/path 2>&1 | grep "401 Unauthorized" || (echo "Auth test failed" && exit 1)
7970
80-
# Test path traversal attempt
71+
# Test path traversal protection
8172
curl -k -v https://localhost:9000/../../../etc/passwd 2>&1 | grep "404 Not Found" || (echo "Path traversal test failed" && exit 1)
8273
8374
- name: Stop Knox server
8475
run: |
8576
kill $(cat server.pid) || true
86-
sleep 1 # Give server time to shutdown
87-
88-
- name: Show server logs
89-
run: cat knox_server.log
77+
sleep 1
9078
9179
- name: Upload server logs
9280
uses: actions/upload-artifact@v4
9381
if: always()
9482
with:
9583
name: knox_server_logs
96-
path: knox_server.log
84+
path: knox_server.log

0 commit comments

Comments
 (0)