Skip to content

Use Policy field instead of PolicyIdentifiers in cert templates #6074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sorindumitru
Copy link
Collaborator

Pull Request check list

  • Commit conforms to CONTRIBUTING.md?
  • Proper tests/regressions included?
  • Documentation updated?

Affected functionality
CredentialComposer plugins that use the PolicyIdentifiers field in the X509CAAttributes structure.

Description of change
Since go 1.24, to which we updated in the 1.12.0 release of SPIRE, the crypto/x509 package no longer applies the certificate policies from the PolicyIdentifier field when using the CreateCertificate method. Instead of this the Policies field is used.

The effect is that since the 1.12.0 release of SPIRE the CAs minted by deployments using a CredentialComposer plugin which specifies PolicyIdentifiers no longer have those fields populated in the CAs.

This can be mitigated on the affected releases (1.12.0 and 1.12.1) by setting the GODEBUG environment variable to ❯ x509usepolicies=0

@sorindumitru sorindumitru force-pushed the policy-identifiers-fixes branch from 625465a to 7fd2245 Compare May 16, 2025 13:18
@sorindumitru sorindumitru changed the title Policy identifiers fixes Use Policy field instead of PolicyIdentifiers in cert templates May 16, 2025
@sorindumitru sorindumitru force-pushed the policy-identifiers-fixes branch from 6839863 to 6f2910d Compare May 16, 2025 14:56
sorindumitru and others added 2 commits May 16, 2025 15:56
Signed-off-by: Marcos Yacob <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>
@sorindumitru sorindumitru force-pushed the policy-identifiers-fixes branch from 6f2910d to bd9ed8b Compare May 16, 2025 14:56
CHANGELOG.md Outdated

### Fixed

- PolicyCredentials set by CredentialComposer plugins are now applied again to CA certificates (#6074)
Copy link
Collaborator

Choose a reason for hiding this comment

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

how about something like:

- Regression where PolicyCredentials set by CredentialComposer plugins were not correctly applied to CA certificates. (#6074)

CHANGELOG.md Outdated
@@ -1,5 +1,11 @@
# Changelog

## [1.12.1] - 2025-05-16
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
## [1.12.1] - 2025-05-16
## [1.12.2] - 2025-05-16

@sorindumitru sorindumitru force-pushed the policy-identifiers-fixes branch from bd9ed8b to 587555a Compare May 16, 2025 20:13
amartinezfayo
amartinezfayo previously approved these changes May 16, 2025
Copy link
Member

@amartinezfayo amartinezfayo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you so much @sorindumitru!

Signed-off-by: Sorin Dumitru <[email protected]>
@sorindumitru sorindumitru merged commit a774de4 into spiffe:release/v1.12.2 May 19, 2025
36 checks passed
sorindumitru added a commit to sorindumitru/spire that referenced this pull request May 20, 2025
…fe#6074)

* Add a test for PolicyIdentifiers in server CA

Signed-off-by: Sorin Dumitru <[email protected]>

* Use Policy field for CA policies

Signed-off-by: Sorin Dumitru <[email protected]>

* Bump SPIRE v1.12.2 (spiffe#6052)

Signed-off-by: Marcos Yacob <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Sorin Dumitru <[email protected]>

---------

Signed-off-by: Sorin Dumitru <[email protected]>
Signed-off-by: Marcos Yacob <[email protected]>
Co-authored-by: Marcos Yacob <[email protected]>
sorindumitru added a commit to sorindumitru/spire that referenced this pull request May 20, 2025
…fe#6074)

* Add a test for PolicyIdentifiers in server CA

Signed-off-by: Sorin Dumitru <[email protected]>

* Use Policy field for CA policies

Signed-off-by: Sorin Dumitru <[email protected]>

* Bump SPIRE v1.12.2 (spiffe#6052)

Signed-off-by: Marcos Yacob <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Sorin Dumitru <[email protected]>

---------

Signed-off-by: Sorin Dumitru <[email protected]>
Signed-off-by: Marcos Yacob <[email protected]>
Co-authored-by: Marcos Yacob <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>
sorindumitru added a commit to sorindumitru/spire that referenced this pull request May 20, 2025
sorindumitru added a commit to sorindumitru/spire that referenced this pull request May 20, 2025
amartinezfayo pushed a commit that referenced this pull request May 20, 2025
* Use Policy field instead of PolicyIdentifiers in cert templates (#6074)

Co-authored-by: Marcos Yacob <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>

* Bump SPIRE v1.12.3

Signed-off-by: Sorin Dumitru <[email protected]>

---------

Signed-off-by: Sorin Dumitru <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>
Co-authored-by: Marcos Yacob <[email protected]>
@sorindumitru sorindumitru added this to the 1.12.2 milestone May 20, 2025
tjons pushed a commit to tjons/spire that referenced this pull request May 21, 2025
* Use Policy field instead of PolicyIdentifiers in cert templates (spiffe#6074)

Co-authored-by: Marcos Yacob <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>

* Bump SPIRE v1.12.3

Signed-off-by: Sorin Dumitru <[email protected]>

---------

Signed-off-by: Sorin Dumitru <[email protected]>
Signed-off-by: Sorin Dumitru <[email protected]>
Co-authored-by: Marcos Yacob <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants