]>
Commit | Line | Data |
---|---|---|
946f7ae3 | 1 | # |
2 | # TODO: - snort rules - fix description | |
cb19b407 | 3 | # - snort_inline - prepare separate sets of config-files, rules |
9d61ae4f | 4 | # and startup script, adds some docs |
01f3f79b | 5 | # |
e817c488 | 6 | # Conditional build: |
12e2e783 | 7 | %bcond_with registered # build with rules available for registered users |
01f3f79b | 8 | # |
92ea8dee | 9 | Summary: Network intrusion detection system (IDS/IPS) |
cbf82e1d ER |
10 | Summary(pl.UTF-8): System wykrywania intruzów w sieciach (IDS/IPS) |
11 | Summary(pt_BR.UTF-8): Ferramenta de detecção de intrusos | |
12 | Summary(ru.UTF-8): Snort - система обнаружения попыток вторжения в сеть | |
13 | Summary(uk.UTF-8): Snort - система виявлення спроб вторгнення в мережу | |
8775223f | 14 | Name: snort |
2c40db26 | 15 | Version: 2.9.8.2 |
1ce37312 | 16 | Release: 2 |
12e2e783 | 17 | License: GPL v2 (vrt rules on VRT-License) |
b3907a72 | 18 | Group: Networking |
2c40db26 JR |
19 | Source0: http://www.snort.org/downloads/snort/%{name}-%{version}.tar.gz |
20 | # Source0-md5: b5005f88a01b42ff7ee0defb94161ffc | |
57c9b91b AM |
21 | Source1: http://www.snort.org/pub-bin/downloads.cgi/Download/vrt_pr/%{name}rules-pr-2.4.tar.gz |
22 | # Source1-md5: 35d9a2486f8c0280bb493aa03c011927 | |
12e2e783 | 23 | %if %{with registered} |
0e511834 | 24 | Source2: http://www.snort.org/pub-bin/downloads.cgi/Download/vrt_os/%{name}rules-snapshot-2.6.tar.gz |
25 | # NoSource2-md5: 0405ec828cf9ad85a03cbf670818f690 | |
12e2e783 | 26 | NoSource: 2 |
27 | %endif | |
28 | Source3: http://www.snort.org/pub-bin/downloads.cgi/Download/comm_rules/Community-Rules-2.4.tar.gz | |
0e511834 | 29 | # Source3-md5: f236b8a4ac12e99d3e7bd81bf3b5a482 |
12e2e783 | 30 | Source4: %{name}.init |
31 | Source5: %{name}.logrotate | |
2c40db26 | 32 | Patch0: %{name}-link.patch |
652a37bc | 33 | Patch1: %{name}-libdir.patch |
5ad2f8a8 | 34 | URL: http://www.snort.org/ |
08df69e6 JB |
35 | BuildRequires: autoconf |
36 | BuildRequires: automake | |
2c40db26 JR |
37 | BuildRequires: daq-static |
38 | BuildRequires: libdnet-devel | |
f479ddcb | 39 | BuildRequires: libnet-devel |
5d617823 | 40 | BuildRequires: libnet1-devel = 1.0.2a |
b3907a72 | 41 | BuildRequires: libpcap-devel |
48886295 | 42 | BuildRequires: libtool |
95620817 | 43 | BuildRequires: openssl-devel >= 0.9.7d |
2cc2dce2 | 44 | BuildRequires: pcre-devel |
31126327 | 45 | BuildRequires: rpmbuild(macros) >= 1.202 |
2fa6d1a5 | 46 | BuildRequires: rpmbuild(macros) >= 1.268 |
d87f0eb8 | 47 | BuildRequires: zlib-devel |
27fdff69 | 48 | Requires(post,preun): /sbin/chkconfig |
49 | Requires(postun): /usr/sbin/groupdel | |
50 | Requires(postun): /usr/sbin/userdel | |
08df69e6 | 51 | Requires(pre): /bin/id |
d9c3717f | 52 | Requires(pre): /usr/bin/getgid |
08df69e6 JB |
53 | Requires(pre): /usr/sbin/groupadd |
54 | Requires(pre): /usr/sbin/useradd | |
5d617823 | 55 | Requires: libnet1 = 1.0.2a |
27fdff69 | 56 | Requires: rc-scripts >= 0.2.0 |
d9c3717f | 57 | Provides: group(snort) |
d9c3717f | 58 | Provides: user(snort) |
cb19b407 | 59 | Obsoletes: snort-rules |
c40a7757 | 60 | Conflicts: logrotate < 3.7-4 |
5ad2f8a8 | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
5ad2f8a8 | 63 | %define _bindir %{_sbindir} |
ab81a4d5 | 64 | |
65 | %description | |
99fed451 AM |
66 | Snort is an open source network intrusion detection system, capable of |
67 | performing real-time traffic analysis and packet logging on IP | |
68 | networks. It can perform protocol analysis and content | |
69 | searching/matching in order to detect a variety of attacks and probes, | |
70 | such as buffer overflows, stealth port scans, CGI attacks, SMB probes, | |
71 | OS fingerprinting attempts, and much more. Snort uses a flexible rules | |
72 | language to describe traffic that it should collect or pass, as well | |
73 | as a detection engine that utilizes a modular plugin architecture. | |
74 | Snort has a real- time alerting capability as well, incorporating | |
75 | alerting mechanisms for syslog, user specified files, a UNIX socket, | |
76 | or WinPopup messages to Windows clients using Samba's smbclient. | |
b3907a72 | 77 | |
67a06db2 | 78 | Sourcefire VRT Certified Rules requires registration. |
79 | https://www.snort.org/pub-bin/register.cgi | |
80 | ||
27666db8 JR |
81 | %description -l pl.UTF-8 |
82 | Snort to bazujący na open source NIDS (network intrusion detection | |
83 | systems) wykonujący w czasie rzeczywistym analizę ruchu oraz logowanie | |
84 | pakietów w sieciach IP. Jego możliwości to analiza protokołu oraz | |
85 | zawartości w poszukiwaniu różnego rodzaju ataków lub prób takich jak | |
86 | przepełnienia bufora, skanowanie portów typu stealth, ataki CGI, | |
87 | próbkowanie SMB, OS fingerprinting i dużo więcej. Snort używa | |
88 | elastycznego języka regułek do opisu ruchu, który należy | |
89 | przeanalizować jak również silnika wykrywającego, wykorzystującego | |
90 | modułową architekturę. Snort umożliwia alarmowanie w czasie | |
91 | rzeczywistym poprzez sysloga, osobny plik lub jako wiadomość WinPopup | |
99fed451 AM |
92 | poprzez klienta Samby: smbclient. |
93 | ||
27666db8 | 94 | Reguły certyfikowane poprzez Sourcefire wymagają rejestracji. |
67a06db2 | 95 | https://www.snort.org/pub-bin/register.cgi |
96 | ||
27666db8 JR |
97 | %description -l pt_BR.UTF-8 |
98 | Snort é um sniffer baseado em libpcap que pode ser usado como um | |
99 | pequeno sistema de detecção de intrusos. Tem como característica o | |
100 | registro de pacotes baseado em regras e também pode executar uma | |
101 | análise do protocolo, pesquisa de padrões e detectar uma variedade de | |
0955b0c3 | 102 | assinaturas de ataques, como estouros de buffer, varreduras "stealth" |
103 | de portas, ataques CGI, pesquisas SMB, tentativas de descobrir o | |
104 | sistema operacional e muito mais. Possui um sistema de alerta em tempo | |
105 | real, com alertas enviados para o syslog, um arquivo de alertas em | |
106 | separado ou como uma mensagem Winpopup. | |
ab81a4d5 | 107 | |
27666db8 JR |
108 | %description -l ru.UTF-8 |
109 | Snort - это сниффер пакетов, который может использоваться как система | |
110 | обнаружения попыток вторжения в сеть. Snort поддерживает | |
111 | протоколирование пакетов на основе правил, может выполнять анализ | |
112 | протоколов, поиск в содержимом пакетов. Может также использоваться для | |
113 | обнаружения атак и "разведок", таких как попытки атак типа | |
114 | "переполнение буфера", скрытого сканирования портов, CGI атак, SMB | |
115 | разведок, попыток обнаружения типа ОС и много другого. Snort может | |
116 | информировать о событиях в реальном времени, посылая сообщения в | |
117 | syslog, отдельный файл или как WinPopup сообщения через smbclient. | |
cd357cee | 118 | |
27666db8 JR |
119 | %description -l uk.UTF-8 |
120 | Snort - це сніфер пакетів, що може використовуватись як система | |
121 | виявлення спроб вторгнень в мережу. Snort підтримує протоколювання | |
122 | пакетів на основі правил, може виконувати аналіз протоколів, пошук у | |
123 | вмісті пакетів. Може також використовуватись для виявлення атак та | |
124 | "розвідок", таких як спроби атак типу "переповнення буфера", | |
125 | прихованого сканування портів, CGI атак, SMB розвідок, спроб виявлення | |
126 | типу ОС та багато іншого. Snort може інформувати про події в реальному | |
127 | часі, надсилаючи повідомлення до syslog, окремого файлу чи як WinPopup | |
128 | повідомлення через smbclient. | |
cd357cee | 129 | |
ab81a4d5 | 130 | %prep |
12e2e783 | 131 | %setup -q %{!?with_registered:-a1} %{?with_registered:-a2} -a3 |
2eb1dd1f | 132 | %patch0 -p1 |
652a37bc | 133 | %patch1 -p1 |
ab81a4d5 | 134 | |
6a0c25e4 | 135 | sed -i "s#var\ RULE_PATH.*#var RULE_PATH /etc/snort/rules#g" rules/snort.conf |
136 | _DIR=$(pwd) | |
137 | cd rules | |
138 | for I in community-*.rules; do | |
139 | echo "include \$RULE_PATH/$I" >> snort.conf | |
140 | done | |
141 | cd $_DIR | |
142 | ||
ab81a4d5 | 143 | %build |
e0b76e62 | 144 | %{__libtoolize} |
4529e62c | 145 | %{__aclocal} -I m4 |
89e97d3b | 146 | %{__autoconf} |
147 | %{__automake} | |
e1df464a | 148 | # we don't need libnsl, so don't use it |
b3907a72 | 149 | %configure \ |
af18b2c0 | 150 | no_libnsl=yes \ |
2c40db26 JR |
151 | --enable-pthread \ |
152 | --enable-so-with-static-lib \ | |
153 | --enable-control-socket \ | |
154 | --enable-side-channel \ | |
155 | --enable-build-dynamic-examples | |
99fed451 | 156 | |
76b05458 | 157 | %{__make} -j1 |
ab81a4d5 | 158 | |
159 | %install | |
160 | rm -rf $RPM_BUILD_ROOT | |
48886295 | 161 | install -d $RPM_BUILD_ROOT%{_initrddir} \ |
96b7be9c | 162 | $RPM_BUILD_ROOT%{_sysconfdir}/{%{name},cron.daily,logrotate.d} \ |
aad71c3c | 163 | $RPM_BUILD_ROOT%{_var}/log/{%{name},archive/%{name}} \ |
75d3e2a6 | 164 | $RPM_BUILD_ROOT%{_datadir}/mibs/site \ |
48886295 | 165 | $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/rules |
ab81a4d5 | 166 | |
5ad2f8a8 | 167 | %{__make} install \ |
168 | DESTDIR=$RPM_BUILD_ROOT | |
2917f470 | 169 | |
48886295 | 170 | install rules/*.config $RPM_BUILD_ROOT%{_sysconfdir}/%{name} |
171 | install etc/unicode.map $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
172 | install rules/*.rules $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/rules | |
173 | install %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/%{name} | |
174 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} | |
175 | install rules/snort.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
6a0c25e4 | 176 | |
b3907a72 AM |
177 | %clean |
178 | rm -rf $RPM_BUILD_ROOT | |
2917f470 | 179 | |
b3907a72 | 180 | %pre |
31126327 | 181 | %groupadd -g 46 -r snort |
946f7ae3 | 182 | %useradd -u 46 -g snort -M -r -d %{_var}/log/snort -s /bin/false -c "SNORT IDS/IPS" snort |
7e9750d1 | 183 | |
b3907a72 | 184 | %post |
2fa6d1a5 ER |
185 | /sbin/chkconfig --add snort |
186 | %service snort restart | |
2917f470 MP |
187 | |
188 | %preun | |
51402fe7 | 189 | if [ "$1" = "0" ] ; then |
2fa6d1a5 | 190 | %service snort stop |
51402fe7 | 191 | /sbin/chkconfig --del snort |
192 | fi | |
2917f470 MP |
193 | |
194 | %postun | |
51402fe7 | 195 | if [ "$1" = "0" ] ; then |
d9c3717f | 196 | %userremove snort |
197 | %groupremove snort | |
51402fe7 | 198 | fi |
ab81a4d5 | 199 | |
200 | %files | |
b3907a72 | 201 | %defattr(644,root,root,755) |
48886295 | 202 | %doc doc/{AUTHORS,BUGS,CREDITS,INSTALL,NEWS,PROBLEMS,README*,TODO,USAGE,WISHLIST,generators,*.pdf} |
980aa956 | 203 | %attr(755,root,root) %{_sbindir}/* |
48886295 | 204 | %attr(770,root,snort) %dir %{_var}/log/%{name} |
51d7d44e | 205 | %attr(770,root,snort) %dir %{_var}/log/archive/%{name} |
48886295 | 206 | %attr(750,root,snort) %dir %{_sysconfdir}/%{name} |
207 | %attr(640,root,snort) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/unicode.map | |
208 | %attr(640,root,snort) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.config | |
209 | %attr(640,root,snort) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf | |
210 | %attr(750,root,snort) %dir %{_sysconfdir}/%{name}/rules | |
96b7be9c | 211 | %attr(640,root,snort) %{_sysconfdir}/%{name}/rules/* |
48886295 | 212 | %attr(754,root,root) %{_initrddir}/%{name} |
96b7be9c | 213 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/* |
99fed451 | 214 | %{_mandir}/man?/* |
48886295 | 215 | %dir %{_libdir}/snort_dynamicengine |
216 | %dir %{_libdir}/snort_dynamicpreprocessor | |
652a37bc | 217 | %dir %{_libdir}/snort_dynamicrules |
48886295 | 218 | %attr(755,root,root) %{_libdir}/snort_dynamicengine/libsf_engine.so* |
219 | %attr(755,root,root) %{_libdir}/snort_dynamicpreprocessor/*.so* | |
652a37bc | 220 | %attr(755,root,root) %{_libdir}/snort_dynamicrules/lib_sfdynamic_example_rule.so* |