-
Notifications
You must be signed in to change notification settings - Fork 104
85 lines (83 loc) · 3.02 KB
/
pre-submit-test.yaml
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
name: Students Presubmit Tests
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
jobs:
TestIntegrityCheck:
runs-on: ubuntu-latest
if: ${{ startsWith(github.head_ref, 'networking_ex/') }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Check tests integrity
run: |
H=$(find projects/bash_networking_security/test/ -type f -exec md5sum {} + | awk '{print $1}' | sort | md5sum | awk '{print $1}')
echo "Your tests hash is $H"
if [ "$H" != "27c001c54ad7bd41bf4781f947914489" ]
then
echo "Test integrity failed. Make sure your PR has not changes the 'test' directory."
exit 1
fi
NetworkingExTestBastionRotation:
needs: [TestIntegrityCheck]
runs-on: ubuntu-latest
if: ${{ startsWith(github.head_ref, 'networking_ex/') }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
COURSE_STAFF_SSH_KEY: ${{ secrets.COURSE_STAFF_SSH_KEY }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: hashicorp/setup-terraform@v2
- name: Networking Ex - VPC Check
run: |
cd projects/bash_networking_security/test
bash test_vpc.sh
- name: Networking Ex - Basion Check
run: |
mkdir -p ~/.ssh
cp projects/bash_networking_security/test/ssh_config ~/.ssh/config
cd projects/bash_networking_security/test
bash test_bastion.sh
- name: Networking Ex - Keys Rotation Check
run: |
cd projects/bash_networking_security/test
bash test_rotation.sh
NetworkingExTestTLSHandshake:
needs: [ TestIntegrityCheck ]
runs-on: ubuntu-latest
if: ${{ startsWith(github.head_ref, 'networking_ex/') }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: hashicorp/setup-terraform@v2
- uses: actions/setup-python@v1
- uses: BSFishy/pip-action@v1
with:
packages: |
aiohttp
- run: |
cd projects/bash_networking_security/tls_webserver
- name: Networking Ex - TLS Hnadshake - Getting Eve certificate
run: |
cd projects/bash_networking_security
bash test/test_tls.sh eve
- name: Networking Ex - TLS Hnadshake - Bad client test message encryption
run: |
cd projects/bash_networking_security
bash test/test_tls.sh bad-msg
- name: Networking Ex - TLS Hnadshake - Full handshake process
run: |
cd projects/bash_networking_security
bash test/test_tls.sh