Skip to content

Conversation

@detro
Copy link
Contributor

@detro detro commented Apr 7, 2022

As part of milestone 3.2.0, more stringent validation was introduced in many arguments fields. One of which is the argument allowed_uses, used by the resources:

  • tls_locally_signed_cert
  • tls_self_signed_cert

Given the nature of the argument, values provided that were not known to the Provider code, were silently ignored: the practitioner would get a certificate without one or more of the Key Usages they expected, but the provider would not report it.

From the RFC 5280, section 4.2.1.3:

KeyUsage ::= BIT STRING {
           digitalSignature        (0),
           nonRepudiation          (1), -- recent editions of X.509 have
                                -- renamed this bit to contentCommitment
           keyEncipherment         (2),
           dataEncipherment        (3),
           keyAgreement            (4),
           keyCertSign             (5),
           cRLSign                 (6),
           encipherOnly            (7),
           decipherOnly            (8) }

Hence, the introduction of the validation.

Unfortunately this means that existing terraform configurations started failing with the update to 3.2.0.

So, in the interest of not introducing regressions, this PR alters the validation logic slightly: if practitioner uses a non acceptable value for allowed_uses, instead of erroring, the provider will raise a warning and ignore the specific erroneous argument.

…d `tls_self_signed_cert`

If practitioner uses a non acceptable value, instead of erroring we will raise a warning and exclude the specific `allowed_use` from the certificate configuration.
@detro detro requested a review from a team as a code owner April 7, 2022 17:08
@github-actions github-actions bot added the size/S label Apr 7, 2022
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great quick fix, nice! 🚀 Should we consider hard validation again for 4.0? 😄

@bflad
Copy link
Contributor

bflad commented Apr 7, 2022

Andddd you're already on it, rock on. #185

@detro detro merged commit 5c8069d into main Apr 7, 2022
@detro detro deleted the detro/relax-allowed_uses-validation branch April 7, 2022 17:29
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants