Commit Graph

2855 Commits

Author SHA1 Message Date
Adolf Belka
dcc2f7e0f2 ovpnmain.cgi: Fix for bug #12865 - Static IP address pools - Add network - Name with space
- The fix for bug #12428 removed spaces from the validhostname subroutine as hostnames are
   not supposed to have spaces
- This resulted in spaces no longer being allowed for the Static IP Address Pools names
- New subroutine created called validccdname in general-functions.pl

Fixes: Bug #12865
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
2022-06-25 09:14:22 +00:00
Adolf Belka
f158e71e20 ovpnmain.cgi: Fix for bug #12883 - separate .p12 file corrupted
- Patch https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2feacd989823aa1dbd5844c315a9abfd49060487
   from May 2021 put the variable containing the .p12 content into double quotes which
   causes the contents to be treated as text whereas the .p12 file is an application file.
- Most people must be downloading the zip package of .p12, ovpn.conf and ta.key files so
   the problem was not noticed till now and flagged up in the forum.
   https://community.ipfire.org/t/openvpn-p12-password-on-android-problem/8127
- The problem does not occur for the .p12 file in the zip file as the downloading of the
   zip file does not have the variable name in double quotes.
- Putting the zip file variable into double quotes caused the downloaded zip file to be
   corrupt and not able to be opened as an archive.
- Removing the double quotes from the .p12 variable name caused the separate .p12 file
   download to be able to be correctly opened.
- The same quoted variable name is used also for the cacert.pem, cert.pem, servercert.pem
   and ta.key file downloads. To be consistent the same change has been applied to these.

Fixes: Bug #2883
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-23 13:24:03 +00:00
Peter Müller
34798dcd50 vulnerabilities.cgi: Add MMIO Stale Data
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-22 18:11:11 +00:00
Peter Müller
39c9a69406 Run ./make.sh update-contributors
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-17 16:49:57 +00:00
Timo Eissler
3740b7ad3a ovpnmain.cgi: URI encode OTPAuth String in QRCode
Signed-off-by: Timo Eissler <timo.eissler@ipfire.org>
2022-06-17 10:22:31 +00:00
Timo Eissler
209d62f005 ovpnmain.cgi: Remove trailing newline from OTP secret
Signed-off-by: Timo Eissler <timo.eissler@ipfire.org>
2022-06-17 10:22:31 +00:00
Timo Eissler
10b32d3895 ovpnmain.cgi: Fix OTP secret handling
Convert stored hex OTP secret to binary prior to converting to base32.
2022-06-17 10:20:19 +00:00
Timo Eissler
16d4a5c264 ovpnmain.cgi: Fix comparison operators 2022-06-17 10:20:18 +00:00
Michael Tremer
a999886759 openvpn-2fa: Configure fake authentication credentials
These configuration option are required to make the client authenticate
itself against the server.

The server may then accept those credentials without any further ado or
ask for a OTP.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-17 10:20:18 +00:00
Michael Tremer
5111dc3df3 openvpn-2fa: Enable management socket for RW server
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-17 10:20:18 +00:00
Michael Tremer
6834749d22 openvpn-2fa: Drop the previous authentication handler
This has been replaced by the newer authenticator

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-17 10:20:18 +00:00
Michael Tremer
c63a54f090 ovpnmain.cgi: Load all modules at the beginning
Although Perl modules tend to take a long time to load, it is better to
do this at the beginning so that loading the script will show any
errors.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-17 10:20:18 +00:00
Michael Tremer
2050be20e1 ovpnmain.cgi: Disable sending any error messages to the browser again
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-17 10:20:18 +00:00
Timo Eissler
e1e10515ec OpenVPN: Add support for 2FA / One-Time Password
Add two-factor authentication (2FA) to OpenVPN host connections with
one-time passwords.

The 2FA can be enabled or disabled per host connection and requires the
client to download it's configuration again after 2FA has beend enabled
for it.
Additionally the client needs to configure an TOTP application, like
"Google Authenticator" which then provides the second factor.
To faciliate this every connection with enabled 2FA
gets an "show qrcode" button after the "show file" button in the
host connection list to show the 2FA secret and an 2FA configuration QRCode.

When 2FA is enabled, the client needs to provide the second factor plus
the private key password (if set) to successfully authorize.

This only supports time based one-time passwords, TOTP with 30s
window and 6 digits, for now but we may update this in the future.

Signed-off-by: Timo Eissler <timo.eissler@ipfire.org>
2022-06-17 10:20:17 +00:00
Jon Murphy
574f453853 ovpnmain.cgi: correct spelling
- change "coment" to "comment"

Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-11 14:34:31 +00:00
Leo-Andres Hofmann
64db1faf67 manualpages: Add path and file extension to the configuration
This allows to correctly assign an URL to a file without relying
on unique base names.
A custom read function is required because General::readhash()
doesn't allow paths as hash keys. Modifying the existing functions
could affect other CGIs and was therefore dismissed.

Fixes: #12806

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
2022-06-04 09:23:42 +00:00
Peter Müller
4f4b7fbc13 Update contributor list
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-05-30 20:00:53 +00:00
Leo-Andres Hofmann
2b5253bbbb pakfire.cgi: Cosmetic fixes
Add formatting to improve readability of dependencies list header.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
2022-05-08 13:13:21 +00:00
Leo-Andres Hofmann
3706e0a5b3 pakfire.cgi: Discard tac stderr output
Prevents meaningless "broken pipe" messages in the httpd error log.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
2022-05-08 13:13:21 +00:00
Leo-Andres Hofmann
85d570843e pakfire.cgi: Implement Post/Redirect/Get pattern
Refreshing the Pakfire page may cause a command to be
executed multiple times and induce odd errors.

