Commit Graph

99 Commits

Author SHA1 Message Date
Stefan Schantl
43263ea68e ids.cgi: Rework downloader for rulesets
Doing the rules download in pure perl instead of using
the external wget.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:51:41 +02:00
Stefan Schantl
e524290c9c ids.cgi: Drop old control code
The control file are not longer required, because the
initscript uses the settings file to determine if snort
should be started and binded to which interfaches.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:50:27 +02:00
Stefan Schantl
ef5171ab71 ids.cgi: Call oinkmaster without a log target
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:49:40 +02:00
Stefan Schantl
afe26a0586 ids.cgi: Introduce ruleset-source.list
This new file will contain the vendor information and url
for downloading their ruleset. In future if the download location
or filename changes, we only need to adjust this one file and ship
it via a core update.

Also extend the downloadrulesfile to be able to directly call the
subfunction.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:49:19 +02:00
Stefan Schantl
a232b58ca7 ids.cgi: Adjust code for saving snort settings
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:48:42 +02:00
Stefan Schantl
8f22237beb ids.cgi: Remove logfile after wget has successfully downloaded the ruleset
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:47:00 +02:00
Stefan Schantl
500c5c55d0 ids.cgi: Rework code which shows if oinkmaster is working
Move the code for displaying a notice that snort currently is working
into an own subfunction which will be called if oinkmaster currently
is started.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:46:42 +02:00
Stefan Schantl
aa12410222 ids.cgi: Drop old code for debuging purposes
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:46:17 +02:00
Stefan Schantl
c51a044a2a ids.cgi: Add check when altering the ruleset
Add a check if the currently processing sid is nummeric, otherwise skip it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:46:00 +02:00
Stefan Schantl
525998650a ids.cgi: Rework code for downloading/updating the ruleset
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:45:37 +02:00
Stefan Schantl
56dacb580e ids.cgi: Move call of oinkmaster to an own subfunction
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:45:17 +02:00
Stefan Schantl
376595057b ids.cgi: Always write config files for enabled/disabled rule files
If a single sid has been activated and then disabled without doing
any other ruleset modifications only one of the oinkmaster files
for enabled / disabled rules has been modified.

In this case it was possible, that the same sid, was part of the
file for enabled rules and part of the file for disabled rules at the
same time.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:45:02 +02:00
Stefan Schantl
466c67794b ids.cgi: Process enabled rulefiles in an own loop
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:44:48 +02:00
Stefan Schantl
603334734a ids.cgi: Drop enabled/disabled rules from cgiparams hash
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:44:32 +02:00
Stefan Schantl
b65b5ef377 ids.cgi: Drop enabled rulefile from cgiparams hash after processing
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:44:12 +02:00
Stefan Schantl
e573807983 ids.cgi: Re-add code for enable/disable rulefiles
The enabled rulefiles (rule categories) now will be added
to an own file, which will be included by the snort main config
file.

This will allow us to update snort and push the new main config file
without loosing the activated rulesets anymore.

* Introducing snort-used-rulefiles.conf

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:43:36 +02:00
Stefan Schantl
0b89daee93 ids.cgi: Code cleanup
* Drop a lot of unused variables and code.
* Re-ordering some code parts.
* Add a lot of comments.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:43:22 +02:00
Stefan Schantl
298723b9db ids.cgi: Re-add code to save the ruleset.
The manually enabled or disabled rules by the user now will be written
to own config files, which will be used by oinkmaster to keep these rules
in the same state after a rules update has been performed.

In short words, if you adjust your ruleset, the changes will not be lost
again if you perform an update of your ruleset.

* Grabbing and storing the cgi values now in an own hash (%cgiparams)
* Introducing oinkmaster config files for enabled and disabled rules.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:43:05 +02:00
Stefan Schantl
0b568bb965 ids.cgi: Drop unused css code
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:42:09 +02:00
Stefan Schantl
177266446a ids.cgi: Rework code for displaying the single rules
The complete ruleset will be grouped as categories by it's
corresponding rulefile and printed in hidden tables.

They easiely can be displayed by klicking on the show link and
vice-versa.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:41:55 +02:00
Stefan Schantl
f7fcd1c020 ids.cgi: Always display ruleset
Display the rule categories any time and do not hide them
if no instance of snort is runing.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:41:31 +02:00
Stefan Schantl
e3ab140634 ids.cgi: Remove comment lines for snort rules control
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:41:15 +02:00
Stefan Schantl
3da6e01bcf ids.cgi: Refactor reading-in rule files.
Move the code for reading and parsing the snort rule files
into an own subfunction.

* Drop code for reading in and modifying the snort main config file.
* Rework code for parsing and adding the snort rules to the snortrules hash.
* Drop code for gathering a description for the rule files, which does not
  because of a file layout change and sadly there is not suitable description
  shipped anymore by the snort team.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:40:51 +02:00
Stefan Schantl
a70d269a9a ids.cgi: Move function to end of file
Move the function for doing the page refresh stuff to the end of the file and
do some layout changes for better reading the code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:40:30 +02:00
Stefan Schantl
422204ff08 ids.cgi: Use pure perl for directory listing
Use pure perl for getting the filelist of available
rule files instead of using a sub-shell and unix commands.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:40:27 +02:00
Stefan Schantl
fbd430172f ids.cgi: Drop old code for uploading a ruleset
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:39:40 +02:00
Peter Müller
1f606aefce validate certificates in ids.cgi
Fixes #11770.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-17 18:20:09 +01:00
Matthias Fischer
9d79aea24b snort 2.9.11.1: 'ids.cgi' - Update for snort rules download url
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-01-07 19:21:51 +00:00
Matthias Fischer
49f7ee5d72 snort: Update to 2.9.11
For details see:

