From 6b9ea5a1e6cf6b5b9a8932c0c31eedb6f88b82bd Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Thu, 8 Feb 2024 23:53:30 +0100 Subject: [PATCH 1/2] Add more steps: install built module and restart the server --- .github/security2.conf | 6 ++++++ .github/workflows/ci.yml | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/security2.conf diff --git a/.github/security2.conf b/.github/security2.conf new file mode 100644 index 0000000000..a503848acd --- /dev/null +++ b/.github/security2.conf @@ -0,0 +1,6 @@ +LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so + + + SecDataDir /var/cache/modsecurity + Include /etc/apache2/modsecurity.conf + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a47ebdfb77..8b18bfb78d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Dependencies run: | sudo apt-get update -y -qq - sudo apt-get install -y apache2-dev libxml2-dev liblua5.1-0-dev libcurl4-gnutls-dev libpcre2-dev pkg-config libyajl-dev + sudo apt-get install -y apache2-dev libxml2-dev liblua5.1-0-dev libcurl4-gnutls-dev libpcre2-dev pkg-config libyajl-dev apache2 apache2-bin apache2-data - uses: actions/checkout@v2 - name: autogen.sh run: ./autogen.sh @@ -29,3 +29,16 @@ jobs: - uses: ammaraskar/gcc-problem-matcher@master - name: make run: make -j `nproc` + - name: install module + run: sudo make install + - name: prepare config + run: | + sudo cp .github/security2.conf /etc/apache2/mods-enabled/ + sudo cp modsecurity.conf-recommended /etc/apache2/modsecurity.conf + sudo cp unicode.mapping /etc/apache2/ + sudo mkdir -p /var/cache/modsecurity + sudo chown -R www-data:www-data /var/cache/modsecurity + - name: start apache with module + run: | + sudo systemctl restart apache2.service + From 462bf7011ae82411b9ba5e69309fae4653578aef Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Wed, 21 Feb 2024 17:43:21 +0100 Subject: [PATCH 2/2] Add more test cases --- .github/workflows/ci.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b18bfb78d..e5ca97df84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,19 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - platform: [x64] - compiler: [gcc] + platform: [x32, x64] + compiler: [gcc, clang] configure: - - {label: "with pcre2", opt: "--with-pcre2" } - - {label: "with lua", opt: "--with-lua" } - - {label: "wo lua", opt: "--without-lua" } + - {label: "with pcre, no study, no jit", opt: "--enable-pcre-study=no" } + - {label: "with pcre, with study, no jit", opt: "--enable-pcre-study=yes" } + - {label: "with pcre, no study, with jit", opt: "--enable-pcre-study=no --enable-pcre-jit" } + - {label: "with pcre, with study, with jit", opt: "--enable-pcre-study=yes --enable-pcre-jit" } + - {label: "with pcre2", opt: "--with-pcre2 --enable-pcre-study=no" } + - {label: "with pcre2, with study, no jit", opt: "--with-pcre2 --enable-pcre-study=yes" } + - {label: "with pcre2, no study, with jit", opt: "--with-pcre2 --enable-pcre-study=no --enable-pcre-jit" } + - {label: "with pcre2, with study, with jit", opt: "--with-pcre2 --enable-pcre-study=yes --enable-pcre-jit" } + - {label: "with lua", opt: "--with-lua" } + - {label: "wo lua", opt: "--without-lua" } steps: - name: Setup Dependencies run: |