Commit Graph

2016 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
Erik Kapfer
32405d88b0 OpenVPN: Deleted mtu-disc completely since it has been dropped.
Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-10 18:40:39 +01:00
Erik Kapfer
400c8afd98 OpenVPN: x509 and DH-parameter check with Warnings and error messages in WUI
Changes includes:
Own crypto warning and error message in WUI (can be extended to configuration too).
Check if DH-parameter is < 2048 bit with an error message and howto fix it.
Check if md5 is still in use with an error message and suggestion how to proceed further to fix it.
Check for soon needed RFC3280 TLS rules compliants and suggestion how to proceed further to fix it.
Disabled 1024 bit DH-parameter upload.
Changed de and en language files for DH-parameter upload (deleted 1024 bit).
Added explanations to de and en language files for the above changes.
Fixed Typo in en language file.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-03 15:32:48 +01:00
Michael Tremer
55d590518d Revert "OpenVPN: Clarify fundamental crypto errors but also warnings in WUI"
This reverts commit 15a3aa45cf.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-03 15:32:42 +01:00
Erik Kapfer
15a3aa45cf OpenVPN: Clarify fundamental crypto errors but also warnings in WUI
Since OpenVPN-2.4.x, a lot of changes has been introduced. This patch should help the users for better understanding of errors in the cryptography.
It includes also potential warnings for upcoming changes and needed adjustments in the system.
This can also be extended in the future for upcoming configuration changes.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-03 10:34:41 +01:00
Erik Kapfer
8ae4010b31 OpenVPN: Prevent internal server error cause of bad header wrapper
This fixes #11772 .

If the X509 are deleted, the openvpnctrl output generates a bad header wrapper error from the CGI
which causes an internal server error. The redirection of the openvpnctrl output fixes this.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-03 10:34:29 +01:00
Stefan Schantl
a4a1f16c17 guardian.cgi: Remove support for owncloud
Owncloud as an addon has been dropped for IPFire. As a result of this,
we do not need this code anymore.

Fixes #11572.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-03 10:33:43 +01:00
Peter Müller
05375f1275 add ChaCha20/Poly1305 to IPsec WebUI
The algorithm is selected by default since it is considered
to be both secure and state-of-the-art. This required Linux kernel
> 4.2, which is satisfied by Core Update 2.12 122.

Fixes #11549

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-01 13:34:34 +01:00
Michael Tremer
a44eed2536 proxy.cgi: The group name cannot be in quotes
Squid interprets the quotes as part of the group name, too

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-01 12:38:48 +01:00
Michael Tremer
46a5bac6ed vpnmain.cgi: Remove unused code that prevented the page from loading without GREEN
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-01 12:24:25 +01:00
Erik Kapfer
e3dda65eba OpenVPN: Delete 1024 bit DH-parameter from menu
Since OpenVPN-2.4.x do not accepts 1024 bit DH-parameter for security concerns anymore,
    it has been removed from the menu.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-19 11:31:19 +01:00
Erik Kapfer
beac479f2d OpenVPN: Prevent that a Roadwarrior name will be set two times
Fixes bug #11307

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-18 16:48:24 +01:00
Erik Kapfer
87ea30ff56 OpenVPN: Fix upload check for root and host certificate
Fix for #11766 .
Since the new OpenSSL output differs in the 'Subject' section, the regex needed to be adapted.
Old and new output should now be possible.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-18 16:31:48 +01:00
Erik Kapfer
c0a7c9b278 OpenVPN: Set default of 730 days for client certificate validity
Since OpenSSL 1.1.0x it is required to set a value for the 'valid til (days)' field.
The WUI delivers now a guide value of two years.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-18 15:49:24 +01:00
Erik Kapfer
425465ede9 OpenVPN: Valid til days is required with OpenVPN-2.4.x
Check has been integrated that the OpenSSL maximum of '999999' valid days can not be exceeded.
Check for needed entry in 'Valid til days' field has been integrated.
Asterisk for 'Valid til days' field has been set to mark it as required field.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-18 15:06:20 +01:00
Michael Tremer
5f12becaa7 ovpnmain.cgi: Add missing closing bracket
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-18 14:11:39 +01: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
Michael Tremer
237f3ab7d3 IPsec: Allow to configure a connection in waiting state
This allows to create an IPsec connection that will never actively
try to reach the other peer. It helps in environments where this is
not desired or impossible because of NAT.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-13 15:47:57 +01:00
Michael Tremer
9b656e7f40 entropy: Don't show message for HWRNGs any more
We cannot reliably detect this with the new kernel
and therefore cannot show this.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-22 20:31:12 +01:00
Peter Müller
d8ef6a9537 display country data for remote IPs on ovpnmain.cgi
This makes debugging easier, especially when it comes to
GeoIP related firewall rules and database related issues
such as #11482.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-09 14:51:20 +01:00
Peter Müller
ea566f8485 fix aesthetic issues in remote.cgi and ship them
Fix some minor cosmetic issues on remote.cgi as well as a typo in
the language files ("sesstions" -> "sessions"). The changes are
listed in "filelists" for Core Update 121.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-09 14:49:48 +01:00
Alexander Marx
6d92ee11de BUG11559: fwhosts
When creating firewallrules or using firewall groups,
it should be possible to select a single IpSec subnet if there is more than one.

This patch adds the changes to the firewall groups.
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Tested-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-09 14:48:46 +01:00
Alexander Marx
93a017cbcf BUG11559: firewall.cgi
When creating firewallrules or using firewall groups,
it should be possible to select a single IpSec subnet if there is more than one.

This patch has the changes for firewall.cgi
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Tested-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-09 14:48:41 +01:00
Peter Müller
9159bd4bbe display active logins at remote.cgi
Display active user logins (both local and remote) at
the remote.cgi page in the WebUI. This might be useful
for debugging broken SSH sessions or simply checking that
nobody is currently logged in. :-)

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-07 11:37:10 +01:00
Peter Müller
40a930bda5 BUG:11312 Fix renaming GeoIP groups
When renaming a GeoIP Group, the corresponding names in
firewallrules (if any) are not changed accordingly. Now
when changing a GeoIP Group the firewallrules are renamed
correctly.

Slightly improved first version of this patch (contained
a blank line with trailing whitespace). No functionality
changed, patch has been confirmed as working correctly.

Fixes: #11312
Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-04-27 11:04:05 +01:00