Commit Graph

2395 Commits

Author SHA1 Message Date
Stefan Schantl
4979ba0aaf ipinfo.cgi: Fix calling get_continent_code().
This function is provided by the Location perl module and directly can
be called.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-07-08 19:28:36 +02: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
Arne Fitzenreiter
96253783d4 update credits.cgi and langs doku
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-07-02 11:22:17 +00:00
Peter Müller
0f8251fe64 Revert "proxy: Remove AUTH_IPCACHE_TTL"
This reverts commit dc637f087f.

Rationale: "authenticate_ip_ttl" can be safely used as it does not
introduces an authentication bypass, but saves relationships between
successfully authenticated users and their IP addresses.

"max_user_ip" depends on such an authentication cache, so credential
sharing between several IPs (on purpose or by chance) can be detected
properly. This is useful in case of crompromised machines and/or
attackers in internal networks having stolen proxy authentication
credentials.

Quoted from squid.conf.documented or man 5 squid.conf:

>       acl aclname max_user_ip [-s] number
>         # This will be matched when the user attempts to log in from more
>         # than <number> different ip addresses. The authenticate_ip_ttl
>         # parameter controls the timeout on the ip entries. [fast]
>         # If -s is specified the limit is strict, denying browsing
>         # from any further IP addresses until the ttl has expired. Without
>         # -s Squid will just annoy the user by "randomly" denying requests.
>         # (the counter is reset each time the limit is reached and a
>         # request is denied)
>         # NOTE: in acceleration mode or where there is mesh of child proxies,
>         # clients may appear to come from multiple addresses if they are
>         # going through proxy farms, so a limit of 1 may cause user problems.

Fixes: #11994

Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-07-01 12:08:10 +00:00
Peter Müller
abbec6069a proxy.cgi: remove old CVS licence clutter
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-07-01 12:08:08 +00:00
Stefan Schantl
d3f7af8144 fwhosts.cgi: Fix function call.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-13 19:10:38 +02:00
Arne Fitzenreiter
e9c62e37f4 vulnerabilities.cgi: add srdbs (CVE-2020-0543)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-06-13 12:23:46 +02:00
Stefan Schantl
942b662b6b credits.cgi: Remove hint about used MaxMind database and software.
We do not rely anymore on data and software from this vendor, so
we safely can drop this notice.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 20:04:21 +02:00
Stefan Schantl
9aadc465a3 fwhosts.cgi: Rework code to use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 19:46:24 +02:00
Stefan Schantl
10ef824bb7 firewall.cgi: Rework to use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 19:31:41 +02:00
Stefan Schantl
69d431e41a remote.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:52:19 +02:00
Stefan Schantl
e2e270e1db ovpnmain.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:51:03 +02:00
Stefan Schantl
0893eef4cc tor.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:48:24 +02:00
Stefan Schantl
e43b7b7b2d netexternal.cgi: Remove GeoIP related code.
The CGI only loaded geoip-functions.pl and initiated libloc but did no
further actions. So we are safe to completely remove this code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:45:56 +02:00
Stefan Schantl
4f6d5b3ef3 logs.cgi/showrequestfromcountry.dat: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:44:29 +02:00
Stefan Schantl
43970d7cfc logs.cgi/firewalllogip.dat: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:42:23 +02:00
Stefan Schantl
1b024e999e logs.cgi/firewalllogcountry.dat: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:09:46 +02:00
Stefan Schantl
e4f1e36c9f logs.cgi/firewalllog.dat: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:07:55 +02:00
Stefan Schantl
dca3f2075b ipinfo.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:02:51 +02:00
Stefan Schantl
4346cb6660 dns.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 17:59:43 +02:00
Stefan Schantl
d1a23835db country.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 17:53:29 +02:00
Stefan Schantl
3d3fbe7dc4 connections.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 17:51:00 +02:00
Stefan Schantl
273618daf9 Transform geoip-block.cgi into location-block.cgi
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 17:44:48 +02:00
Stefan Schantl
cf45236b2a Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-switch-to-libloc 2020-05-26 19:02:48 +02:00
Michael Tremer
75bb55e716 openvpn: Create database schema if not exists
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-26 11:12:23 +00:00
Stefan Schantl
8b58dbf32a Merge branch 'switch-to-libloc' into next-switch-to-libloc 2020-05-25 19:58:54 +02:00
Arne Fitzenreiter
b2896abb64 update credits.cgi
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-20 09:15:36 +00:00
Peter Müller
33389bfe67 optionsfw.cgi: properly translate on/off radio buttons
This patch also scrubs a forgotten Smoothwall comment and replaces it by
our IPFire template. :-)

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-09 12:17:53 +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
Erik Kapfer
73735ad99c OpenVPN: Fix for N2N plausibility checks
Fixes #12335
If no N2N name has been set, no directory and config has been created so it can not be deleted.

