Commit Graph

334 Commits (78d9fe581368490c580eb5e3456d03569c0a79c6)

Author SHA1 Message Date
Felix Fontein c6fbe58382
Implement certificate information retrieval code in the ACME backends. (#736) 2024-04-29 22:29:43 +02:00
Felix Fontein afe7f7522c
Split up the default acme docs fragment to allow modules ot not need account data. (#735) 2024-04-29 22:22:38 +02:00
Felix Fontein 0c62837296
crypto.math module utils: add some tests, fix quick_is_not_prime() for small primes (#733)
* Fix quick_is_not_prime() for small primes. Add some tests.

* Fix return value of convert_int_to_bytes(0, 0) on Python 2.

* Add some more test cases.

* Simplify the changelog and point out that these errors only happen for cases not happening in regular use.
2024-04-29 08:50:28 +02:00
Felix Fontein 8ce0051f9b Release 2.19.0. 2024-04-20 11:48:34 +02:00
Felix Fontein 8fe012cf09 Prepare 2.19.0 release. 2024-04-18 07:51:28 +02:00
Felix Fontein ae548de502
Use timezone aware functionality when using cryptography >= 42.0.0 (#727)
* Use timezone aware functionality when using cryptography >= 42.0.0.

* Adjust OpenSSH certificate code to avoid functions deprecated in Python 3.12.

* Strip timezone info from isoformat() output.

* InvalidityDate.invalidity_date currently has no _utc variant.
2024-04-18 05:49:53 +00:00
Felix Fontein 1b75f1aa9c
Add and use CryptoBackend.get_ordered_csr_identifiers(). (#725) 2024-04-13 22:43:14 +02:00
Felix Fontein ff1504dc58 Release 2.18.0. 2024-02-25 20:57:38 +01:00
Felix Fontein 08adb6b297
Deprecate check mode behavior of pipe modules. (#714) 2024-02-25 17:00:37 +01:00
Felix Fontein 42ba0a88f4 Prepare 2.18.0. 2024-02-23 20:07:06 +01:00
Felix Fontein 1736602ce7
Allow to configure how serial numbers are provided to x509_crl. (#715) 2024-02-19 21:05:13 +01:00
Steffen Gufler 51591891d3
luks_device: fix remove_keyslot not working when set to 0 and duplicate keys (#710)
* luks_device: fix remove_keyslot not working when set to 0

* luks_device: fix module outputting 'ok' when trying to add a key that is already present in another keyslot

* luks_device: fix breaking unit tests

* luks_device: Duplicate key test case code cleanup

* luks_device: Fix testing of LUKS passphrases when only testing one key slot

* luks_device: Fix testing of LUKS passphrases when only testing one key slot

* luks_device: Add changelog fragment for PR #710

* luks_device: Update changlog fragment
2024-02-11 12:23:21 +01:00
Felix Fontein 37fed289e6 Release 2.17.1. 2024-01-27 10:44:08 +01:00
Felix Fontein 9ec8680936
Emit warning when consistency cannot be checked. (#705) 2024-01-27 10:39:13 +01:00
Felix Fontein 87af1f2761
Disable consistency checking of RSA keys for cryptography 42.0.0 which no longer gives access to the required function. (#702) 2024-01-26 17:47:46 +01:00
Felix Fontein da30487119 Prepare 2.17.1 release. 2024-01-25 23:52:22 +01:00
Felix Fontein b57aa4a2ca
Fix openssl_dhparam. (#698) 2024-01-25 23:42:03 +01:00
Felix Fontein 91dd7cd4dc Release 2.17.0. 2024-01-21 09:03:37 +01:00
Felix Fontein 2913826352 Prepare 2.17.0 release. 2024-01-21 08:46:32 +01:00
0x00ace a4edf22a9c
add allow discard option for luks devices (#693)
* add allow discard option for luks devices

* Add allow_discards to perfomance tests

* Fix version for luks devices doc

* Update plugins/modules/luks_device.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* add changelog fragment

* Update changelogs/fragments/693-allow-discards.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* added allow_discards to the persistently stored option list

* allow_discards works with not only luks2 containers

* Update plugins/modules/luks_device.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-01-13 09:34:07 +01:00
Felix Fontein 815ce43d17 Release 2.16.2. 2023-12-09 11:03:32 +01:00
Felix Fontein 170d837122
Increase retry count from 5 to 10. (#685) 2023-12-08 21:36:20 +01:00
Felix Fontein b5269b25a3
Improve error reporting. (#684) 2023-12-08 20:57:49 +01:00
Felix Fontein 5d5a21fddf
Directly handle unexpected non-JSON results. (#682) 2023-12-07 22:26:04 +01:00
Felix Fontein 67f1d1129b
Fix handling of non-existing ACME accounts with Digicert ACME endpoint (#681)
* Compatibility for DigiCert CA: also accept 404 instead of 400 for non-existing accounts.

* Add changelog fragment.

* Fix URL.
2023-12-07 22:25:54 +01:00
Felix Fontein d9362a2ce9 Prepare 2.16.2 release. 2023-12-07 21:08:34 +01:00
Felix Fontein 22e24f24c6 Release 2.16.1. 2023-12-04 21:49:56 +01:00
Felix Fontein 9cc1731767 Revert "Release 2.17.0."
This reverts commit c592eaa35a.
2023-12-04 21:49:29 +01:00
Felix Fontein c592eaa35a Release 2.17.0. 2023-12-04 21:49:01 +01:00
Felix Fontein 525a8a5df4 Prepare 2.16.1. 2023-12-04 21:35:41 +01:00
Felix Fontein e4ba0861e5
Retry also on certain connection errors. (#680) 2023-12-04 21:34:51 +01:00
Felix Fontein 6bd5eee9b0 Release 2.16.0. 2023-10-29 15:59:31 +01:00
Felix Fontein fc707c7e31 Add changelog fragment for #664. 2023-10-29 10:55:12 +01:00
Felix Fontein eba7e32df1 Due to a new feature, the next release will be 2.16.0. 2023-10-29 10:53:53 +01:00
Felix Fontein a150e77507 Prepare 2.15.2 release. 2023-10-28 22:14:10 +02:00
Felix Fontein d1299c11d6
Handle pyOpenSSL 23.3.0, which removed PKCS#12 support (at least partially). (#666) 2023-10-28 13:38:07 +00:00
Felix Fontein d7293aa1cd Release 2.15.1. 2023-08-22 06:54:54 +02:00
Felix Fontein 1e78918ad3 Prepare 2.15.1 release. 2023-08-21 20:51:04 +02:00
Felix Fontein 526b3c4393
Allow type to be missing. (#652) 2023-08-21 20:49:55 +02:00
Felix Fontein e41a50af97 Release 2.15.0. 2023-08-12 18:10:13 +02:00
Felix Fontein d3737f5ef7 Update release summary. 2023-08-12 17:15:09 +02:00
Felix Fontein addbd067c8
openssh_* modules: check return code on ssh(-keygen) invocations; fail if comment cannot be updated (#646)
* Check return code on ssh(-keygen) invocations.

* openssh_cert: only check for errors if certificate should be present and module is not in check mode.

* Handle rc check for _get_private_key().

* Add changelog fragment.

* Only pass -o for comment updating when necessary.

* Now fails if comment cannot be updated.

This was silently ignored in the past.

* Avoid failing operation.
2023-08-12 17:14:00 +02:00
Felix Fontein 62c842548d
Deprecate the default value 'false' of asn1_base64. (#600) 2023-08-12 12:23:37 +02:00
Felix Fontein e64d617de6 Prepare 2.15.0 release. 2023-08-02 11:23:22 +02:00
Felix Fontein 6c72734652 Release 2.14.1. 2023-06-27 18:03:55 +02:00
Felix Fontein 83af72a3bc
Improve PEM identification. (#628) 2023-06-27 17:35:55 +02:00
Felix Fontein 8fa4dc75c9 Prepare 2.14.1. 2023-06-24 10:02:16 +02:00
Felix Fontein 99d1521266
Use semantic markup (#626)
* Enable semantic markup.

* Use semantic markup.

* Break long lines.

* Add ignores.

* Use real option, not alias.
2023-06-24 10:00:56 +02:00
Felix Fontein 1f84d0a317 Release 2.14.0. 2023-06-15 12:52:42 +02:00
Felix Fontein 2f64d42855 Adjust release summary. 2023-06-15 12:52:15 +02:00
Marcin Słowikowski 9c07a8354e
Added support for certificates in DER format for `x509_certificate_info` module (#622)
* Added support for DER format

* Updated description

* Adjusted description

The content of the certificate cannot be in DER format due to an input encoding problem in the Ansible module, but it works fine when reading the certificate from a file

* Update support.py

* Added der_support_enabled flag for DER-format support

* Added changelog fragment for #603

* Fixed typo

* Fixed missing import

* Resolved issues found by static code analysis

* Update plugins/module_utils/crypto/support.py

Committed suggested change

Co-authored-by: Felix Fontein <felix@fontein.de>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-15 12:51:14 +02:00
Felix Fontein ad118bbbd6 Prepare 2.14.0 release. 2023-06-09 06:10:06 +02:00
Felix Fontein d823382732
Validate challenges in parallel instead of serially. (#617) 2023-06-09 06:04:34 +02:00
Felix Fontein 17702d1a76
acme_certificate: allow 'no challenge' (#615)
* Allow 'no challenge'.

* Fix undefined variable.
2023-06-05 20:54:07 +02:00
Felix Fontein 05ad2e5008 Release 2.13.1. 2023-05-21 14:12:40 +02:00
Felix Fontein c703dd6056
Rewrite EE test workflows to use ansible-builder 3.0.0; fix EE dependencies (#606)
* Adjust EE tests to ansible-builder 3.0.0.

* Remove other CI workflows.

* Use docker instead of podman...

* Support Rocky Linux 9+.

* Add CentOS Stream 9 to EE tests.

* Fix installation of PyOpenSSL on CentOS/RHEL/Rocky.

* ansible-builder only attempts to install EPEL deps on CentOS.

* Make EPEL also available on Rocky Linux 9, even though ansible-builder will ignore it.

* Make sure cryptography is already installed.

* Try ansible-runner < 2.0.0 for CentOS Stream 8 / RHEL 8.

* Show more info.

* Start restricting transitive dependencies...

* Looks like PyOpenSSL is **broken** on CentOS Stream 9 + EPEL.

* ansible-builder will NOT work with Python 3.6.

use Python 3.9 on RHEL8 / CentOS Stream 8. Manually install cryptography and PyOpenSSL for Python 3.9 as well.

* PyOpenSSL isn't available for Python 3.8 or 3.9.

* Revert "Remove other CI workflows."

This reverts commit 3a9d125f45.

* Use podman instead of docker.

* Re-order bindep entries.

* python3-pyOpenSSL does not exist on RHEL/CentOS 6 and 7.
2023-05-21 12:43:14 +02:00
Felix Fontein 153de3ffef Prepare 2.13.1. 2023-05-21 08:39:06 +02:00
Felix Fontein 39bba05a17 Release 2.13.0. 2023-05-01 21:27:25 +02:00
Felix Fontein a8f27f93b7 Prepare 2.13.0. 2023-05-01 21:18:46 +02:00
David Zaslavsky ce3299f106
Always generate a new key pair if the private key doesn't exist (#598)
* Always generate a new key pair if the private key doesn't exist (#597)

This commit updates `KeypairBackend._should_generate()` to first check
if the original private key named by the `path` argument exists, and
return True if it does not. This brings the code in line with
the documentation, which says that a new key will always be generated if
the key file doesn't already exist.

As an alternative to the approach implemented here, I also considered
only modifying the condition in the `fail` branch of the if statement,
but I thought that would not map as cleanly to the behavior specified in
the documentation, so doing it the way I did should make it easier to
check that the code is doing the right thing just by looking at it.
I also considered doing something to make the logic more similar to
`PrivateKeyBackend.needs_regeneration()` (the openssl version of this
functionality), because the two are supposed to be acting the same way,
but I thought that'd be going beyond the scope of just fixing this bug.
If it'd be useful to make both methods work the same way, someone can
refactor the code in a future commit.

* Test different regenerate values with nonexistent keys

This commit changes the test task that generates new keys to use each of
the different values for the `regenerate` argument, which will ensure
that the module is capable of generating a key when no previous key
exists regardless of the value of `regenerate`. Previously, the task
would always run with the `partial_idempotence` value, and that obscured
a bug (#597) that would occur when it was set to `fail`. The bug was
fixed in the previous commit.
2023-05-01 21:16:42 +02:00
Felix Fontein c568923478
x509_crl: prepare releasing the mode option for AnsibleModule's use (#596)
* Prepare releasing the mode option for AnsibleModule's use.

* Update docs.
2023-04-29 20:54:24 +02:00
Felix Fontein e6a0d2884a Release 2.12.0. 2023-04-16 19:48:15 +02:00
Felix Fontein 0be88ab458 Prepare 2.12.0 release. 2023-04-16 13:36:59 +02:00
Felix Fontein 30756b12ea
Add asn1_base64 option. (#592) 2023-04-16 13:34:45 +02:00
Felix Fontein 50a26191ea Release 2.11.1. 2023-03-24 07:19:51 +01:00
Felix Fontein a28b02b0ac Prepare 2.11.1 release. 2023-03-23 21:27:44 +01:00
Felix Fontein d4509bce5f Release 2.11.0. 2023-02-23 09:28:13 +01:00
Austin Lane ced0e30506
EL9 - Retrieve python3-pyOpenSSL from epel (#575)
* EL9 - pull python3-pyOpenSSL from epel

* Incorporate bindep changes from felixfontein

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add changelog fragment for PR #575

* Update changelog fragment.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-22 23:16:26 +01:00
Felix Fontein 65d1881f12 Prepare 2.11.0 release. 2023-02-10 21:02:11 +01:00
dlehrman b000491514
Support Custom Cipher Selection (#571)
* Enable custom cipher selection for get_certificate

* get_certificate ciphers desc grammar fix

Co-authored-by: Felix Fontein <felix@fontein.de>

* get_certificate ciphers desc grammar fix

Co-authored-by: Felix Fontein <felix@fontein.de>

* get_certificate ciphers include version_added

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add changelog fragment

* Fail if ciphers is set and Python < 2.7.9

* Standardize ciphers conditionals in get_certificate

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-10 21:01:13 +01:00
Felix Fontein 70c4585b88
Fix deprecation handling. (#572) 2023-02-09 15:36:23 +01:00
Felix Fontein aea3713484
Remove unneccessary imports (#569)
* Remove unneccessary imports.

* Add noqas.

* Add comment which name is actually ignored.
2023-02-09 11:57:54 +01:00
Felix Fontein b19c83578d Release 2.10.0. 2023-01-02 19:54:30 +01:00
Felix Fontein ddfb18b609
openssl_csr: fix bad tests, avoid accepting invalid crl_distribution_points records (#560)
* Improve error handling.

* Remove invalid tests.

* Add changelog fragment.

* Fix tests.

* Improve exception catching.

Co-authored-by: Kristian Heljas <11139388+kristianheljas@users.noreply.github.com>

* Prevent empty full_name.

* Fix condition. Make sure errors are caught.

* Add more checks.

Co-authored-by: Kristian Heljas <11139388+kristianheljas@users.noreply.github.com>
2023-01-02 14:52:59 +00:00
Felix Fontein 095434a4c1 Prepare 2.10.0 release. 2022-12-31 18:05:12 +01:00
Felix Fontein 5d24d04adf
Fix crash when public key cannot be parsed. (#551) 2022-12-28 18:28:50 +01:00
Felix Fontein e1e5dfccc1 Release 2.9.0. 2022-11-27 18:15:33 +01:00
Felix Fontein f853108d69 Prepare 2.9.0 release. 2022-11-17 12:43:40 +01:00
Katze 2a746115ca
fix #529 issuer_uri in x509_certificate_info (#530)
The issuer_uri is retrieved from the Authority Information Access field the same way as the OCSP responder URI is.
Handling is exactly the same since they reside in the same OID space and have the same data type.
Tests have also been added based on the integration test certificates.

Signed-off-by: benaryorg <binary@benary.org>

Signed-off-by: benaryorg <binary@benary.org>
2022-11-17 12:40:44 +01:00
Felix Fontein 42e27a360d Release 2.8.1 2022-11-06 22:02:07 +01:00
Felix Fontein 95b9df187f Prepare 2.8.1 release. 2022-11-06 21:13:02 +01:00
Felix Fontein 68b7c0d38c Release 2.8.0. 2022-11-02 12:56:08 +01:00
Felix Fontein 9ba0e25bfe
Handle new nonce call more gracefully when it does not return nonce. (#525) 2022-11-02 08:32:01 +00:00
Felix Fontein 9a64347ea6 Prepare 2.8.0 release. 2022-11-01 19:52:23 +01:00
Felix Fontein e4e2b804bc
Allow to configure encryption level. (#523) 2022-11-01 19:51:28 +01:00
Felix Fontein 4533b3e934
Include symbolic HTTP status codes in error and log messages when available. (#524) 2022-10-31 21:33:27 +01:00
Felix Fontein a5c43c26f3 Release 2.7.1. 2022-10-17 22:24:20 +02:00
Felix Fontein 82aa1480af Prepare 2.7.1 release. 2022-10-17 21:41:04 +02:00
Felix Fontein 516be406e0
Improve import error handling for ACME modules (#519)
* Improve import error handling for ACME modules

* Update plugins/module_utils/acme/acme.py

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-10-17 21:38:54 +02:00
Felix Fontein 18502d5250 Release 2.7.0. 2022-09-23 07:40:12 +02:00
Felix Fontein b3f589df62
Action plugin support code: ensure compatibility with newer versions of ansible-core (#515)
* Only access C.STRING_CONVERSION_ACTION for old ansible-base / Ansible versions.

* Always use self.__xxx instead of xxx directly.
2022-09-23 07:02:46 +02:00
Felix Fontein 8ebf1279f9 Prepare 2.7.0 release. 2022-09-23 06:48:26 +02:00
Felix Fontein c24e5c63e8
acme modules: also support 503 for retries (#513)
* Also support 503 for retries.

* Forgot to adjust status code comparison.

* Also support 408.
2022-09-21 13:50:26 +02:00
Felix Fontein ed52123206 Release 2.6.0. 2022-09-19 20:46:26 +02:00
Felix Fontein d10bcd3d6c Fix fragment. 2022-09-19 20:46:13 +02:00
Felix Fontein 45e81a1b0c Prepare 2.6.0 release. 2022-09-19 20:11:29 +02:00
Felix Fontein a0d862e1f1
Support 429 Too Many Requests for acme module_utils. (#508) 2022-09-19 20:10:03 +02:00
Andrew Pantuso 1dcc135da5
feat: add private_key_format choices for openssh_keypair (#511)
* feat: add private_key_format choices for openssh_keypair

* chore: add changelog fragment
2022-09-18 20:10:29 -04:00
Felix Fontein 4428daa411 Release 2.5.0. 2022-08-04 23:06:49 +02:00
Felix Fontein f821fa0f2d Prepare 2.5.0 release. 2022-08-04 22:47:16 +02:00