Skip to content
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

proposal: crypto/boring: add FIPS() #61757

Closed
qmuntal opened this issue Aug 4, 2023 · 7 comments
Closed

proposal: crypto/boring: add FIPS() #61757

qmuntal opened this issue Aug 4, 2023 · 7 comments
Labels
Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Milestone

Comments

@qmuntal
Copy link
Contributor

qmuntal commented Aug 4, 2023

The crypto/boring package currently just exports func Enabled() bool. I propose to add an additional function:

// FIPS reports whether BoringCrypto is FIPS-enabled.
func FIPS() bool

When GOEXPERIMENT=boringcrypto is set, boring.FIPS() would always return true, as BoringCrypto is static-linked and its binary is owned by the Go toolchain, so we know for sure that it is FIPS-enabled.

The new function would mainly benefit Go forks that provide FIPS support using libraries whose FIPS status can only be known at runtime, e.g. dynamic-linking against OpenSSL or Windows CNG.

One could argue that Go forks can add whatever API they wish, including the one here proposed, but trying to keep source compatibility with upstream Go benefits the whole community. IMO, this particular function is generic enough to deserve a place in crypto/boring. Would have been nice to have a more generic name for this package, but that's not something that worries me that much for now.

Disclaimer: I'm asking this as a maintainer of the Microsoft Go fork, but this API has been requested to us by a fork of our fork: microsoft/go#999. This proposal contains the following use-cases to support adding FIPS() bool:

  • Surfacing FIPS mode status to the user through the application's API (docker info)
  • Telemetry / analytics - how many customers use FIPS mode
  • Altering the application behaviour when FIPS mode is enabled - both to switch to using only FIPS-approved algorithms and to change some user-facing behaviours

@rsc

@seankhliao
Copy link
Member

@golang/security

@seankhliao seankhliao added the Proposal-Crypto Proposal related to crypto packages or other security issues label Aug 4, 2023
@rsc
Copy link
Contributor

rsc commented Aug 9, 2023

/cc @FiloSottile

@rsc
Copy link
Contributor

rsc commented Aug 9, 2023

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc
Copy link
Contributor

rsc commented Aug 16, 2023

We've been trying very hard not to claim that using BoringCrypto gets you FIPS compliance. That's up to you and your compliance department. I'm very reluctant to add a 'FIPS' function that returns true, because it goes against all that cautious messaging. Probably the right answer is to add it to the MS fork and let people use a build tag or something like that to access that bit.

@rsc
Copy link
Contributor

rsc commented Aug 16, 2023

Based on the discussion above, this proposal seems like a likely decline.
— rsc for the proposal review group

@qmuntal
Copy link
Contributor Author

qmuntal commented Aug 22, 2023

Thanks for the answer @rsc. Your arguments are compelling.

@rsc
Copy link
Contributor

rsc commented Aug 30, 2023

No change in consensus, so declined.
— rsc for the proposal review group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Projects
Status: Declined
Development

No branches or pull requests

4 participants