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

Leaked host key check: Avoid false positives from FIPS mode #748

Merged
merged 1 commit into from
Jul 6, 2021

Conversation

mumfy
Copy link
Contributor

@mumfy mumfy commented Jun 18, 2021

Enabling FIPS (Federal Information Processing Standards) mode on the backup server
may cause ssh-keygen's MD5-based fingerprint generation to fail.

A "fingerprint_one_key: sshkey_fingerprint failed" message is written to stderr
whilst nothing is written to stdout, so the fingerprint variable is blank.

A grep search for an empty string succeeds, so ghe-detect-leaked-ssh-keys
reports that a leaked hostkey was found.

This change detects this condition and the final output says if the hostkey check was skipped.

closes: #749

Enabling FIPS (Federal Information Processing Standards) mode
may cause ssh-keygen's MD5-based fingerprint generation to fail,
resulting in a message on stderr and a blank fingerprint string.

A grep search for an empty string succeeds so a blank fingerprint
is reported as a leaked host key.
@djdefi djdefi requested a review from a team June 21, 2021 16:55
Copy link
Contributor

@bwestover bwestover left a comment

Choose a reason for hiding this comment

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

I like this general solution. Thanks for the write up and the fix 👍

@djdefi
Copy link
Member

djdefi commented Jun 30, 2021

The macos CI failure here is a known failure, so I think this is good to merge @mumfy

@mumfy mumfy merged commit 603bf21 into master Jul 6, 2021
@mumfy mumfy deleted the mumfy/leaked-key-check-improvement branch July 6, 2021 00:39
@Dwayne227

This comment has been minimized.

Copy link

@MintThitiratChamnan MintThitiratChamnan left a comment

Choose a reason for hiding this comment

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

Up date

This was referenced Sep 9, 2021
@rigrell28

This comment has been minimized.

@rigrell28

This comment has been minimized.

Copy link

@rigrell28 rigrell28 left a comment

Choose a reason for hiding this comment

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

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants