Skip to content

Enable GODEBUG=fips140=only tests in buildkite. #302

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
merged 7 commits into from
Apr 3, 2025

Conversation

michel-laterman
Copy link
Contributor

@michel-laterman michel-laterman commented Mar 28, 2025

What does this PR do?

Enable unit tests with GODEBUG=fips140=only and -tags=requirefips in buildkite. This is a basic check to make sure we don't accidently add non-compliant crypto when in FIPS mode.
When these test are ran, the encrypted private key tests in transport/tlscommon are skipped, the -tags=requirefips tests check that an error is returned, however if fips140=only is set the test will panic.
Add a new V2 file keystore that is used with requirefips. This implementation uses NewGCMWithRandomNonce. File keystore support is currently disabled in FIPS artifacts we produce.

Why is it important?

We want automated testing to ensure we don't accidentally introduce non-compliant code

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

Enable unit tests with GODEBUG=fips140=only and -tags=requirefips in
buildkite. This is a basic check to make sure we don't accidently add
non-compliant crypto when in FIPS mode.
When these test are ran, the encrypted private key tests in
transport/tlscommon are skipped, the -tags=requirefips tests check that
an error is returned, however if fips140=only is set the test will
panic.
Add a new V2 file keystore that is used with requirefips. This
implementation uses NewGCMWithRandomNonce. File keystore support is
currently disabled in FIPS artifacts we produce.
@michel-laterman michel-laterman added enhancement New feature or request Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Mar 28, 2025
@michel-laterman michel-laterman requested a review from a team as a code owner March 28, 2025 20:34
@michel-laterman michel-laterman requested review from khushijain21, VihasMakwana and pkoutsovasilis and removed request for a team March 28, 2025 20:34
@michel-laterman
Copy link
Contributor Author

Requires update to go 1.24: #303

@michel-laterman
Copy link
Contributor Author

Requires linter update: #304

@kruskall
Copy link
Member

kruskall commented Apr 1, 2025

Requires update to go 1.24: #303

This is a library, we can't drop a supported version of go. go1.24 specific code should be guarded by build tags (e.g.

)

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

Copy link

@pkoutsovasilis pkoutsovasilis left a comment

Choose a reason for hiding this comment

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

LGTM 🙂

@michel-laterman michel-laterman merged commit 6ff829d into elastic:main Apr 3, 2025
5 checks passed
@michel-laterman michel-laterman deleted the fipsonly-tests branch April 3, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants