Skip to content

[8.19] (backport #7912) [FIPS] Ensure that Agent cannot present a client-side TLS certificate created with a RSA keypair of less than 2048 bits length#8040

Merged
ycombinator merged 1 commit into
8.19from
mergify/bp/8.19/pr-7912
Apr 29, 2025
Merged

[8.19] (backport #7912) [FIPS] Ensure that Agent cannot present a client-side TLS certificate created with a RSA keypair of less than 2048 bits length#8040
ycombinator merged 1 commit into
8.19from
mergify/bp/8.19/pr-7912

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Apr 29, 2025

What does this PR do?

This PR ensures that remote.Clients created with a configuration containing a client-side TLS certificate generated from an RSA keypair < 2048 bits in length cannot be created in FIPS mode.

Why is it important?

FIPS-140 does not allow use of RSA with keylengths < 2048 bits.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

Users using FIPS-capable Elastic Agents with client-side TLS certificates that are generated with RSA, must generate the RSA keypairs with a minimum of 2048 bits key lengths.


This is an automatic backport of pull request #7912 done by [Mergify](https://mergify.com).

… created with a RSA keypair of less than 2048 bits length (#7912)

* Adding test for unsupported TLS versions sent by client

* Add TODO for second test

* Add test case for multiple versions

* Removing unused code

* Add test for config hosts validation

* Remove hosts validation

* Refactoring test cases to take in any TLS configuration, not just versions

* Add test for RSA keypair with < 2048 key length

* Updating comment

* Add test case for using certificate with RSA keypair < 2048 bits

* Adding test data files

* Revert test scope

* Update test to fail on handshake

* Rename agent key and cert for clarity

* Adding test case with secure Agent certificate

* Adding README to testdata folder to explain manual generation of keys+certs

* Reverting unintended changes from conflict resolution

* Removing irrelevant integration test

* Remove unused variables

* Remove CA private key

* Renaming root -> CA for clarity

* Rename files and variable to make purpose clearer

* Adding .gitignore for CA private key file

* Introduce GoDebugFIPS140() function

* Separate test cases based on GODEBUG=fips140= value

* Rename test cases for clarity

* Remove test cases for GODEBUG=fips140=on

* Adjust test cases to assume upstream Go instead of Microsoft Go

* Be explicit in all constant types

* Fix data race

(cherry picked from commit 0eb4f0f)
@mergify mergify Bot requested a review from a team as a code owner April 29, 2025 19:54
@mergify mergify Bot added the backport label Apr 29, 2025
@mergify mergify Bot requested review from pchila and ycombinator and removed request for a team April 29, 2025 19:54
@github-actions github-actions Bot added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog labels Apr 29, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@ycombinator ycombinator enabled auto-merge (squash) April 29, 2025 20:00
@elastic-sonarqube
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube

@ycombinator ycombinator merged commit 0235400 into 8.19 Apr 29, 2025
13 of 14 checks passed
@ycombinator ycombinator deleted the mergify/bp/8.19/pr-7912 branch April 29, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport enhancement New feature or request skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants