From 0d92cd36c6b2fdd1a2f84d82ba215b8ac53e1406 Mon Sep 17 00:00:00 2001 From: fab Date: Fri, 17 Jan 2025 12:04:59 +0100 Subject: [PATCH] Update test_docker.yml --- .github/workflows/test_docker.yml | 85 ------------------------------- 1 file changed, 85 deletions(-) diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index ee3fc5d..4f19a6a 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -155,91 +155,6 @@ jobs: # echo "Checking HAProxy container logs..." # sudo docker logs haproxy-waf - - name: Validate Traefik configuration - run: | - echo "Validating Traefik configuration..." - for file in waf_patterns/traefik/*.toml; do - echo "Validating $file..." - sudo docker run --rm -v $(pwd)/waf_patterns/traefik:/etc/traefik:ro traefik traefik validate --configFile=/etc/traefik/$(basename "$file") - if [ $? -ne 0 ]; then - echo "Error: Validation failed for $file" - exit 1 - fi - done - - - name: Start Traefik container with WAF rules - run: | - echo "Starting Traefik container..." - sudo docker run -d \ - --name traefik-waf \ - -p ${{ env.TRAEFIK_PORT }}:80 \ - -v $(pwd)/waf_patterns/traefik:/etc/traefik \ - traefik:latest - echo "Traefik is running on port ${{ env.TRAEFIK_PORT }}." - - - name: Check Traefik container logs - run: | - echo "Checking Traefik container logs..." - sudo docker logs traefik-waf - - - name: Validate services are running - run: | - echo "Validating services are running..." - # Check if Nginx is running - if ! curl -s http://localhost:${{ env.NGINX_PORT }} > /dev/null; then - echo "Error: Nginx is not running!" - sudo docker logs nginx-waf - exit 1 - fi - echo "Nginx is running successfully." - - # Check if Apache is running - if ! curl -s http://localhost:${{ env.APACHE_PORT }} > /dev/null; then - echo "Error: Apache is not running!" - sudo docker logs apache-waf - exit 1 - fi - echo "Apache is running successfully." - - # Check if HAProxy is running - if ! curl -s http://localhost:${{ env.HAPROXY_PORT }} > /dev/null; then - echo "Error: HAProxy is not running!" - sudo docker logs haproxy-waf - exit 1 - fi - echo "HAProxy is running successfully." - - # Check if Traefik is running - if ! curl -s http://localhost:${{ env.TRAEFIK_PORT }} > /dev/null; then - echo "Error: Traefik is not running!" - sudo docker logs traefik-waf - exit 1 - fi - echo "Traefik is running successfully." - - - name: Test WAF rules - run: | - echo "Testing WAF rules..." - # Test Nginx WAF rules - echo "Testing Nginx rules..." - curl -s http://localhost:${{ env.NGINX_PORT }}/attack - curl -s http://localhost:${{ env.NGINX_PORT }}/bots - - # Test Apache WAF rules - echo "Testing Apache rules..." - curl -s http://localhost:${{ env.APACHE_PORT }}/attack - curl -s http://localhost:${{ env.APACHE_PORT }}/bots - - # Test HAProxy WAF rules - echo "Testing HAProxy rules..." - curl -s http://localhost:${{ env.HAPROXY_PORT }}/attack - curl -s http://localhost:${{ env.HAPROXY_PORT }}/bots - - # Test Traefik WAF rules - echo "Testing Traefik rules..." - curl -s http://localhost:${{ env.TRAEFIK_PORT }}/attack - curl -s http://localhost:${{ env.TRAEFIK_PORT }}/bots - - name: Clean up containers if: always() run: |