Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(148)

Issue 43730044: Create a system ssh identity on bootstrap

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by thumper
Modified:
10 years, 4 months ago
Reviewers:
axw, mp+199572, rog
Visibility:
Public.

Description

Create a system ssh identity on bootstrap When an environment is bootstrapped, a system ssh identity is created and written to the data directory. The public key part is added to the authorized keys. https://code.launchpad.net/~thumper/juju-core/system-ssh-key/+merge/199572 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 19

Patch Set 2 : Create a system ssh identity on bootstrap #

Total comments: 6

Patch Set 3 : Create a system ssh identity on bootstrap #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -22 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cloudinit/sshinit/configure_test.go View 1 chunk +1 line, -1 line 0 comments Download
M dependencies.tsv View 1 2 1 chunk +1 line, -1 line 0 comments Download
A doc/system-ssh-key.txt View 1 2 1 chunk +24 lines, -0 lines 0 comments Download
M environs/cloudinit.go View 1 chunk +2 lines, -1 line 0 comments Download
M environs/cloudinit/cloudinit.go View 1 2 4 chunks +13 lines, -0 lines 0 comments Download
M environs/cloudinit/cloudinit_test.go View 1 2 5 chunks +17 lines, -11 lines 0 comments Download
M environs/manual/bootstrap.go View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M provider/common/bootstrap.go View 1 2 2 chunks +29 lines, -1 line 0 comments Download
M provider/common/bootstrap_test.go View 1 2 4 chunks +12 lines, -3 lines 0 comments Download
M provider/ec2/local_test.go View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M provider/local/environ.go View 1 2 3 chunks +13 lines, -2 lines 0 comments Download
A utils/ssh/generate.go View 1 1 chunk +49 lines, -0 lines 0 comments Download
A utils/ssh/generate_test.go View 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 7
thumper
Please take a look.
10 years, 4 months ago (2013-12-18 21:57:27 UTC) #1
axw
https://codereview.appspot.com/43730044/diff/1/environs/cloudinit/cloudinit.go File environs/cloudinit/cloudinit.go (right): https://codereview.appspot.com/43730044/diff/1/environs/cloudinit/cloudinit.go#newcode262 environs/cloudinit/cloudinit.go:262: identityFile := ssh.SystemIdentityFilename(cfg.DataDir) See comment on ssh.SystemIdentityFilename: the path ...
10 years, 4 months ago (2013-12-19 01:50:05 UTC) #2
rog
Looks reasonable if we actually want to do this, but I have my reservations. I'd ...
10 years, 4 months ago (2013-12-19 11:59:17 UTC) #3
thumper
Please take a look. https://codereview.appspot.com/43730044/diff/1/doc/system-ssh-key.txt File doc/system-ssh-key.txt (right): https://codereview.appspot.com/43730044/diff/1/doc/system-ssh-key.txt#newcode2 doc/system-ssh-key.txt:2: potential use-cases. On 2013/12/19 11:59:17, ...
10 years, 4 months ago (2013-12-19 22:16:10 UTC) #4
axw
On 2013/12/19 22:16:10, thumper wrote: > Please take a look. > > https://codereview.appspot.com/43730044/diff/1/doc/system-ssh-key.txt > File ...
10 years, 4 months ago (2013-12-20 01:16:53 UTC) #5
rog
https://codereview.appspot.com/43730044/diff/1/provider/common/bootstrap.go File provider/common/bootstrap.go (right): https://codereview.appspot.com/43730044/diff/1/provider/common/bootstrap.go#newcode95 provider/common/bootstrap.go:95: return "", fmt.Errorf("failed to create system key: %v", err) ...
10 years, 4 months ago (2013-12-20 09:19:41 UTC) #6
thumper
10 years, 4 months ago (2014-01-05 22:33:13 UTC) #7
Please take a look.

https://codereview.appspot.com/43730044/diff/20001/doc/system-ssh-key.txt
File doc/system-ssh-key.txt (right):

https://codereview.appspot.com/43730044/diff/20001/doc/system-ssh-key.txt#new...
doc/system-ssh-key.txt:12: different purposes just seems like a more robust
idea.
On 2013/12/20 09:19:42, rog wrote:
> I'd like a less hand-wavy justification than this.
> Every extra secret lying around is another potential system vulnerability.
> 
> On the other hand, if there *is* a good reason for using different keys for
> different purposes, perhaps we should consider using different keys for
serving
> the API server and for the mongo server.

When I originally wrote this, I wasn't really intending to commit it to the
tree, so the prose was somewhat fast and loose.

https://codereview.appspot.com/43730044/diff/20001/environs/ssh/systemidentit...
File environs/ssh/systemidentity.go (right):

https://codereview.appspot.com/43730044/diff/20001/environs/ssh/systemidentit...
environs/ssh/systemidentity.go:18: func WriteSystemIdentity(filename string,
privateKey string) error {
On 2013/12/20 09:19:42, rog wrote:
> We're creating an entire new package for a single constant and a function
that's
> semantically almost identical to ioutil.WriteFile?
> 
> Please let's just define SystemIdentityFilename in environs/cloudinit and call
> WriteFile directly inside provider/local, the only caller.

Yeah, I have done this now.

Originally I was going to have this module abstract away more of the information
of the system identity file, but now as you can see it doesn't do much.  I have
now removed this and just call write from the local provider.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b