Commit Graph

359 Commits

Author SHA1 Message Date
Matthias Fischer
2bba650947 graphs.pl: Standardize localization strings for entropy graphs
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:21:53 +00:00
Matthias Fischer
03dd66d616 graphs.pl: Standardize localization strings for disk access graphs
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:21:27 +00:00
Matthias Fischer
cc573a98d1 graphs.pl: Standardize temperature displays
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:15:15 +00:00
Michael Tremer
8ffdc78c49 web UI: Add graph for connection tracking
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:13:10 +00:00
Matthias Fischer
fa088214bc graphs.pl: Added translation for 'ACPI Thermal Zone'
This patchset is based on https://git.ipfire.org/?p=people/ms/ipfire-2.x.git;a=commitdiff;h=4bf0d000ffe961cdc5d9dbd27b3a11f900b3daed

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:10:29 +00:00
Michael Tremer
6fc3625512 graphs: Fix rendering CPU graphs after number of cores decreased
Fixes: #12193 - cpu graphs cannot created if smt is disabled
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-09-19 19:05:46 +00:00
Michael Tremer
087e302381 general-functions.pl: Do not check IPsec subnets for VTI/GRE connections
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-08-20 17:56:03 +00:00
Peter Müller
cc9eb2d306 network-functions.pl: add missing unit tests for changed, network membership procedure
Cc: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Cc: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-07-28 18:37:32 +00:00
Peter Müller
6386584baa network-functions.pl: fix network membership test
This is based on an orphaned patch provided by Tim FitzGeorge and
_finally_ fixes incorrect network membership calculations. Those were
are usability pain in the ass deluxe, as they rendered some combinations
of configuring OpenVPN and IPsec services unusable.

Fixes: #11235
Fixes: #12263

Cc: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Cc: Michael Tremer <michael.tremer@ipfire.org>
Cc: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-07-28 18:37:25 +00:00
Stefan Schantl
af7f9fc43d :xMerge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-switch-to-libloc
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-07-03 18:48:30 +02:00
Michael Tremer
46b0f9ab44 web: Hide certain menu items when running in cloud environments
This used to be only hidden on AWS.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-06-19 17:14:58 +00:00
Michael Tremer
e7978f5671 gcloud: Add function to detect whether we are running on GCP
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-06-19 17:14:58 +00:00
Michael Tremer
4e58ab4bbf aws-functions.pl: Drop file and move functions to general-functions.pl
There is not enough stuff that it is justified to have an own file.

This patch therefore merges everything into general-functions.pl.

There are no functional changes.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-06-19 17:14:58 +00:00
Stefan Schantl
48152fae62 Transform geoip-functions.pl into location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 17:42:41 +02:00
Stefan Schantl
e7b1b002c9 Revert "geoip-functions.pl: Add functions to export locations and to flush them."
This reverts commit e758c76384.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-10 21:27:06 +02:00
Stefan Schantl
51b6f07ce5 geoip-functions.pl: Provide the available locations in upper case.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-03 19:29:55 +02:00
Stefan Schantl
decef80c7e geoip-functions.pl: Remove non existing country codes.
o1 (Other country) and yu (Yugoslavia) have been used in the past
and are not part of libloc and therefore cannot be used anymore.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-03 19:15:43 +02:00
Stefan Schantl
8b58dbf32a Merge branch 'switch-to-libloc' into next-switch-to-libloc 2020-05-25 19:58:54 +02:00
Michael Tremer
7479c99349 ids-functions.pl: Quote array of subnets
Reported-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-20 12:39:17 +00:00
Stefan Schantl
adb320bc4a ids-functions.pl: Fix generating of HOME_NET declaration
Fixes #12407.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-18 20:09:07 +00:00
Peter Müller
33954320f9 graph.pl: fix intendation of user CPU load
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-09 12:17:35 +00:00
Peter Müller
a0774e3cc8 system.cgi: properly translate load average graph
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-09 12:17:23 +00:00
Peter Müller
e01c49b466 graphs.pl: use brackets instead of hypens
This simply makes more sense in most languages, as INPUT, OUTPUT and
FORWARD are special cases of firewall hits in general.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-09 12:14:01 +00:00
Peter Müller
992f944b3b graphs.pl: fix spelling of "SYN"
This merely is a cosmetic change, but since we are dealing with network
packets here, the SYN flag must be capitalised.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-09 12:12:35 +00:00
Stefan Schantl
25932be3e3 general-functions.pl: formatBytes() Fix computing the correct unit.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:14:36 +00:00
Stefan Schantl
c5f85b1152 general-functions.pl: Add formatBytes() function.
This function can be used to convert an amount of bytes to a
humand-readable format.

For example "3221225472" will become "3MB".

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:12:40 +00:00
Stefan Schantl
e698090e7f IDS: Dynamically generate and import the HTTP ports.
With this commit suricata reads the HTTP port declarations from a newly
introduced external file
(/var/ipfire/suricata/suricata-http-ports.yaml).

This file dynamically will be generated. HTTP ports always are the
default port "80" and "81" for update Accelerator and HTTP access to the
WUI. In case the Web-proxy is used, the configured proxy port and/or Transparent
Proxy port also will be declared as a HTTP port and written to that file.

In case one of the proxy ports will be changed, the HTTP port file will
be re-generated and suricate restarted if launched. Also if an old
backup with snort will be restored the convert script handles the
generation of the HTTP ports file.

Finally the suricata-generate-http-ports-file as a tiny script which
simply generates the http ports file and needs to be launched during the
installation of a core update. (The script will no be required
anymore, so it could be deleted afterwards.)

