Skip to content

Commit

Permalink
chore: upgrades to CRS 4.0.0-rc2 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcchavezs authored Oct 24, 2023
1 parent 7bdcbcf commit e0c6f83
Show file tree
Hide file tree
Showing 61 changed files with 4,516 additions and 1,521 deletions.
10 changes: 8 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import (
"bufio"
"bytes"
"fmt"
"github.com/magefile/mage/sh"
"io"
"net/http"
"os"
"path/filepath"
"strings"

"github.com/magefile/mage/sh"
)

func DownloadCRS() error {
Expand All @@ -35,6 +36,11 @@ func DownloadCRS() error {
return err
}
defer res.Body.Close()

if res.StatusCode != http.StatusOK {
return fmt.Errorf("unexpected status code: %d", res.StatusCode)
}

crsZip, err := io.ReadAll(res.Body)
if err != nil {
return err
Expand Down Expand Up @@ -102,7 +108,7 @@ func DownloadCRS() error {

source, err := f.Open()
if err != nil {
defer os.Remove(fPath)
os.Remove(fPath)
return err
}

Expand Down
4 changes: 2 additions & 2 deletions rules/@crs-setup.conf.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ------------------------------------------------------------------------
# OWASP ModSecurity Core Rule Set ver.4.0.0-rc1
# OWASP ModSecurity Core Rule Set ver.4.0.0-rc2
# Copyright (c) 2006-2020 Trustwave and contributors. All rights reserved.
# Copyright (c) 2021-2022 Core Rule Set project. All rights reserved.
# Copyright (c) 2021-2023 Core Rule Set project. All rights reserved.
#
# The OWASP ModSecurity Core Rule Set is distributed under
# Apache Software License (ASL) version 2
Expand Down
64 changes: 32 additions & 32 deletions rules/@owasp_crs/REQUEST-901-INITIALIZATION.conf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions rules/@owasp_crs/REQUEST-905-COMMON-EXCEPTIONS.conf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rules/@owasp_crs/REQUEST-911-METHOD-ENFORCEMENT.conf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rules/@owasp_crs/REQUEST-913-SCANNER-DETECTION.conf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e0c6f83

Please sign in to comment.