]>
Commit | Line | Data |
---|---|---|
1 | Summary: Script to help thwart SSH server attacks | |
2 | Summary(pl.UTF-8): Skrypt do blokowania ataków na serwery SSH | |
3 | Name: DenyHosts | |
4 | Version: 2.6 | |
5 | Release: 6 | |
6 | License: GPL v2 | |
7 | Group: Applications/System | |
8 | Source0: http://downloads.sourceforge.net/denyhosts/%{name}-%{version}.tar.gz | |
9 | # Source0-md5: fc2365305a9402886a2b0173d1beb7df | |
10 | Source1: %{name}.cron | |
11 | Source2: %{name}.cfg | |
12 | Source3: %{name}.init | |
13 | Patch0: silentpurge.patch | |
14 | URL: http://www.denyhosts.net/ | |
15 | BuildRequires: python-devel >= 1:2.5 | |
16 | BuildRequires: python-modules | |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.268 | |
19 | Requires(post,preun): /sbin/chkconfig | |
20 | Requires: python | |
21 | Requires: python-modules | |
22 | Requires: rc-scripts | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %description | |
26 | DenyHosts is a script intended to be run by Linux system | |
27 | administrators to help thwart SSH server attacks. | |
28 | ||
29 | If you've ever looked at your SSH log (/var/log/secure on Redhat, | |
30 | /var/log/auth.log on Mandrake, etc...) you may be alarmed to see how | |
31 | many hackers attempted to gain access to your server. Hopefully, none | |
32 | of them were successful (but then again, how would you know?). | |
33 | Wouldn't it be better to automatically prevent that attacker from | |
34 | continuing to gain entry into your system? | |
35 | ||
36 | %description -l pl.UTF-8 | |
37 | DenyHosts jest skryptem dla administratorów systemów Linux, którego | |
38 | zadaniem jest odparcie ataków na serwery SSH. | |
39 | ||
40 | W logach SSH można znaleźć wiele informacji o próbach uzyskania | |
41 | dostępu do serwera poprzez usługę SSH. Dobrze jest zapobiec kolejnym | |
42 | próbom włamania przez odcięcie włamywaczom dostępu do serwera. | |
43 | ||
44 | %prep | |
45 | %setup -q | |
46 | %patch0 -p1 | |
47 | ||
48 | grep -r '/usr/bin/env python' -l . | xargs %{__sed} -i -e 's,/usr/bin/env python,%{__python},' | |
49 | ||
50 | %build | |
51 | echo 'VERSION="%{version}"' > version.py | |
52 | %{__python} setup.py build | |
53 | ||
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.d,/etc/rc.d/init.d,%{_sbindir},/var/lib/%{name}} | |
57 | %{__python} setup.py install \ | |
58 | --root=$RPM_BUILD_ROOT \ | |
59 | --optimize=2 | |
60 | ||
61 | %py_postclean | |
62 | ||
63 | cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/%{name} | |
64 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir} | |
65 | install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
66 | mv $RPM_BUILD_ROOT%{_datadir}/denyhosts/daemon-control-dist $RPM_BUILD_ROOT%{_sbindir}/%{name}ctl | |
67 | rm -r $RPM_BUILD_ROOT%{_datadir}/denyhosts | |
68 | echo "127.0.0.1" > $RPM_BUILD_ROOT/var/lib/%{name}/allowed-hosts | |
69 | ||
70 | %clean | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %post | |
74 | /sbin/chkconfig --add %{name} | |
75 | %service DenyHosts restart | |
76 | ||
77 | %preun | |
78 | if [ "$1" = "0" ]; then | |
79 | %service DenyHosts stop | |
80 | /sbin/chkconfig --del %{name} | |
81 | fi | |
82 | ||
83 | %files | |
84 | %defattr(644,root,root,755) | |
85 | %doc README.txt CHANGELOG.txt | |
86 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg | |
87 | %config(noreplace,missingok) %verify(not md5 mtime size) /etc/cron.d/%{name} | |
88 | %attr(755,root,root) %{_bindir}/* | |
89 | %attr(755,root,root) %{_sbindir}/* | |
90 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
91 | %dir /var/lib/%{name} | |
92 | %config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/allowed-hosts | |
93 | %{py_sitescriptdir}/DenyHosts-*.egg-info | |
94 | %dir %{py_sitescriptdir}/%{name} | |
95 | %{py_sitescriptdir}/%{name}/*.py[co] |