From 0ee1495b86b68339289fe8504cb82a59508fb565 Mon Sep 17 00:00:00 2001 From: fab Date: Tue, 7 Jan 2025 18:34:22 +0100 Subject: [PATCH] Create nginx.yml --- .github/workflows/nginx.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/nginx.yml diff --git a/.github/workflows/nginx.yml b/.github/workflows/nginx.yml new file mode 100644 index 0000000..71cd278 --- /dev/null +++ b/.github/workflows/nginx.yml @@ -0,0 +1,46 @@ +name: Test Nginx Configuration + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + test-nginx-config: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run OWASP scraper + run: python owasp.py + + - name: Convert OWASP rules to Nginx config + run: python owasp2nginx.py + + - name: Install Nginx + run: | + sudo apt-get update + sudo apt-get install -y nginx + + - name: Import Nginx config + run: python import2nginx.py + + - name: Validate Nginx configuration + run: | + nginx -t -c /etc/nginx/nginx.conf