-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature/enable fips compliance #3493
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
Conversation
… in Go 1.24.0 Signed-off-by: Matt Topper <[email protected]>
This merge brings the FIPS 140-3 compliance feature branch up to date with the latest upstream/main (523 commits ahead). Key changes: - Resolved CHANGELOG.md conflict by combining FIPS feature entry with upstream changes - Resolved meta_providers.go import conflict (added context import) - Fixed crypto/fips package name to crypto/fips140 (correct for Go 1.24+) - Verified GPG authentication logic works correctly with upstream bug fix in SigningSkipped() method The FIPS feature enables OpenTofu to run in FIPS 140-3 compliant mode when built with Go 1.24+ and GODEBUG=fips140=on is set at runtime. GPG signature validation is skipped in FIPS mode as the underlying OpenPGP library is not FIPS-compliant. Signed-off-by: Matt Topper <[email protected]>
Extract GPG validation into focused helper functions: - skipGPGValidation(): Handles FIPS mode and other skip scenarios - performGPGValidation(): Performs normal GPG verification This improves code clarity by: - Separating concerns (FIPS check vs validation logic) - Making the authentication flow more readable - Allowing the skip reason to be parameterized for future extensibility The behavior is unchanged, but the code structure is cleaner and more maintainable. Signed-off-by: Matt Topper <[email protected]>
The documentation previously described GPG signature validation as a 'potential limitation' with a phased testing plan. This has been updated to accurately reflect the implemented behavior: - docs/fips_support.md: Changed from 'unverified compatibility' to 'known limitation' with clear explanation of how GPG validation is skipped and what security guarantees remain (FIPS TLS + checksums) - docs/usage/fips.md: Added specific library name (ProtonMail/go-crypto) and clarified that integrity relies on both FIPS-validated TLS and checksum verification, not just TLS alone - CHANGELOG.md: Added library name and mentioned checksum verification for accuracy These changes make the documentation consistent with the code and provide clearer security information for users evaluating FIPS compliance. Signed-off-by: Matt Topper <[email protected]>
|
Reminder for the PR assignee: If this is a user-visible change, please update the changelog as part of the PR. |
|
Thanks for working on this, @topperge! #2026 was labelled as "need-rfc" because we felt that it needed more exploration and decision making before we could move forward with implementation. Your writeup here does include some answers to questions that such an RFC would presumably cover, but for something security/compliance-sensitive like this I think we should go through the full RFC process so that we have a written record not only of what we decided but why we made those decisions and what we expect the implications of those decisions to be, so that we can make sure to make compatible tradeoffs in future work and so that anyone who might rely on this can know what we're assuming about their requirements and determine whether this does meet their requirements. In particular (though this is not the only thing that I'd want to explore more in an RFC) I think we need to justify why it's an appropriate tradeoff to implicitly disable the key verification for providers, since having fewer checks when working in a mode that's associated with well-defined security controls seems counter-intuitive. I note also that what we approved (provisionally, pending RFC) in #2026 was not to support two different usage modes for OpenTofu, but instead to compile OpenTofu in a way that forces this mode on for all users, so that we don't effectively double the number of supported configurations for using OpenTofu. We'd expected that -- assuming we can answer all of the associated design questions in a satisfactory way -- we'd add With all of that said: I think we should work through the RFC process on this before considering any specific implementation. Would you be interested in working on such an RFC? The project maintainers could provide some more context on the original issue about what sort of design questions we'd want such an RFC to answer, if that would help quantify the likely work involved in that. Thanks again! Footnotes
|
| @@ -0,0 +1,33 @@ | |||
| # Using OpenTofu in FIPS Mode (Experimental) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs directory in this repository is reserved only for development documentation whose audience is contributors to the OpenTofu codebase.
If we do decide to ship something that requires end-user-configuration (as opposed to being force-enabled for all users) then we'd want to document it somewhere under the website/docs/cli directory so that it would appear in the end-user-oriented documentation on our website.
|
To try to answer my own question about the runtime handling of
(Emphasis mine) So indeed it does seem like it's possible to turn this on at runtime despite the fact that the OpenTofu project has not committed to support it. The Given all of that, it seems like we (the maintainers on behalf of the project) need to make a decision about whether and how we are going to support running Thanks again for working on this! I hope we can find a reasonable compromise. |
Resolves #2026
Description
This PR implements FIPS 140-3 compliant mode for OpenTofu using Go 1.24+'s native FIPS support. When enabled via the
GODEBUG=fips140=onenvironment variable, OpenTofu will use only FIPS-validated cryptographic modules for all operations.Key Changes
crypto/fips140.Enabled()to detect when FIPS mode is activeProtonMail/go-crypto/openpgplibrary is not FIPS-compliant) with a logged warningWhat Works in FIPS Mode
Known Limitations
Files Changed
internal/getproviders/package_authentication.go: Skip GPG validation when FIPS is enabledinternal/command/meta_providers.go: Comment explaining FIPS compatibility with AutoMTLSinternal/command/e2etest/*_test.go: Updated tests to handle FIPS modedocs/fips_support.md: Technical documentationdocs/usage/fips.md: User-facing documentationCHANGELOG.md: Feature announcementChecklist
Go checklist
Website/documentation checklist