Commit Graph

1455 Commits

Author SHA1 Message Date
Thomas Lamprecht
982c37b78e d/control: bump versioned dependency for libpmg-rs-perl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 14:16:19 +02:00
Fabian Ebner
b50c7a1459 api: apt: add calls for repositories
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-13 14:14:58 +02:00
Thomas Lamprecht
b335a91dc6 api: termproxy: sort hash-keys when setting enum
else the api-viewer's dumper may get a false-positive change every
time we update the schema there

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-13 10:36:47 +02:00
Stoiko Ivanov
6ffef3edde nodeconfig: parse acme config before writing
we use `get_acme_conf` as higher level sanity checker (e.g. to ensure
that wildcard certificates have a configured DNS plugin)

(adapted from pve-manger (where this is done in the corresponding API
call)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-13 10:01:43 +02:00
Stoiko Ivanov
a90140cccb acme: check plugin for wildcard certificates
Let's Encrypt currently only issues wildcard certificates if the
domain ownership is validated via a dns-01 type plugin.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-13 10:01:43 +02:00
Stoiko Ivanov
fe0886a975 acme: handle wildcard dns validation
Wildcard DNS names (*.domain.example) are validated through their
base-domain (domain.example) according to the ACME RFC [0].

We store the indirection while parsing the acme config, and check for
an extra validation target during ordering.

This makes it possible to order wildcard certificates which are not
valid for the base-domain.

[0] https://tools.ietf.org/html/rfc8555#section-7.1.3

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-13 10:01:43 +02:00
Thomas Lamprecht
7266d5fd32 bump version to 7.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 22:51:18 +02:00
Stoiko Ivanov
fe2090fbf0 config: freshclam: default to incremental downloads
clamav recently started yielding 429 (too many requests) response
codes on even comparatively low attempts to download the complete
signature files (cvd)(see [0]), instead of the incremental changes
(cdiff) (see [1] for some background)

changing the default to scriptedupdates (a.k.a. cdiff download) seems
sensible for most situations.

[0] https://docs.clamav.net/faq/faq-freshclam.html
[1] https://blog.clamav.net/2021/03/clamav-cvds-cdiffs-and-magic-behind.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-03 22:05:50 +02:00
Stoiko Ivanov
0a05c9d2de utils: fix service_aliases usage
2 errors were introduced in 4f06ff8ac2:

* a typo in the postgresql service name
* it missed the other uses of the service_name hash, apart from the
  lookup_real_service_name sub.

both fixed here

Reported-by: Martin Maurer <martin@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-03 22:05:50 +02:00
Stoiko Ivanov
c56a7321e7 cluster: fix missing import
The missing use PMG::Ticket import is problematic during ACME cert
renewal from pmg-daily->PMG::API2::Certificates->renew_acme_cert,
since pmg-daily does not import it.

Reported-by: Martin Maurer <martin@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-30 18:15:04 +02:00
Thomas Lamprecht
737c6f66ec d/postinst: handle static machine-id from ISO 5.0 <= x <= 6.0
Ported over from commit 8797cc74cd94583130ab4c2f541d1a75b518cfa6
of pve-manager, but with the list of machine-id extracted from PMG
ISOs.

The full map:

PMG 5.0-5  -> "e378bde63ac54872a85af23a8e4dac73"
PMG 5.1-1  -> "932b668d1fad4709b4976d54152d223c"
PMG 5.1-2  -> "931a8410cd034202a26b0e19d56e157a"
PMG 5.2-1  -> "9a1f3c5284e1423c9b0e0ee5819db6c9"
PMG 6.0-1  -> "5472a49c6436426fbebd7881f7b7f13b"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-29 10:42:10 +02:00
Thomas Lamprecht
f68516f02f api: acme: indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-29 09:38:03 +02:00
Thomas Lamprecht
c4f64dd665 bump version to 7.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 16:04:30 +02:00
Thomas Lamprecht
d51799a35c d/control: bump pve-common and pve-http-server dependency versions
To ensure we have the new `upid_normalize_status_type` and the
new http-server listening behavior available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 16:01:22 +02:00
Dominik Csapak
f1a051a0a5 api: tasks: add 'status' filter
like in PVE/PBS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ Thomas: adapt to renamed PVE::Tools helper method ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 16:01:03 +02:00
Dominik Csapak
3c57e59169 api: tasks: add 'since' and 'until' filters
like in PVE/PBS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-28 16:00:45 +02:00
Dominik Csapak
41ee440677 api: tasks: add filter for task-type
Like we have in PVE/PBS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-28 16:00:12 +02:00
Stoiko Ivanov
ea1b766595 fix #2013 spamreport: remove ticket if authmode is ldap
Currently the 'authmode' setting for the spamquarantine is not used
anywhere. According to documentation setting it to 'ldap' should allow
access to the quarantine only with ldap credentials.

This patch addresses the issue by not generating a quarantineticket,
and adapting all links accordingly if the authmode is 'ldap'.

tested by changing the authmode and running
`pmgqm send -receiver <email-address> -debug 1`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
2021-06-28 15:28:57 +02:00
Thomas Lamprecht
fd1d033817 adpi: node config: fix style nits/issues
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 15:27:02 +02:00
Stoiko Ivanov
08d71f6908 api: nodeconfig: validate acme config before writing
Currently it is possible to add the same domains as different
acmedomainX keys to the node config, which prevents the user from
ordering certificates later.

This patch adds a call to get_acme_conf, which does the semantic
validation (and is also used in all other sites, which read the
config).

Reported in our community forum:
https://forum.proxmox.com/threads/lets-encrypt-cert-on-gui-not-working.91014/

quickly tested in my setup, by successfully adding the same domain
twice without the patch, and failing to do so with it applied.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-28 15:19:40 +02:00
Thomas Lamprecht
b8b56fbfa5 d/control: drop transitional apt-transport-https, provided by apt
It was actually integrated into apt quite a bit before version 2.0
but it does not really hurts and version 2 is available since Q1 2020
on sid, bullseye will have 2.2.x so using (>= 2~) is just fine.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 14:15:31 +02:00
Thomas Lamprecht
64537e425b d/control: bump standards version and use https in homepage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 14:15:08 +02:00
Thomas Lamprecht
8dbd42424a buildsys: upload to bullseye
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-28 14:11:54 +02:00
Stoiko Ivanov
6954b8a6ec tests: greylist: retry connecting 3 times
Sometimes pmgpolicy is not done starting up when we try connecting.
Sadly strace on test_greylist.pl makes the problem disappear.

Looping 3 times should work robustly.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
2021-06-16 14:20:49 +02:00
Stoiko Ivanov
4e5d7fd880 greylisting: drop unneeded Host column form cgreylist table
With the changes added in f61d54891d
greylisting does the matches based on a configurable netmask, and
does not use the 'Host' column in the cgreylist table anymore.

Drop it now with PMG 7.0

Quickly tested the following scenarios (all successfully):
* Upgrading from a previous version
* Restoring a pmg-backup taken with PMG 5.2 (the greylist table is
  excluded from the backup)
* Adding a node with the changes to an existing cluster without the
  change
* Adding a node without the changes to a master-node having them

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
2021-06-16 14:20:44 +02:00
Thomas Lamprecht
96c0c47f83 access control: style: drop some extra newlines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-16 14:19:51 +02:00
Fabian Ebner
780504cc76 api: nodes: add definedness check to avoid perl warning
also add the missing import for 'raise_perm_exc' to avoid having the error about
the undefined subroutine instead of the actual error.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-15 17:21:46 +02:00
Stoiko Ivanov
2e08e3c97b unpack: adapt to new libarchive methods
This patch changes the deprecated method used from libarchive-perl.
It needs a versioned dependency bump on libarchive-perl (>= 3.4.0).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
771f863cbb update postgresql dependency to 13
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
4f06ff8ac2 utils: do not hardcode postgres version
PMG::Utils::lookup_real_service_name is only called
for translating the service names provided as arguments
to PMG::API2::Nodes::syslog (for fetching the journal
for specific units). Instead of hardcoding the
version getting it with a call to `psql` seems justified.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
f91a7bf58f api: statistics: drop deprecated detail statistic methods
in e89b61c519 we introduced a method
taking the address as explicit parameter instead of path component
(local-parts can contain '/'). now we can drop the old paths.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
4af363b382 api: quarantine: drop deprecated b/w-list methods
in e8d909c11f we introduced methods
which take the address to be deleted as parameter instead of path
component (local-parts can contain '/') - now we can drop the old
paths as indicated in 53e5e5da24

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
22dfc493b5 TLSPolicy: drop deprecated 'domain' parameter
the domain parameter was a misnomer and was replaced by destination in
cce8e372aa

With a major version change upcoming we can now drop the old
parameter name.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
21d83302eb Revert "improve csrf backward compatibility"
This commit was added in PMG 5.2 for backwards compatibility and can
now be dropped.

This reverts commit 7aff29f380.
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
81e68f0107 api: nodes: drop deprecated 'upgrade' option of termproxy
The termproxy api was adapted to the changes from PVE and PBS
in d9e79ff4b7
We can now drop the 'upgrade' option kept for backwards compatibility

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Oguz Bektas
476591d931 clamav: remove deprecated SafeBrowsing
this database was discontinued in 2019 due to legal reasons.

see:
https://blog.clamav.net/2021/04/are-you-still-attempting-to-download.html

archive in case it goes 404:
https://web.archive.org/web/20210408140341/https://blog.clamav.net/2021/04/are-you-still-attempting-to-download.html

* remove from freshclam.conf.in template
* remove from description
* default to 0 just to be sure
* if 'safebrowsing' set in pmg.conf, this is now ignored

note about removing the option in PMG 7.0

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
changed the removal notice form PMG 7.0 to 8.0
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Stoiko Ivanov
f6d5ecfd4e d/control: bump versioned dependency on pve-common and pve-http-server
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 14:53:45 +00:00
Oguz Bektas
cc7fa1b8d0 pmgproxy: allow setting LISTEN_IP parameter
LISTEN_IP is defined in /etc/default/pmgproxy.

this depends on the changes in pve-common and pve-http-server (#2997)

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>

added changes ported from pve-manager commit
8da3ad7ce8ca9d609f0e5be3860f63f3d1a58889
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-11 13:06:19 +00:00
Stoiko Ivanov
4ea8d2de9f buildsys: update lintian-overrides
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-10 15:33:08 +00:00
Stoiko Ivanov
431b78b9d8 buildsys: bump d/compat to 12 and adapt d/rules
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-05-31 15:33:18 +00:00
Stoiko Ivanov
9abcb50508 buildsys: wrap-and-sort
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-05-31 10:52:37 +00:00
Fabian Ebner
52872fcede api: upload costum certificate: actually return info
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-04-28 10:51:15 +02:00
Thomas Lamprecht
f13f4efd1c access control: add newline when dying on auth
to avoid the module-path + line suffixed in the error..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-28 07:59:45 +02:00
Thomas Lamprecht
1c8a73c7b5 bump version to 6.4-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 15:19:04 +02:00
Stoiko Ivanov
0e543af7e7 acme: allow wildcard domain entries
Reported in our community forum [0], support for wildcard certificates
via ACME sounds like a good enhancement (especially for PMG).

In order for this to work you need to configure the wild-card
sub-entry (*.domain.example) as ACME domains and be able to verify
that via a DNS Plugin.
This is best described in the announcement by Let's Encrypt announcing
wildcard certificate support [1], or the dns challenge type
documentation[2].

Quickly tested with a domain of mine (and the powerdns plugin)

[0]: https://forum.proxmox.com/threads/feature-request-add-wildcard-support-for-acme.87495/
[1]: https://community.letsencrypt.org/t/acme-v2-production-environment-wildcards/55578
[2]: https://letsencrypt.org/docs/challenge-types/#dns-01-challenge

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 15:15:09 +02:00
Thomas Lamprecht
69048a045c fix #2228: automatically deliver/delete on whitelist/blacklist
If a user chooses to blacklist a specific sender of a mail, the mail
is highly probably undesired too, so delete it in that case.

The reverse should hold for white listing a mail's sender, deliver it
in that case.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-03-31 13:40:56 +02:00
Thomas Lamprecht
cb6137e604 quarantine/content: better error message for internal error
should really not happen, but if (e.g., enum gets adaped) it is good
to know the actual value triggering it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-30 11:09:15 +02:00
Thomas Lamprecht
225ecb80a5 bump version to 6.4-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-26 19:09:49 +01:00
Stoiko Ivanov
0ab999a556 pbs: rephrase notification mail
currently the provided logs are not too detailed.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-03-26 19:06:26 +01:00
Stoiko Ivanov
cb532a2c7a bump version to 6.4-3
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-03-26 18:53:18 +01:00