2022-03-01 15:57:56 -05:00
|
|
|
name: "TLS protocol scan"
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
# The branches below must be a subset of the branches above
|
|
|
|
branches: [main]
|
|
|
|
|
2022-07-11 14:54:49 -05:00
|
|
|
permissions: read-all
|
|
|
|
|
2022-03-01 15:57:56 -05:00
|
|
|
jobs:
|
|
|
|
tls-check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [linux]
|
|
|
|
arch: [amd64]
|
|
|
|
name: TLS check
|
|
|
|
steps:
|
2022-07-13 16:15:33 -05:00
|
|
|
- uses: actions/checkout@v3
|
2023-03-22 14:33:21 -05:00
|
|
|
- uses: actions/setup-go@v4
|
2022-03-01 15:57:56 -05:00
|
|
|
with:
|
2023-03-22 14:33:21 -05:00
|
|
|
cache: false
|
2023-04-27 02:09:46 -05:00
|
|
|
go-version: 1.20.x
|
2022-03-01 15:57:56 -05:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y apache2-utils openssl
|
|
|
|
mkdir -p test/data
|
|
|
|
cd test/data
|
|
|
|
../scripts/gen_certs.sh
|
|
|
|
htpasswd -bBn test test123 > htpasswd
|
|
|
|
- name: Check for TLS settings
|
|
|
|
continue-on-error: true
|
|
|
|
run: |
|
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
make OS=$OS ARCH=$ARCH binary
|
|
|
|
bin/zot-$OS-$ARCH serve examples/config-tls.json &
|
|
|
|
sleep 5
|
|
|
|
curl -kv --tls-max 1.0 -0 https://localhost:8080/v2/
|
|
|
|
if [[ "$?" -eq 0 ]]; then echo "TLSv1.0 detected"; exit 1; fi
|
|
|
|
curl -kv --tls-max 1.1 -0 https://localhost:8080/v2/
|
|
|
|
if [[ "$?" -eq 0 ]]; then echo "TLSv1.1 detected"; exit 1; fi
|
|
|
|
curl -kv --tls-max 1.2 -0 https://localhost:8080/v2/
|
|
|
|
if [[ "$?" -ne 0 ]]; then echo "TLSv1.2 missing"; exit 1; fi
|
|
|
|
env:
|
|
|
|
OS: ${{ matrix.os }}
|
|
|
|
ARCH: ${{ matrix.arch }}
|