Skip to content

Application Security Engine support #1

Application Security Engine support

Application Security Engine support #1

name: Waap Rules Tests
on:
pull_request:
branches: [ master ]
paths:
- 'waap-configs/**.yaml'
- 'waap-configs/**.yml'
- 'waap-rules/**.yaml'
- 'waap-rules/**.yml'
- '.github/workflows/test_waap_rules.yaml'
- '.waap-tests/**'
push:
branches: [ master ]
paths:
- 'waap-configs/**.yaml'
- 'waap-configs/**.yml'
- 'waap-rules/**.yaml'
- 'waap-rules/**.yml'
- '.github/workflows/test_waap_rules.yaml'
- '.waap-tests/**'
jobs:
run-hub-tests:
runs-on: ubuntu-20.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install CrowdSec
run: |
git clone https://github.com/crowdsecurity/crowdsec.git
cd crowdsec
git checkout -b "coraza_poc_acquis"
BUILD_STATIC=1 make release
cd crowdsec-v*
sudo ./wizard.sh --unattended
- name: Install NGINX
run: |
apt install nginx
- name: run tests on last crowdsec tag
run: |
cscli hubtest list --waap
#echo "SCENARIOS_COV=$(cscli hubtest coverage --scenarios --percent | cut -d '=' -f2)" >> $GITHUB_ENV
#SCENARIOS_COV_NUMBER=$(cscli hubtest coverage --scenarios --percent | cut -d '=' -f2 | tr -d '%' | tr -d '[[:space:]]')
#SCENARIO_BADGE_COLOR=$(if [ "$SCENARIOS_COV_NUMBER" -lt "70" ]; then echo 'red'; else echo 'green'; fi)" >> $GITHUB_ENV
- name: Create Scenarios badge
uses: schneegans/[email protected]
#if: ${{ github.ref == 'refs/heads/master' }}
if: false
with:
auth: ${{ secrets.GIST_BADGES_SECRET }}
gistID: ${{ secrets.GIST_BADGES_ID }}
filename: hub_scenarios_badge.json
label: Hub Scenarios
message: ${{ env.SCENARIOS_COV }}
color: ${{ env.SCENARIO_BADGE_COLOR }}