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

Prevent md5 from being used for cache hashing when in FIPS mode #68743

Closed
ywangd opened this issue Feb 9, 2021 · 2 comments
Closed

Prevent md5 from being used for cache hashing when in FIPS mode #68743

ywangd opened this issue Feb 9, 2021 · 2 comments
Assignees
Labels
>bug :Security/FIPS Running ES in FIPS 140-2 mode Team:Security Meta label for security team

Comments

@ywangd
Copy link
Member

ywangd commented Feb 9, 2021

SP 800-52 approves that MD5 can be used with TLS and it is the only scenario where it is allowed. However, the BCFIPS library (and maybe other libraries) does not prevent it from being used in other places (there really is no reliable way to detect it). In our case, user can choose to use it as the caching algorithm. The usage includes CachingUsernamePasswordRealm, ApiKeyService and maybe some other places. It also can be used in the fingerprint ingest processor. We should fix them by either throwing error or fail to start.

In all the aforementioned places we should be checking the value of XPackSettings.FIPS_MODE_ENABLED in the current loaded settings ( i.e. by checking Environment#settings ) and throw an exception that would cause the component and the node to exit or print a warning in the logs if we want to be more tolerant.

@ywangd ywangd added >bug :Security/FIPS Running ES in FIPS 140-2 mode labels Feb 9, 2021
@elasticmachine elasticmachine added the Team:Security Meta label for security team label Feb 9, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@n1v0lg n1v0lg self-assigned this Apr 27, 2022
n1v0lg added a commit that referenced this issue Jun 1, 2022
Currently, it's possible to choose a hash function for various cache
hashers (e.g., in ApiKeyService) that is not compliant with FIPS 140
(e.g., MD5). This PR logs a warning on node start if a non-compliant
hashing algorithm is used in FIPS mode.

Note that there are other usages of non-FIPS compliant hash functions,
which are not configured through settings (e.g.
FingerprintProcessor). I plan to address these in a separate PR.

Relates #68743
@n1v0lg
Copy link
Contributor

n1v0lg commented Jun 3, 2022

As discussed on slack, FingerprintProcessor does not use the hash function in a security context, i.e., does not require a cryptographically secure hash function. Instead the hash function is used for content fingerprinting. As such this is outside of scope for FIPS and it does not make sense to include a warning here.

@n1v0lg n1v0lg closed this as completed Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Security/FIPS Running ES in FIPS 140-2 mode Team:Security Meta label for security team
Projects
None yet
Development

No branches or pull requests

3 participants