]>
Commit | Line | Data |
---|---|---|
465f8f11 | 1 | Summary: Ban IPs that make too many password failures |
f4d4d197 | 2 | Summary(pl.UTF-8): Blokowanie IP powodujących zbyt dużo prób logowań z błędnym hasłem |
465f8f11 | 3 | Name: fail2ban |
78ac1e43 | 4 | Version: 1.0.2 |
d223ef0d | 5 | Release: 3 |
465f8f11 | 6 | License: GPL |
7 | Group: Daemons | |
ef99c638 | 8 | Source0: https://github.com/fail2ban/fail2ban/archive/%{version}.tar.gz |
78ac1e43 | 9 | # Source0-md5: 96582af04e60bf56617da9f9cbda0aa7 |
8a5385b5 | 10 | Source1: %{name}.init |
06aca71d | 11 | Source2: %{name}.logrotate |
ce81aec7 | 12 | Source3: paths-pld.conf |
0563dd14 | 13 | Source4: %{name}.sysconfig |
7037c24e | 14 | Patch0: logifiles.patch |
823ffa17 | 15 | URL: http://fail2ban.sourceforge.net/ |
78ac1e43 AM |
16 | BuildRequires: python3-2to3 |
17 | BuildRequires: python3-devel | |
18 | BuildRequires: python3-modules | |
823ffa17 | 19 | BuildRequires: rpm-pythonprov |
e50e7043 | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
56c86c91 | 21 | Requires(post,preun): /sbin/chkconfig |
40211b80 | 22 | Requires(post,preun,postun): systemd-units >= 38 |
78ac1e43 AM |
23 | Requires: python3-dns |
24 | Requires: python3-pyinotify >= 0.8.3 | |
56c86c91 | 25 | Requires: rc-scripts |
40211b80 | 26 | Requires: systemd-units >= 38 |
465f8f11 | 27 | BuildArch: noarch |
80cab974 | 28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
465f8f11 | 29 | |
30 | %description | |
31 | Fail2Ban scans log files like /var/log/secure and bans IP that makes | |
32 | too many password failures. It updates firewall rules to reject the IP | |
33 | address. These rules can be defined by the user. Fail2Ban can read | |
34 | multiple log files including sshd or Apache web server logs. | |
35 | ||
2312737e JR |
36 | %description -l pl.UTF-8 |
37 | Fail2Ban skanuje pliki logów takie jak /var/log/secure i blokuje IP | |
38 | powodujące zbyt dużo prób logowań z błędnym hasłem. Uaktualnia regułki | |
39 | firewalla, aby odrzucić adres IP. Regułki te mogą być definiowane | |
40 | przez użytkownika. Fail2Ban potrafi czytać wiele plików logów włącznie | |
41 | z sshd czy plikami logów serwera WWW Apache. | |
cac37698 | 42 | |
465f8f11 | 43 | %prep |
44 | %setup -q | |
7037c24e | 45 | %patch0 -p1 |
ddeb0306 | 46 | rm setup.cfg |
465f8f11 | 47 | |
78ac1e43 | 48 | sed -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python3}\1,' -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python3}\1,' \ |
b0e868ec AM |
49 | bin/fail2ban-client \ |
50 | bin/fail2ban-regex \ | |
51 | bin/fail2ban-server \ | |
52 | bin/fail2ban-testcases \ | |
53 | setup.py | |
54 | ||
55 | sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \ | |
56 | config/filter.d/ignorecommands/apache-fakegooglebot \ | |
57 | fail2ban/tests/files/config/apache-auth/digest.py \ | |
58 | fail2ban/tests/files/ignorecommand.py | |
59 | ||
78ac1e43 AM |
60 | sed -i -e 's#2to3#2to3-%{py3_ver}#g' fail2ban-2to3 |
61 | ./fail2ban-2to3 | |
62 | ||
465f8f11 | 63 | %build |
78ac1e43 | 64 | %py3_build |
465f8f11 | 65 | |
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
0563dd14 | 68 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \ |
399e2b3f | 69 | $RPM_BUILD_ROOT{%{_mandir}/man{1,5},/var/{log,run/fail2ban}} \ |
40211b80 | 70 | $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir}} |
3f2a7d0f | 71 | |
78ac1e43 AM |
72 | %py3_install \ |
73 | --install-lib=%{py3_sitescriptdir} \ | |
465f8f11 | 74 | --root=$RPM_BUILD_ROOT |
75 | ||
06aca71d | 76 | install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
399e2b3f | 77 | install -p man/*.5 $RPM_BUILD_ROOT%{_mandir}/man5 |
06aca71d JR |
78 | |
79 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban | |
80 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/fail2ban | |
ef99c638 | 81 | install -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban/paths-pld.conf |
0563dd14 | 82 | install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
ef189e0e | 83 | |
b0e868ec | 84 | sed -e 's# /run# /var/run#g' files/fail2ban-tmpfiles.conf > $RPM_BUILD_ROOT%{systemdtmpfilesdir}/fail2ban.conf |
78ac1e43 | 85 | install -p build-3/fail2ban.service $RPM_BUILD_ROOT%{systemdunitdir}/fail2ban.service |
fad935ea | 86 | |
06aca71d JR |
87 | :> $RPM_BUILD_ROOT/var/log/fail2ban.log |
88 | ||
823ffa17 | 89 | %py_postclean |
465f8f11 | 90 | |
a6afe6ea AM |
91 | rm $RPM_BUILD_ROOT%{_bindir}/fail2ban-testcases |
92 | ||
465f8f11 | 93 | %clean |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %post | |
97 | /sbin/chkconfig --add %{name} | |
98 | %service %{name} restart | |
40211b80 | 99 | %systemd_post fail2ban.service |
465f8f11 | 100 | |
101 | %preun | |
102 | if [ "$1" = "0" ]; then | |
103 | %service -q %{name} stop | |
104 | /sbin/chkconfig --del %{name} | |
105 | fi | |
40211b80 JR |
106 | %systemd_preun fail2ban.service |
107 | ||
108 | %postun | |
109 | %systemd_reload | |
110 | ||
111 | %triggerpostun -- fail2ban < 0.8.11-3 | |
112 | %systemd_trigger fail2ban.service | |
465f8f11 | 113 | |
114 | %files | |
465f8f11 | 115 | %defattr(644,root,root,755) |
b0e868ec | 116 | %doc CONTRIBUTING.md ChangeLog DEVELOP FILTERS README.md RELEASE THANKS TODO COPYING doc/run-rootless.txt |
40211b80 JR |
117 | %attr(754,root,root) /etc/rc.d/init.d/fail2ban |
118 | %attr(755,root,root) %{_bindir}/fail2ban-client | |
7572e05e | 119 | %attr(755,root,root) %{_bindir}/fail2ban-python |
40211b80 JR |
120 | %attr(755,root,root) %{_bindir}/fail2ban-regex |
121 | %attr(755,root,root) %{_bindir}/fail2ban-server | |
122 | %{systemdunitdir}/fail2ban.service | |
123 | %{systemdtmpfilesdir}/fail2ban.conf | |
124 | %dir /var/run/fail2ban | |
125 | %dir %{_sysconfdir}/fail2ban | |
126 | %dir %{_sysconfdir}/fail2ban/action.d | |
ce81aec7 | 127 | %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/smtp.py |
40211b80 JR |
128 | %dir %{_sysconfdir}/fail2ban/fail2ban.d |
129 | %dir %{_sysconfdir}/fail2ban/filter.d | |
7572e05e AM |
130 | %dir %{_sysconfdir}/fail2ban/filter.d/ignorecommands |
131 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/filter.d/ignorecommands/apache-fakegooglebot | |
40211b80 JR |
132 | %dir %{_sysconfdir}/fail2ban/jail.d |
133 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*.conf | |
134 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*/*.conf | |
06aca71d | 135 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fail2ban |
d22c2530 | 136 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
78ac1e43 AM |
137 | %{py3_sitescriptdir}/%{name} |
138 | %{py3_sitescriptdir}/%{name}-%{version}-py*.egg-info | |
40211b80 | 139 | %{_mandir}/man1/fail2ban-client.1* |
3b555c20 | 140 | %{_mandir}/man1/fail2ban-python.1* |
40211b80 JR |
141 | %{_mandir}/man1/fail2ban-regex.1* |
142 | %{_mandir}/man1/fail2ban-server.1* | |
7572e05e | 143 | %{_mandir}/man1/fail2ban-testcases.1* |
40211b80 | 144 | %{_mandir}/man1/fail2ban.1* |
399e2b3f | 145 | %{_mandir}/man5/jail.conf.5* |
179323c4 | 146 | %attr(750,root,root) %dir /var/lib/%{name} |
06aca71d | 147 | %attr(640,root,logs) %ghost /var/log/fail2ban.log |