|
@@ -6,11 +6,12 @@
|
|
# build http_geoip_module
|
|
# build http_geoip_module
|
|
%if "%{_dist_release}" >= "vl7"
|
|
%if "%{_dist_release}" >= "vl7"
|
|
%bcond_without geoip
|
|
%bcond_without geoip
|
|
|
|
+%bcond_without geoip2
|
|
|
|
+%bcond_without naxsi
|
|
|
|
+%bcond_without modsecurity
|
|
%else
|
|
%else
|
|
%bcond_with geoip
|
|
%bcond_with geoip
|
|
%endif
|
|
%endif
|
|
-%bcond_without geoip2
|
|
|
|
-%bcond_without naxsi
|
|
|
|
|
|
|
|
%global nginx_modulesdir %{_libdir}/nginx/modules
|
|
%global nginx_modulesdir %{_libdir}/nginx/modules
|
|
%global nginx_modconfdir %{_sysconfdir}/nginx/modules.d
|
|
%global nginx_modconfdir %{_sysconfdir}/nginx/modules.d
|
|
@@ -34,7 +35,7 @@ Summary(ja): 堅牢・軽量・高性能な HTTP およびリバースプロ
|
|
Name: nginx
|
|
Name: nginx
|
|
Version: %{nginx_version}
|
|
Version: %{nginx_version}
|
|
# do not reset or decrease.
|
|
# do not reset or decrease.
|
|
-Release: 1%{?_dist_release}
|
|
+Release: 2%{?_dist_release}
|
|
|
|
|
|
Group: System Environment/Daemons
|
|
Group: System Environment/Daemons
|
|
# BSD License (two clause)
|
|
# BSD License (two clause)
|
|
@@ -90,6 +91,12 @@ Source2021: naxsi_params
|
|
Source2030: https://github.com/leev/ngx_http_geoip2_module/archive/%{geoip2_version}.tar.gz#/ngx_http_geoip2_module-3.2.tar.gz
|
|
Source2030: https://github.com/leev/ngx_http_geoip2_module/archive/%{geoip2_version}.tar.gz#/ngx_http_geoip2_module-3.2.tar.gz
|
|
%endif
|
|
%endif
|
|
|
|
|
|
|
|
+%if %{with modsecurity}
|
|
|
|
+%global with_modsecurity 1
|
|
|
|
+%global modsecurity_version 1.0.0
|
|
|
|
+Source2040: https://github.com/SpiderLabs/ModSecurity-nginx/releases/download/v%{modsecurity_version}/modsecurity-nginx-v%{modsecurity_version}.tar.gz
|
|
|
|
+%endif
|
|
|
|
+
|
|
# removes -Werror in upstream build scripts. -Werror conflicts with
|
|
# removes -Werror in upstream build scripts. -Werror conflicts with
|
|
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
|
|
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
|
|
Patch0: nginx-auto-cc-gcc.patch
|
|
Patch0: nginx-auto-cc-gcc.patch
|
|
@@ -159,7 +166,7 @@ Requires: ruby-rubygems
|
|
BuildRequires: rubygems
|
|
BuildRequires: rubygems
|
|
Requires: rubygems
|
|
Requires: rubygems
|
|
%endif
|
|
%endif
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
|
|
%description passenger
|
|
%description passenger
|
|
Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
|
|
Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3
|
|
@@ -177,7 +184,7 @@ Nginx [engine x/エンジンX] は Igor Sysoev により開発された以下の
|
|
%package geoip
|
|
%package geoip
|
|
Summary: Nginx HTTP geoip module
|
|
Summary: Nginx HTTP geoip module
|
|
BuildRequires: GeoIP-devel
|
|
BuildRequires: GeoIP-devel
|
|
-Requires: nginx = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
Requires: GeoIP
|
|
Requires: GeoIP
|
|
|
|
|
|
%description geoip
|
|
%description geoip
|
|
@@ -187,7 +194,7 @@ Requires: GeoIP
|
|
%package image-filter
|
|
%package image-filter
|
|
Summary: Nginx HTTP image filter module
|
|
Summary: Nginx HTTP image filter module
|
|
BuildRequires: gd-devel
|
|
BuildRequires: gd-devel
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
Requires: gd
|
|
Requires: gd
|
|
|
|
|
|
%description image-filter
|
|
%description image-filter
|
|
@@ -197,7 +204,7 @@ Requires: gd
|
|
Summary: Nginx HTTP perl module
|
|
Summary: Nginx HTTP perl module
|
|
BuildRequires: perl
|
|
BuildRequires: perl
|
|
BuildRequires: perl(ExtUtils::Embed)
|
|
BuildRequires: perl(ExtUtils::Embed)
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
|
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
|
|
|
|
|
%description perl
|
|
%description perl
|
|
@@ -206,21 +213,21 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $ve
|
|
%package xslt-filter
|
|
%package xslt-filter
|
|
Summary: Nginx XSLT module
|
|
Summary: Nginx XSLT module
|
|
BuildRequires: libxslt-devel
|
|
BuildRequires: libxslt-devel
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
|
|
%description xslt-filter
|
|
%description xslt-filter
|
|
%{summary}.
|
|
%{summary}.
|
|
|
|
|
|
%package mail
|
|
%package mail
|
|
Summary: Nginx mail modules
|
|
Summary: Nginx mail modules
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
|
|
%description mail
|
|
%description mail
|
|
%{summary}.
|
|
%{summary}.
|
|
|
|
|
|
%package stream
|
|
%package stream
|
|
Summary: Nginx stream modules
|
|
Summary: Nginx stream modules
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
|
|
%description stream
|
|
%description stream
|
|
%{summary}.
|
|
%{summary}.
|
|
@@ -228,7 +235,7 @@ Requires: %{name} = %{nginx_version}
|
|
%package dav-ext
|
|
%package dav-ext
|
|
Summary: Nginx dav-ext modules
|
|
Summary: Nginx dav-ext modules
|
|
Version: %{nginx_dav_ext_module_version}
|
|
Version: %{nginx_dav_ext_module_version}
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
|
|
%description dav-ext
|
|
%description dav-ext
|
|
%{summary}.
|
|
%{summary}.
|
|
@@ -238,7 +245,7 @@ Requires: %{name} = %{nginx_version}
|
|
Summary: Nginx HTTP geoip2 modules
|
|
Summary: Nginx HTTP geoip2 modules
|
|
Version: %{geoip2_version}
|
|
Version: %{geoip2_version}
|
|
BuildRequires: libmaxminddb-devel
|
|
BuildRequires: libmaxminddb-devel
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
|
|
%description http-geoip2
|
|
%description http-geoip2
|
|
%{summary}.
|
|
%{summary}.
|
|
@@ -247,8 +254,8 @@ Requires: %{name} = %{nginx_version}
|
|
Summary: Nginx stream geoip2 modules
|
|
Summary: Nginx stream geoip2 modules
|
|
Version: %{geoip2_version}
|
|
Version: %{geoip2_version}
|
|
BuildRequires: libmaxminddb-devel
|
|
BuildRequires: libmaxminddb-devel
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
-Requires: %{name}-stream = %{nginx_version}
|
|
+Requires: %{name}-stream = %{nginx_version}-%{release}
|
|
|
|
|
|
%description stream-geoip2
|
|
%description stream-geoip2
|
|
%{summary}.
|
|
%{summary}.
|
|
@@ -260,7 +267,7 @@ Summary: an open-source, high performance, low rules maintenance WAF f
|
|
Summary(ja): NGiNXのためのOSS・高パフォーマンス・低メンテナンスコストなWAF
|
|
Summary(ja): NGiNXのためのOSS・高パフォーマンス・低メンテナンスコストなWAF
|
|
Version: %{naxsi_version}
|
|
Version: %{naxsi_version}
|
|
License: GPL3
|
|
License: GPL3
|
|
-Requires: %{name} = %{nginx_version}
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
|
|
%description naxsi
|
|
%description naxsi
|
|
NAXSI means Nginx Anti XSS & SQL Injection.
|
|
NAXSI means Nginx Anti XSS & SQL Injection.
|
|
@@ -281,9 +288,25 @@ rules regarding a website's behaviour.
|
|
to add required ACCEPT rules for the target website to work properly.
|
|
to add required ACCEPT rules for the target website to work properly.
|
|
%endif
|
|
%endif
|
|
|
|
|
|
|
|
+%if %{with modsecurity}
|
|
|
|
+%package modsecurity
|
|
|
|
+Summary: The ModSecurity-nginx connector
|
|
|
|
+Summary(ja): ModSecurity Nginxコネクター
|
|
|
|
+Version: %{modsecurity_version}
|
|
|
|
+License: ASL 2.0
|
|
|
|
+BuildRequires: libmodsecurity-devel
|
|
|
|
+Requires: %{name} = %{nginx_version}-%{release}
|
|
|
|
+
|
|
|
|
+%description modsecurity
|
|
|
|
+ The ModSecurity-nginx connector is the connection point between
|
|
|
|
+nginx and libmodsecurity (ModSecurity v3). Said another way, this
|
|
|
|
+project provides a communication channel between nginx and libmodsecurity.
|
|
|
|
+This connector is required to use LibModSecurity with nginx.
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
|
|
%prep
|
|
%prep
|
|
-%setup -q -a 1000 -a 1010 -a 1020 -a 1030 %{?with_wsgi:-a 2000} -a 2010 %{?with_naxsi:-a 2020} %{?with_geoip2:-a 2030}
|
|
+%setup -q -a 1000 -a 1010 -a 1020 -a 1030 %{?with_wsgi:-a 2000} -a 2010 %{?with_naxsi:-a 2020} %{?with_geoip2:-a 2030} %{?with_modsecurity:-a 2040}
|
|
|
|
|
|
%patch0 -p0
|
|
%patch0 -p0
|
|
|
|
|
|
@@ -364,6 +387,9 @@ CONFIGOPTS="\
|
|
%endif
|
|
%endif
|
|
%if %{with geoip2}
|
|
%if %{with geoip2}
|
|
--add-dynamic-module=ngx_http_geoip2_module-%{geoip2_version} \
|
|
--add-dynamic-module=ngx_http_geoip2_module-%{geoip2_version} \
|
|
|
|
+%endif
|
|
|
|
+%if %{with modsecurity}
|
|
|
|
+ --add-dynamic-module=modsecurity-nginx-v%{modsecurity_version} \
|
|
%endif
|
|
%endif
|
|
--add-dynamic-module=passenger-%{passenger_version}/src/nginx_module \
|
|
--add-dynamic-module=passenger-%{passenger_version}/src/nginx_module \
|
|
%ifarch i686
|
|
%ifarch i686
|
|
@@ -469,6 +495,12 @@ echo 'load_module "%{nginx_modulesdir}/ngx_http_naxsi_module.so";' \
|
|
> %{buildroot}%{nginx_modconfdir}/naxsi.conf
|
|
> %{buildroot}%{nginx_modconfdir}/naxsi.conf
|
|
%endif
|
|
%endif
|
|
|
|
|
|
|
|
+%if %{with modsecurity}
|
|
|
|
+# modsecurity module
|
|
|
|
+echo 'load_module "%{nginx_modulesdir}/ngx_http_modsecurity_module.so";' \
|
|
|
|
+ > %{buildroot}%{nginx_modconfdir}/modsecurity.conf
|
|
|
|
+%endif
|
|
|
|
+
|
|
touch %{buildroot}%{nginx_confdir}/conf.d/virtual.conf
|
|
touch %{buildroot}%{nginx_confdir}/conf.d/virtual.conf
|
|
|
|
|
|
# convert to UTF-8 all files that give warnings.
|
|
# convert to UTF-8 all files that give warnings.
|
|
@@ -618,7 +650,19 @@ fi
|
|
%config(noreplace) %{nginx_modconfdir}/naxsi.conf
|
|
%config(noreplace) %{nginx_modconfdir}/naxsi.conf
|
|
%endif
|
|
%endif
|
|
|
|
|
|
|
|
+%if %{with modsecurity}
|
|
|
|
+%files modsecurity
|
|
|
|
+%defattr(-,root,root,-)
|
|
|
|
+%license modsecurity-%{mod_securiy_version}/LICENSE
|
|
|
|
+%doc modsecurity-%{mod_securiy_version}/README.md
|
|
|
|
+%{nginx_modulesdir}/ngx_http_modsecurity_module.so
|
|
|
|
+%config(noreplace) %{nginx_modconfdir}/modsecurity.conf
|
|
|
|
+%endif
|
|
|
|
+
|
|
%changelog
|
|
%changelog
|
|
|
|
+* Wed Oct 23 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.16.1-2
|
|
|
|
+- added ModSecurity module.
|
|
|
|
+
|
|
* Sat Aug 24 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.16.1-1
|
|
* Sat Aug 24 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.16.1-1
|
|
- updated to 1.16.1.
|
|
- updated to 1.16.1.
|
|
- made to install NAXSI as a dynamic module.
|
|
- made to install NAXSI as a dynamic module.
|