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