Commit Graph

131 Commits

Author SHA1 Message Date
Stoiko Ivanov
4685280401 update to acme.sh dns plugins to 3.0.0
fixes #3546

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-08-11 11:52:53 +02:00
Stoiko Ivanov
a5320155c1 acme client: fix #3536 untaint data returned from acme server
The data returned from the acme server (e.g. boulder) should be
considered tainted.

To see which places might need untainted I checked where $self->{ua}
was used (in $self->do) and a quick scan identified __get_result as
the consumer of the tainted data.
In all but one uses the data is decoded from json (which would die if the
result is not valid json).

The remaining use-case yields a certificate in PEM format (and is
handled at the caller of __get_result).

The issue is currently only visible if a proxy is set, because AFAICT
somewhere in SSLeay (or IO::Socket::SSL, which uses SSLeay) a taint
flag is not set on the return value.

A reproducer for the issue:
```

use strict;
use warnings;

use HTTP::Request;
use LWP::UserAgent;

$ENV{PATH} = "/usr/bin:/bin";

my $ua = LWP::UserAgent->new(env_proxy => 0);
my $request = HTTP::Request->new('GET', 'https://google.com/');
my $resp = $ua->request($request);
my $text = substr($resp->decoded_content, 0, 5);;
system("echo \"$text\""); # does work
$request = HTTP::Request->new('GET', 'http://neverssl.com/');
$resp = $ua->request($request);
$text = substr($resp->decoded_content, 0, 5);;
system("echo \"$text\""); # does not work
```

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-08-11 11:52:53 +02:00
Thomas Lamprecht
cd3891a712 bump version to 1.2.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-16 18:06:24 +02:00
Thomas Lamprecht
8e7256570e update to acme.sh dns plugins to 2.9.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-16 18:03:37 +02:00
Stoiko Ivanov
b0d717c72f plugin-caller: make no-ops always successful
proxmox-acme is used to call the dns-plugins from acme.sh and has the
config editing (saving/clearing) turned int no-ops.

bash's `return` statement w/o argument returns the value of the last
executed command (the one before our no-op method was called) (see
`help return` in bash).
This leads to unexpected behavior in some plugins, which call one of
the methods as last statement join the next step with `&&`.

tested bash behavior with:
```
foo() { return; }; if [ -z 'x' ]; then :; else foo ; fi; echo $?
```

reported in our community-forum:
https://forum.proxmox.com/threads/pmg-acme-dns-with-cyon-failing-to-issue-certificate.92762

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-16 17:58:48 +02:00
Stoiko Ivanov
79364a8c54 plugin-caller: add missing methods from acme.sh
As reported in our community forum [0] certain dns plugins use code
from `acme.sh`, which is currently not in our proxmox-acme.

I initially only added _sign and it's callees, but then though about
trying to get all missing methods somehow (only resethttp() was
missing in addition).