Fixes #12308.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-06 14:04:00 +00:00
Stefan Schantl
7b97359b99 IDS: Add GREEN and BLUE addresses to the list of DNS servers.
Fixes #12349.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-05 07:35:08 +00:00
Arne Fitzenreiter
e8adbea97b general-functions.pl: Return unique list of nameservers
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-30 13:13:46 +01:00
Arne Fitzenreiter
99cadb743a ids-functions.pl: Fall back to $EXTERNAL_NET for DNS servers
When no DNS servers are configured (aka recursor mode), the
DNS servers that unbound will try to contact can be anywhere.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-30 13:07:01 +01:00
Arne Fitzenreiter
b76118c32c ids-functions.pl: Fix generating DNS_SERVERS
The configuration file has an invalid syntax which causes
suricata to fail to start.

There was no comma inserted between DNS servers when there
was more than two of them. This is now fixed in this patch..

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-30 12:51:31 +01:00
Stefan Schantl
612bb2dff9 ids-functions.pl: Introduce file for local rules.
This file is to be used, to store customized IDS rules.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-25 15:04:39 +00:00
Stefan Schantl
12c49915d8 ids-functions.pl: Update generate_dns_servers_file() function.
The function now uses the newly introduced get_nameservers() function
while generating the DNS servers file.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-09 16:25:01 +01:00
Stefan Schantl
c8dcd46537 general-functions.pl: Add get_nameservers().
This function simply return an array of all used nameservers.

It also takes care if the usage of ISP assigned nameservers
is enabled or not and if user-added nameservers are enabled or not.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-09 16:08:13 +01:00
Stefan Schantl
9702252470 dns.cgi: Move grab_address_from_file function to general-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-08 18:44:41 +01:00
Peter Müller
fd2dccaabb Core Update 139: fix syntax of generated Suricata DNS server file
The YAML syntax of /var/ipfire/suricata/suricata-dns-servers.yaml was
invalid and caused Suricata to crash after upgrading to Core Update 139.

Due to strange NFQUEUE behaviour, this caused IPsec traffic to be
emitted to the internet directly. While this patch represents a quick
solution for Core Update 139, another one is needed for changing the
IPtables chain order to avoid similar information leaks in future.

Thanks to Michael for his debugging effort.

Fixes #12260
Partially fixes #12257

Cc: Michael Tremer <michael.tremer@ipfire.org>
Cc: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-14 07:26:05 +00:00
Stefan Schantl
ec1c52633e geoip-functions.pl: Add get_continent_code()
This function allows to recieve the continent code of a given
country (code).

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-12-12 12:07:34 +01:00
Stefan Schantl
a3afe9058f geoip-functions.pl: Adjust location_dir
The data directory upstream has been moved to "/var/lib/location".

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-12-12 09:39:34 +01:00
Stefan Schantl
e758c76384 geoip-functions.pl: Add functions to export locations and to flush them.
The export_locations() function requires an array of country codes which
should be exported by the location-exporter script.

The flush_exported_locations() function is used to flush (delete) all
exported location files.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-12-09 11:05:31 +01:00
Stefan Schantl
9b2594d8e6 geoip-functions.pl: Export variables.
This easily allows to use them in other perl script.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-12-08 18:10:12 +01:00
Stefan Schantl
8a64d10f24 geoip-functions.pl: Use libloc instead of maxmind for address lookups.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-12-06 14:20:31 +01:00
Stefan Schantl
e34dbea747 geoip-locations.pl: Rework method to grab and handling GeoIP locations.
Now directly get the locations which are part of ISO 3166 from the perl
Locale::Country module. In case it is not listed there grab the country
code and location name from a hash.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-12-06 13:58:20 +01:00
Stefan Schantl
30ee98e949 ids-functions.pl: Introduce generate_dns_servers_file()
This function is used to generate a yaml file which take care of the
current used DNS configuration and should be included in the main
suricata config file.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-13 19:13:09 +00:00
Alexander Marx
cc724c142a BUG12070: Its not possible to use the underscore in email addresses
Using IPFire's Mailservice does not allow to enter a senders mail address with the underscore.
The function used to verify that is used from general-functions.pl.
Now the function 'validemail' allows the underscore in the address.

Fixes: #12070

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-18 09:12:49 +01:00
Stefan Schantl
81bae51f61 ids-functions.pl: Rework function write_modify_sids_file().
Directly implement the logic to determine the used ruleset and if
IDS or IPS mode should be used into the function instead of pass those
details as arguments.

This helps to prevent from doing this stuff at several places again and again.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-05 12:41:49 +01:00
Tim FitzGeorge
a5ba473c15 suricata: correct rule actions in IPS mode
In IPS mode rule actions need to be have the action 'drop' for the
protection to work, however this is not appropriate for all rules.
Modify the generator for oinkmaster-modify-sids.conf to leave
rules with the action 'alert' here this is appropriate.  Also add
a script to be run on update to correct existing downloaded rules.

Fixes #12086

Signed-off-by: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Tested-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-05 12:39:57 +01:00
Stefan Schantl
fefb5173cf ids-functions.pl: Do not delete the whitelist file on rulesdir cleanup.
Fixes #12087.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-05-26 16:09:21 +02:00
Peter Müller
40407aee99 ids.cgi: Fix upstream proxy validation
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-05-20 18:50:06 +01:00
Florian Bührle
1dcf513a41 webif: Add a GUI for configuring VLAN interfaces
This patch adds a new CGI file which allows users to edit the
VLAN configuration as well as configuring zones as bridges.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-05-08 12:15:27 +01:00
Michael Tremer
2dd5e64592 suricata: Do not always convert rules to be bi-directional
This creates some overhead that we do not need and rules need to
be adjusted to match any direction they are supposed to match.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-23 20:18:07 +01:00