This patch implements a HTTP 303 redirect after form processing,
which causes the browser to discard the POST form data.
Navigating backward or reloading the page now does not trigger
multiple executions anymore.

Fixes: #12781

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
2022-05-08 13:13:21 +00:00
Leo-Andres Hofmann
3cdb83939b pakfire.cgi: Notify user if Pakfire is already performing a task
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
2022-05-08 13:13:21 +00:00
Leo-Andres Hofmann
4b5d1f3001 pakfire.cgi: Show error and log messages earlier
The main page cannot be used while an installation is running.
Therefore it makes more sense to generate the log output first.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
2022-05-08 13:13:20 +00:00
Leo-Andres Hofmann
0f506a130c pakfire.cgi: Fix indentation
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
2022-05-08 13:13:20 +00:00
Leo-Andres Hofmann
cd521e78b8 pakfire.cgi: Separate command processing and HTML generation
Move most of the command execution away from the HTML output.
This makes it easier to modify or extend individual commands.

Also load Pakfire settings earlier to ensure that they are
available during command execution.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Acked-by: Peter Müller <peter.muelle@ipfire.org>
2022-05-08 13:13:20 +00:00
Peter Müller
b6fe8ee88d Run ./make.sh update-contributors
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-05-05 16:24:20 +00:00
Peter Müller
4d4f5df0c8 Merge branch 'temp-stevee-idsv4' into next 2022-05-05 16:07:41 +00:00
Stefan Schantl
1a9e81ce7f ids.cgi: Remove etag data when deleting a provider.
Otherwise the same provider could not be added again at a later
time if the stored etag is still valid.

In this case the server will not offer the rules and the provider
could not be added.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-26 05:24:47 +02:00
Peter Müller
aa2ab8c40b Run ./make.sh update-contributors
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-24 19:14:49 +00:00
Leo-Andres Hofmann
154dfcb7a2 wakeonlan.cgi: Fix meta refresh tag
This fixes an HTML error that is briefly visible
on the "magic packet sent" page.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-24 19:13:51 +00:00
Matthias Fischer
52f8118635 media.cgi: Added translation for 'inodes'
For details see:
https://en.wikipedia.org/wiki/Inode

or

http://www.linfo.org/inode.html ;-)

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
2022-04-24 19:08:34 +00:00
Leo-Andres Hofmann
cdf0522ec2 HTML: Add language attribute
This attribute is recommended by W3C, because it is used by
screen readers to provide the correct pronunciation.

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-24 14:21:49 +00:00
Peter Müller
bad8659d80 Do not mark CGI files as executable, second round
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-23 19:36:57 +00:00
Peter Müller
c04309ef01 Do not mark CGI files as executable
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-23 19:35:37 +00:00
Leo-Andres Hofmann
c13060fd4c menu: Fix warnings, clean code
This patch adds default values and removes a missing translation
to fix "uninitialized value" and "odd number of elements" warnings.

Removes function calls from functions.pl that have already been
handled by the header before it is loaded by eval().

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
2022-04-23 14:34:00 +00:00
Stefan Schantl
1febad2ad4 ids.cgi: Avoid doubble locking the page when forcing a ruleset update.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-22 05:45:56 +02:00
Stefan Schantl
07dc722f61 ids.cgi: Make the page lock in oinkmaster_web() function optional.
This allows to call and release the page lock manually.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-22 05:44:23 +02:00
Stefan Schantl
eaf5364413 ids.cgi: Disable manual update button if a provider is not longer
supported.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-17 15:21:20 +02:00
Stefan Schantl
6bef05b9ed ids.cgi: Proper handle providers which are not longer supported.
They will be shown with a different background colour to get the users
attention.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-17 15:03:56 +02:00
Stefan Schantl
da5c7c24f0 ids.cgi: Remove orphaned headline.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 16:02:28 +02:00
Stefan Schantl
5bad33e9a4 ids.cgi: Display return code on download error, when adding a new
provider.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 15:32:27 +02:00
Stefan Schantl
00271ed769 ids.cgi: Handle "Not modified" when forcing an ruleset update.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 15:30:03 +02:00
Stefan Schantl
b645f7fc86 ids.cgi: Do not longer use hard-coded status messages in
oinkmaster_web() function.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 15:12:58 +02:00
Stefan Schantl
a15c9b16b4 IDS: Move autoupdate logic to cron.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-15 05:59:33 +02:00
Stefan Schantl
2f154264a0 ids.cg: Regeneate ruleset if the ruleset action (mode) of a provider
get changed.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-14 05:16:25 +02:00
Stefan Schantl
149a3291df ids.cgi: Do not double display a working notice when removing a ruleset
provider.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-11 05:47:15 +02:00
Stefan Schantl
faa8c62f63 ids.cgi: Use new oinkmaster_web function instead the silent one from
ids-functions.

This will print some nice status messages while the page is locked and
the IDS rules get regenerated/altered.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-10 11:25:36 +02:00
Stefan Schantl
44d41fd692 ids.cgi: Add oinkmaster_web () function.
This function is used to regenerate the entire ruleset similar to the
one from ids-functions, but is enhanced to print additional status
messages.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-10 11:23:49 +02:00
Stefan Schantl
1aaa347774 ids.cgi: Allow to split working_notice function into two parts.
This allows to open the notice and close it at a later time.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-10 11:19:41 +02:00
Stefan Schantl
25652a75d4 ids.cgi: Keep IDS/IPS mode settings when enabling/disabling a provider
or autoupdate for it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-10 11:17:05 +02:00
Stefan Schantl
30c4a9ff35 ids.cgi: Adjust code to use new used-rulesfiles backend.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-09 15:00:21 +02:00