Skip to content

Commit a655a48

Browse files
authored
Upgraded mod_security to version 2.9.7 (microsoft#11802)
1 parent a7c62e9 commit a655a48

File tree

4 files changed

+106
-15
lines changed

4 files changed

+106
-15
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From b2fa083522c70368c7ab911696dcb87dde5dc688 Mon Sep 17 00:00:00 2001
2+
From: Tomas Korbar <[email protected]>
3+
Date: Thu, 22 Dec 2022 14:49:34 +0100
4+
Subject: [PATCH] Clear original response code in send_error_bucket function
5+
6+
If this is left intact, then apache thinks that this code
7+
was generated during processing of ErrorDocument and does not
8+
handle it properly
9+
10+
Fix #2849
11+
---
12+
apache2/apache2_util.c | 5 +++++
13+
1 file changed, 5 insertions(+)
14+
15+
diff --git a/apache2/apache2_util.c b/apache2/apache2_util.c
16+
index cdae2b580..520a30f2f 100644
17+
--- a/apache2/apache2_util.c
18+
+++ b/apache2/apache2_util.c
19+
@@ -31,6 +31,11 @@ apr_status_t send_error_bucket(modsec_rec *msr, ap_filter_t *f, int status) {
20+
/* Set the status line explicitly for the error document */
21+
f->r->status_line = ap_get_status_line(status);
22+
23+
+ /* Clear previously set response code to make clear that this is
24+
+ * not a recursive error
25+
+ */
26+
+ f->r->status = 200;
27+
+
28+
brigade = apr_brigade_create(f->r->pool, f->r->connection->bucket_alloc);
29+
if (brigade == NULL) return APR_EGENERAL;
30+

SPECS-EXTENDED/mod_security/mod_security.signatures.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Signatures": {
33
"10-mod_security.conf": "01a1e5ed3357a2de6b9dbd0f6b02cde2d92ebf0fcb6d6adcfa2b064c7fcdf0a0",
44
"mod_security.conf": "c945d2d940121ee8eaa8a29c5b1eabdcc589d46644a152e9d809fb3340a1e368",
5-
"modsecurity-2.9.4.tar.gz": "970e1801907d181e94faec74d595868a3b4abeb07b790b0f30aea3a5d0e05929",
5+
"modsecurity-2.9.7.tar.gz": "2a28fcfccfef21581486f98d8d5fe0397499749b8380f60ec7bb1c08478e1839",
66
"modsecurity_localrules.conf": "9aa9e822f13552d5159ab5543d92551d1200a3ae52870907f1b0dafcf0c67c22"
77
}
88
}

SPECS-EXTENDED/mod_security/mod_security.spec

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Distribution: Azure Linux
1111

1212
Summary: Security module for the Apache HTTP Server
1313
Name: mod_security
14-
Version: 2.9.4
15-
Release: 1%{?dist}
16-
License: ASL 2.0
14+
Version: 2.9.7
15+
Release: 8%{?dist}
16+
License: Apache-2.0
1717
URL: http://www.modsecurity.org/
1818
Source: https://github.com/SpiderLabs/ModSecurity/releases/download/v%{version}/modsecurity-%{version}.tar.gz
1919
Source1: mod_security.conf
@@ -22,15 +22,17 @@ Source3: modsecurity_localrules.conf
2222
Patch0: modsecurity-2.9.3-lua-54.patch
2323
Patch1: modsecurity-2.9.3-apulibs.patch
2424
Patch2: mod_security-2.9.3-remote-rules-timeout.patch
25+
Patch3: mod_security-2.9.7-send_error_bucket.patch
2526

26-
Requires: httpd httpd-mmn = %{_httpd_mmn}
27+
Requires: httpd
28+
Provides: httpd-mmn = %{_httpd_mmn}
2729
Requires(pre): httpd-filesystem
2830

2931
BuildRequires: gcc, make, autoconf, automake, libtool
3032
BuildRequires: httpd-devel
3133
BuildRequires: perl-generators
34+
BuildRequires: pcre2-devel
3235
BuildRequires: pkgconfig(libcurl)
33-
BuildRequires: pkgconfig(libpcre)
3436
BuildRequires: pkgconfig(libxml-2.0)
3537
BuildRequires: pkgconfig(lua)
3638

@@ -66,6 +68,7 @@ This package contains the ModSecurity Audit Log Collector.
6668
--enable-pcre-match-limit-recursion=1000000 \
6769
--with-apxs=%{_httpd_apxs} \
6870
--with-yajl \
71+
--with-pcre2 \
6972
--disable-static
7073

7174
# remove rpath
@@ -116,8 +119,8 @@ install -m0644 mlogc/mlogc-default.conf %{buildroot}%{_sysconfdir}/mlogc.conf
116119

117120