The heuristic used to get all missing methods was grepping for '\b_'
in all dns plugins and then removing:
* declarations in proxmox_acme (already present)
* methods declared in the plugins themselves
* $_.* (or ${_.*) - variable use
* comments

in shell:
```
present=$(awk 'BEGIN{ORS="|";} /^_/{ gsub(/\(\) {/, ""); print $0}' \
  src/proxmox-acme | | sed -r 's/\|$//')
local=$(awk 'BEGIN{ORS="|";} /^_/{ gsub(/\(\) {/, ""); print $0}' \
  src/acme.sh/dnsapi/dns*.sh | sed -r 's/\|$//')
grep '\b_' src/acme.sh/dnsapi/* | grep -Ev \
  "$present|$local|_[a-zA-Z0-9_-]+=|\\$\{?_|^src/acme.sh/dnsapi/.*sh:#"
```

[0] https://forum.proxmox.com/threads/proxmox-acme-with-transip-plugin-_sign-command-not-found.92582/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-16 17:57:59 +02:00
Thomas Lamprecht
1a9d0b7bad bump version to 1.1.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 18:58:34 +02:00
Stoiko Ivanov
a4ac1b6ee2 fix #3390: standalone: explicitly bind to '::'
This patch follows 2f8be3bfda203065b22e60862e5f98d831a46921 from
pve-common:
Instead of not specifying a listen address, we first try to bind on
'::', which usually accepts connections for both ipv4 and ipv6,
and fall back to '0.0.0.0' if this fails (if ipv6 is disabled via
kernel commandline).

The arguments are the same for HTTP::Daemon as for IO::Socket::IP,
since the former has IO::Socket::IP as base.

Additionally, by setting 'V6Only' explicitly to '0', the listening
socket will also accept ipv4 connections, even if the sysctl
'net.ipv6.bindv6only' is set to 1 - the sysctl provides a default
value, which can be overridden by a socket-option (see ipv6(7) -
IPV6_ONLY).

setting this option results in the following setsockopt-call being
added:
setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0

AFAICT the socket option is available and overridable on Linux > 2.4
see [0] for an explanation of why this might not be wanted

Overriding the default setting set by an admin might be debateable,
but considering that the http-listener for the ACME challenge is
rather short-lived I think this is justified. The only other option
would be to create 2 listening sockets and binding on both - which
would mean reorganizing our perl-deamons to deal with multiple listen
sockets.

quickly tested on a publicly reachable test-machine of mine with:
* ipv6.domain.test (only AAAA record)
* ip46.domain.test (both AAAA and A)
* ipv4.domain.test (only A record)
with:
* sysctl net.ipv6.bindv6only=1 (for all 3 domains)
* disabling ipv6 via kernel-commandline (only ipv4 tested)
* disabling ipv6 via sysctl (only ipv4 tested)
* only configuring an ipv6 address (only ipv6 tested)

[0] https://man.openbsd.org/inet6.4
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-21 09:35:39 +02:00
Thomas Lamprecht
085b9535c4 buildsys: change upload dist to bullseye
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-08 10:29:08 +02:00
Thomas Lamprecht
bd6a54e6f4 bump version to 1.1.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-05 14:32:24 +02:00
Thomas Lamprecht
bf506bfeb0 d/control: fix descriptions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-05 14:32:24 +02:00
Thomas Lamprecht
a19ae07bfb split into two packages: a perl one and an acme.sh plugin one
Main reason for this split is PBS, which only needs the plugins and
would like to avoid the perl one (which pulls in pve-common too)

This includes a few small changes which are technically not direct
part of the split, but related enough:
* change source name of package from libproxmox-acme-perl to
  libproxmox-acme
* make lintian override for script exec permission narrower to avoid
  possible false negatives in the future, really only allow the
  dnsapi ones.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-05 14:32:24 +02:00
Thomas Lamprecht
4195bf0a9a move DNS plugin schema to separate JSON based file
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-05 14:32:15 +02:00
Thomas Lamprecht
5185b076fc buildsys: actually install new plugins
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-05 14:32:15 +02:00
Lorenz Stechauner
da91f53693 dns challenge: add world4you schema
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-05-05 10:48:42 +02:00
Thomas Lamprecht
0663394d2e update acme.sh plugins to 2.8.9 and include new plugins in schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-05 10:00:15 +02:00
Thomas Lamprecht
cb5329e656 debian: set source format correctly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-05 10:00:15 +02:00
Thomas Lamprecht
7c671e3ffe bump version to 1.0.8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-16 17:11:51 +01:00
Thomas Lamprecht
21e6ed3007 dns: add new plugins to schema and install them
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-16 17:04:35 +01:00
Thomas Lamprecht
3721195233 update acme.sh to current master
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-16 17:01:41 +01:00
Wolfgang Bumiller
c617455e64 add missing 'use PVE::Acme' statement
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-03-12 15:59:46 +01:00
Thomas Lamprecht
5bc035dda3 bump version to 1.0.7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-11 19:10:19 +01:00
Thomas Lamprecht
dfc8695d03 acme: define kapper.net and acme-dns schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-11 19:10:19 +01:00
Thomas Lamprecht
394bfcc5be buildsys: ensure new plugins also get installed
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-11 18:54:53 +01:00
Thomas Lamprecht
895b703e20 add basic test so schema is in sync with available plugins
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-11 18:54:53 +01:00
Thomas Lamprecht
da7c723f60 dns challenge: add missing plugins to schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-11 18:43:16 +01:00
Thomas Lamprecht
cd491a0711 bump version to 1.0.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-07 11:59:17 +01:00
Thomas Lamprecht
5fa6f0f615 update acme.sh to 2.8.8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-07 11:53:57 +01:00
Fabian Grünbichler
3704cab609 bump version to 1.0.5
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-09-04 14:01:17 +02:00
Thomas Lamprecht
1192b59586 fix #2732: use actual plugin config data
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-24 00:24:44 +02:00
Thomas Lamprecht
956b5190e4 dns challenge: add 'INWX' acme.sh schema
https://bugzilla.proxmox.com/show_bug.cgi?id=2731

Requested-by: Claas Hilbrecht <Claas.Hilbrecht@linum.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-23 23:55:38 +02:00
Thomas Lamprecht
b21c536ad7 bump version to 1.0.4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 20:07:01 +02:00
Thomas Lamprecht
231ed7c0fd dns challenge: describe digitalocean schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 20:04:56 +02:00
Thomas Lamprecht
ec59606a39 dns challenge: add df (dyndnsfree.de) provider
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 20:04:53 +02:00
Thomas Lamprecht
5cc388d2d6 update acme.sh dns plugins to 2.8.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:57:20 +02:00
Thomas Lamprecht
c69fdfe998 make clean: clean more
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:53:19 +02:00
Thomas Lamprecht
b727e3a6b8 bump version to 1.0.3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 21:50:00 +02:00
Thomas Lamprecht
aa7b91cbf0 dns challenge: provide schema for more providers
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 20:39:56 +02:00
Thomas Lamprecht
345f5a52db trigger activate-noawait pve-api-updates
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 17:29:35 +02:00
Thomas Lamprecht
f3765a2594 bump version to 1.0.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-05 19:19:49 +02:00
Thomas Lamprecht
dfd2aa27fe dns schema: move fields one level deeper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-05 19:18:58 +02:00
Thomas Lamprecht
69ce6537ab dns: complete OVH schema
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-05 18:34:33 +02:00
Dominik Csapak
6372e89801 add note that the data has to be base64 encoded
but only via api, on the cli it is a file which contains
the data in plaintext

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-05 18:29:08 +02:00
Dominik Csapak
6f5be4aa3c DNSChallenge: make plugins a hash with an optional schema
so that we can use that schema to generate form fields in the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-05 18:29:04 +02:00
Thomas Lamprecht
f4ee95aec5 plugin id: limit to 'pve-configid' format
Else one can pass almost arbitrary data as ID and break editing or
deletion of a plugin.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-04 14:54:28 +02:00
Thomas Lamprecht
2a656f9a39 bump version to 1.0.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 18:14:52 +02:00
Thomas Lamprecht
4317ba9937 DNS Challenge: add validation-delay plugin option
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 18:14:52 +02:00
Thomas Lamprecht
d8aac48878 use smart-relative gitmodule path
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 17:17:39 +02:00
Thomas Lamprecht
c1008bfe7e bump version to 1.0.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 17:07:44 +02:00
Thomas Lamprecht
888b6f2c1b use native source format, fix lintian complaints
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 17:07:12 +02:00