Release notes:
https://snort.org/downloads/snort/release_notes_2.9.11.txt

Changelog:
https://snort.org/downloads/snort/changelog_2.9.11.txt

Best,
Matthias

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-10-23 16:24:46 +01:00
Michael Tremer
a9a91e5fa7 ids.cgi: Fix remote command execution vulnerability
The OINKCODE variable was only validated for proper input
when the Save button was clicked.

Did the user demand to download new rules instead, the
content of that variable was not being validated (again)
and was passed to wget on the shell.

This was done with privileges of the "nobody" user.

Fixes #11401

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-06-14 12:58:12 +01:00
Matthias Fischer
ba6fc476fb snort: Update to 2.9.9.0
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-12-18 15:19:52 +00:00
Stefan Schantl
a27c40a05b ids.cgi: Drop guardian related code.
Guardian competely will be managed by it's own CGI.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2016-07-29 13:25:28 +02:00
Matthias Fischer
3a376d999e snort 2.9.8.2: update snort download url
Update for
http://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=0aff7b81965c06756ff42482ef0aa3ccfa68bf8f

Update url is set to 'snortrules-snapshot-2982.tar.gz'

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2016-05-21 11:35:17 +02:00
Matthias Fischer
5a5e5f04a7 snort: Update to 2.9.8.2
Release notes:

2016-03-09 - Snort 2.9.8.2
[*] New additions
 *  Future-flow and DNS API exposed to lua detector.
 *  Double VLAN tagging support.
[*] Improvements
 *  Performance improvements to AppID.
 *  Stability improvements to file and ftp_telnet preprocessor.
 *  Fixed several issues with SDF and obfuscation.
 *  Resolved an issue of improper handling of malformed DNS host
    in AppID.
 *  HTTP PAF accepts all tokens between method and version strings
    in a request URI.
 *  Resolved snort build issue with "--disable-perfprofiling" configure
    option.
 *  Enhanced mime parsing by adding support for detecting files
    after unknown headers and no headers.
 *  Fixed issue with gzip decompression. If the server response specifies
    Content-Encoding as GZIP, but no Content-Length field for HTTP ver 1.0.
 *  End of Header(EOH) identification for HTTP response header spanning multiple
    packets.
 *  Improved packet reassembly for HTTP.
 *  Fixed Flash LZMA decompression issue.

For details see:
https://www.snort.org/downloads/snort/changelog_2.9.8.2.txt

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2016-05-21 11:35:11 +02:00
Matthias Fischer
b6f571fa88 snort: Update to 2.9.7.6
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-11-04 21:18:56 +00:00
Matthias Fischer
8d29504c4d snort: Update urls for rules download (2.9.7.0) in 'ids.cgi' 2014-11-05 19:20:59 +01:00
Erik Kapfer
b3f401fba4 ids.cgi fix snort rules download url.
fixes: 10579
2014-07-29 22:31:26 +02:00
Stefan Schantl
ace810a3f8 snort: Update url's for rule download. 2014-05-17 15:27:21 +02:00
Alf Høgemark
f8aa06792f cgi-bin: Add title attribute to input type image where missing
Almost all of <input type="image"... has both an alt and a
title attribute, but some are missing title, and when the icon
is not very clear, it makes it harder to understand what the icon
does. By adding title, the browser displays text when mouse pointer
is over the icon.

Also add missing quotes for alt and title attributes where needed.
2014-02-19 18:31:02 +01:00
Alf Høgemark
631b67b7cd cgi-bin: HTML cleanup, add quotes for attribute values 2014-02-15 16:54:38 +01:00
Alf Høgemark
2c01f467d9 cgi-bin and themes: Remove language attribute on script tag 2014-02-15 16:11:45 +01:00
Alf Høgemark
e6d8a42109 ids.cgi: htmlcleanup, change html tags from uppercase to lowercase 2014-02-15 15:46:27 +01:00
Alexander Marx
7cc8a0e526 Layout changes ids.cgi 2014-01-09 15:02:49 +01:00
Arne Fitzenreiter
f2665db1ad snort: update to 2.9.5.3. 2013-08-10 20:10:00 +02:00
Arne Fitzenreiter
a0fa489f2f snort: update to 2.9.5.
add VRT/GPLv2 community rules.
fix wrong oinkcode warning if no oinkcode is needed.
2013-07-15 17:05:44 +02:00
Arne Fitzenreiter
3e30714aa7 snort: fix sourcefire rules downloads. 2013-02-02 09:57:14 +01:00
Arne Fitzenreiter
745d9c0717 Revert "Revert "snort: Update to 2.9.4.""
This reverts commit f17d112c04.
2013-02-02 09:50:49 +01:00
Arne Fitzenreiter
d095947fed snort: updated ruleset download url for new snort. 2012-11-03 16:29:53 +01:00
Arne Fitzenreiter
89f3d66c24 snort: update to 2.9.1.2. 2011-11-27 12:50:19 +01:00
Christian Schmidt
c07e938edb Updated snort to current stable, This is a large changeset.
Updated snort and daq. Snort detection engine is changed and some preprocessors have been updated.
2011-03-14 18:52:11 +01:00