118121
%files
119-
%license LICENSE
120-
%doc CHANGES README.* NOTICE
122+
%license LICENSE NOTICE
123+
%doc CHANGES README.*
121124
%{_httpd_moddir}/mod_security2.so
122125
%config(noreplace) %{_httpd_confdir}/*.conf
123126
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
@@ -140,12 +143,70 @@ install -m0644 mlogc/mlogc-default.conf %{buildroot}%{_sysconfdir}/mlogc.conf
140143
%endif
141144

142145
%changelog
143-
* Fri Mar 04 2022 Pawel Winogrodzki <[email protected]> - 2.9.4-1
144-
- Updating to version 2.9.4 using Fedora 36 spec (license: MIT) for guidance.
145-
- License verified.
146+
* Mon Jan 06 2025 Aninda Pradhan <[email protected]> - 2.9.7-8
147+
- Initial Azure Linux import from Fedora 41 (license: MIT)
148+
- License verified
146149

147-
* Fri Oct 15 2021 Pawel Winogrodzki <[email protected]> - 2.9.3-5
148-
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
150+
* Thu Jul 18 2024 Fedora Release Engineering <[email protected]> - 2.9.7-7
151+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
152+
153+
* Thu Jan 25 2024 Fedora Release Engineering <[email protected]> - 2.9.7-6
154+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
155+
156+
* Sun Jan 21 2024 Fedora Release Engineering <[email protected]> - 2.9.7-5
157+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
158+
159+
* Tue Jan 02 2024 Tomas Korbar <[email protected]> - 2.9.7-4
160+
- Clear original response code in send_error_bucket function
161+
162+
* Thu Jul 20 2023 Fedora Release Engineering <[email protected]> - 2.9.7-3
163+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
164+
165+
* Fri Jun 02 2023 Luboš Uhliarik <[email protected]> - 2.9.7-2
166+
- SPDX migration
167+
168+
* Thu Apr 13 2023 Luboš Uhliarik <[email protected]> - 2.9.7-1
169+
- new version 2.9.7
170+
- use pcre2 instead of deprecated pcre (rhbz #2128330)
171+
172+
* Thu Jan 19 2023 Fedora Release Engineering <[email protected]> - 2.9.6-2
173+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
174+
175+
* Wed Sep 14 2022 Luboš Uhliarik <[email protected]> - 2.9.6-1
176+
- new version 2.9.6
177+
178+
* Wed Aug 31 2022 Luboš Uhliarik <[email protected]> - 2.9.5-1
179+
- new version 2.9.5
180+
181+
* Thu Jul 21 2022 Fedora Release Engineering <[email protected]> - 2.9.4-3
182+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
183+
184+
* Thu Jan 20 2022 Fedora Release Engineering <[email protected]> - 2.9.4-2
185+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
186+
187+
* Wed Aug 18 2021 Luboš Uhliarik <[email protected]> - 2.9.4-1
188+
- new version 2.9.4
189+
190+
* Thu Jul 22 2021 Fedora Release Engineering <[email protected]> - 2.9.3-11
191+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
192+
193+
* Tue Jan 26 2021 Fedora Release Engineering <[email protected]> - 2.9.3-10
194+
- Resolves: #1930664 - RFE: Add a feature that can set a mod_security/libcurl
195+
timeout for retrieving the rules
196+
- rename mlogc to mod_security-mlogc
197+
198+
* Fri Jan 22 2021 Joe Orton <[email protected]> - 2.9.3-8
199+
- don't link against redundant apr-util dependent libraries
200+
201+
* Sat Aug 08 2020 Othman Madjoudj <[email protected]> - 2.9.3-7
202+
- Add a patch to fix build with Lua 5.4 until we completely switch to mod_sec3 as default
203+
204+
* Sat Aug 01 2020 Fedora Release Engineering <[email protected]> - 2.9.3-6
205+
- Second attempt - Rebuilt for
206+
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
207+
208+
* Tue Jul 28 2020 Fedora Release Engineering <[email protected]> - 2.9.3-5
209+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
149210

150211
* Wed Jan 29 2020 Fedora Release Engineering <[email protected]> - 2.9.3-4
151212
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13642,8 +13642,8 @@
1364213642
"type": "other",
1364313643
"other": {
1364413644
"name": "mod_security",
13645-
"version": "2.9.4",
13646-
"downloadUrl": "https://github.com/SpiderLabs/ModSecurity/releases/download/v2.9.4/modsecurity-2.9.4.tar.gz"
13645+
"version": "2.9.7",
13646+
"downloadUrl": "https://github.com/SpiderLabs/ModSecurity/releases/download/v2.9.7/modsecurity-2.9.7.tar.gz"
1364713647
}
1364813648
}
1364913649
},

0 commit comments

Comments
 (0)