Skip to content
← Back to activity

Public problem

Cerbos git storage fail knownhosts key mismatch ssh

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Cerbos with the git storage driver (protocol ssh, cloning from github.com) fails to start with a knownhosts: key mismatch error. The SSH known_hosts inside the container does not match GitHub's current host keys.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Populate the container's knownhosts from ssh-keyscan before Cerbos starts: create a ConfigMap with the output of ssh-keyscan github.com and mount it at /etc/ssh/sshknown_hosts for all Cerbos pods (or do the same in an init container). The reporter confirmed this fixed the clone failure. Also make sure any old cached host keys are cleaned up if GitHub has rotated keys since the image was built.

Source: https://github.com/cerbos/cerbos/issues/517

Source: https://github.com/cerbos/cerbos/issues/517