Permalink
Please sign in to comment.
Browse files
Merge pull request #7278 from axw/ssh-stricthostkeychecking
Put the secure into secure shell ## Description of change Up until now, Juju bootstrap has had an insecure initial SSH connection. The client had no way of knowing the server's host key, and so strict host key checking was disabled. This branch does two main things: - updates to the new juju/utils version which defaults strict host key checking to "ask" (unless overridden in OpenSSH client config) for both the golang.org/x/crypto and openssh implementations - generates and injects an SSH host key into the created server via cloud-init, then uses the public key to perform strict host key checking. The key is regenerated server-side as the first thing the initial SSH connection does, so that user code deployed to controllers cannot sniff the keys from metadata services. ## QA steps 1. juju bootstrap localhost 2. lxc launch ubuntu:xenial x 3. lxc file push ~/.ssh/id_rsa.pub x/home/ubuntu/.ssh/authorized_keys 4. juju add-machine ssh:<ip-of-x> 5. juju ssh -m controller 0 true 6. juju ssh 0 true Repeat with "ssh" removed from $PATH. There should be no warnings about SSH host keys changing, nor warnings about host keys being added to known_hosts. ## Documentation changes There is one change for users: on Windows, manual provisioning will now prompt the user to verify host SSH keys. ## Bug reference Fixes https://bugs.launchpad.net/juju/+bug/1683099 Fixes https://bugs.launchpad.net/juju/+bug/1579593
- Loading branch information...
Showing
with
478 additions
and 88 deletions.
- +12 −0 cloudconfig/cloudinit/cloudinit.go
- +26 −0 cloudconfig/cloudinit/cloudinit_test.go
- +21 −0 cloudconfig/cloudinit/interface.go
- +28 −0 cloudconfig/instancecfg/instancecfg.go
- +10 −2 cloudconfig/sshinit/configure.go
- +36 −0 cloudconfig/userdatacfg_test.go
- +34 −0 cloudconfig/userdatacfg_unix.go
- +1 −5 cmd/juju/commands/ssh_common.go
- +2 −2 dependencies.tsv
- +6 −1 juju/home.go
- +137 −13 provider/common/bootstrap.go
- +99 −11 provider/common/bootstrap_test.go
- +11 −0 provider/common/mock_test.go
- +34 −50 provider/ec2/local_test.go
- +1 −1 provider/manual/environ.go
- +9 −1 provider/rackspace/environ.go
- +9 −1 provider/rackspace/environ_test.go
- +2 −1 state/autocertcache.go
Oops, something went wrong.
0 comments on commit
fbe29cb