'goto VPNCONF_ERROR;' has been missing for N2N checks.
Fixed also code formatting.

Signed-off-by: Erik Kapfer <ummeegge@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-09 11:42:24 +00:00
Michael Tremer
708f2b7368 openvpn: Add metrics script
This script is called when an OpenVPN Roadwarrior client
connects or disconnect and logs the start and duration
of the session.

This can be used to monitor session duration and data transfer.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:18:00 +00:00
Michael Tremer
186c0ddd91 OpenVPN Log: Add connection duration
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:15:25 +00:00
Stefan Schantl
b10612e8ba ovpnclients.dat: Align traffic values to the right side.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:14:58 +00:00
Stefan Schantl
7b54c0fb7b ovpnclients.dat: Fix type in received.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:14:48 +00:00
Stefan Schantl
e1cc1e6cb9 ovpnclients.dat: Do not perform DB actions if there is an error message.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:14:21 +00:00
Stefan Schantl
0f195a5305 ovpnclients.dat: Display error when the to date is not later than the from date.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:14:11 +00:00
Stefan Schantl
c7d55d7fbd ovpnclients.dat: Display a notice if there are no entries.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:13:57 +00:00
Stefan Schantl
1242cb0134 ovpnclients.dat: Convert timestamps into localtime.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:13:46 +00:00
Stefan Schantl
d5b6023c32 ovpnclients.dat: Add table header.
The header will be dynamically generated, according the items which will
be displayed.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:13:28 +00:00
Stefan Schantl
8615383823 ovpnclients.dat: Display traffic details in a human-readable format.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:12:51 +00:00
Stefan Schantl
6317d55c4a ovpnclients.dat: Fix hard coded language string
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:12:28 +00:00
Michael Tremer
70e1d58745 OpenVPN: Fix query when selecting sessions only
Previously some sessions were selected which did not qualify
for the search.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:12:10 +00:00
Stefan Schantl
3e10b3de4a openvpn: Add WUI page for client usage statistics
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-05-01 19:11:50 +00:00
Peter Müller
003fb6f608 system.cgi: correctly translate CPU frequency
The CPU frequency diagram used the same "translation" as the CPU load,
which was confusing. This patch introduces a dedicated translation for
"CPU frequency", which makes things a little bit better but still does
not solve a Deppenleerzeichen ("CPU-Frequenz Diagramm") in the German
translation.

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-04-30 15:07:06 +00:00
Matthias Fischer
29f35b79c7 traffic.cgi: Changed time interval for vnstat graphs from 5 to 1 minute
This keeps the graphs a bit more "updated".

From 'man vnstat':
'-c (--cache-time) => Update output file only if at least *time* minutes
have passed since the previous file update.

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-30 14:55:51 +00:00
Arne Fitzenreiter
89445161b0 core144: start update
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-12 08:14:26 +02:00
Michael Tremer
bb90622c2c zoneconf.cgi: Skip checks for non-existing zones
On systems with RED on PPP and no BLUE or ORANGE zones,
there would always be an error when handling non-existant input.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-07 08:58:48 +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
1622e5c1f3 ids.cgi: Fix logic if suricata needs to be restarted.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-06 14:02:59 +00:00
Stefan Schantl
af8e5145fa ids.cgi: Restart suricata if necessary when altering the ruleset.
Suricata does support re-reading it's configuration files and therfore
we need to restart it, if one or more ruleset files should be loaded or
not loaded anymore.

If simple some rules inside the same files are activated or deactivated
we are still fine to call the reload method to send suricata the signal
to reload its ruleset.

Fixes #12340.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-01 14:41:51 +00:00