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

Issue 37090043: Remove secrets-pushing for new bootstraps, API

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

Description

Remove secrets-pushing for new bootstraps, API - environs/BootstrapConfig now no longer removes secret attributes from configuration. This is on account of configuration not being populated into cloud-init config now. - juju/NewAPIConn now no longer pushes secrets, as it is not necessary. This was not present in 1.16, so it is not a compatibility concern. If we're okay with disabling new CLI from initialising an old juju server, then we can also remove secrets pushing from juju/NewConn. Doing this would allow us to drop all notion of "secret attributes". https://code.launchpad.net/~axwalk/juju-core/api-disable-secrets-pushing/+merge/197673 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 14

Patch Set 2 : Remove secrets-pushing for new bootstraps, API #

Total comments: 4

Patch Set 3 : Remove secrets-pushing for new bootstraps, API #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -66 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/cloudinit_test.go View 1 chunk +0 lines, -1 line 0 comments Download
M environs/config.go View 1 2 1 chunk +6 lines, -16 lines 0 comments Download
M environs/config_test.go View 1 chunk +0 lines, -1 line 0 comments Download
M juju/api.go View 2 chunks +0 lines, -36 lines 1 comment Download
M juju/apiconn_test.go View 5 chunks +2 lines, -5 lines 0 comments Download
M juju/conn_test.go View 1 2 1 chunk +18 lines, -6 lines 0 comments Download
M juju/export_test.go View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 11
axw
Please take a look.
10 years, 5 months ago (2013-12-04 10:29:26 UTC) #1
fwereade
I think we should keep the secret-handling in Conn, until we actually lose Conn itself ...
10 years, 5 months ago (2013-12-04 14:06:27 UTC) #2
fwereade
This is great, just a few notes. Rog, can you think of any disadvantage to ...
10 years, 5 months ago (2013-12-04 14:13:08 UTC) #3
axw
Please take a look. https://codereview.appspot.com/37090043/diff/1/environs/cloudinit_test.go File environs/cloudinit_test.go (left): https://codereview.appspot.com/37090043/diff/1/environs/cloudinit_test.go#oldcode130 environs/cloudinit_test.go:130: srvKeyPEM := mcfg.StateServerKey On 2013/12/04 ...
10 years, 5 months ago (2013-12-05 07:40:34 UTC) #4
rog
Looks great. A few remarks below. https://codereview.appspot.com/37090043/diff/1/environs/cloudinit_test.go File environs/cloudinit_test.go (left): https://codereview.appspot.com/37090043/diff/1/environs/cloudinit_test.go#oldcode130 environs/cloudinit_test.go:130: srvKeyPEM := mcfg.StateServerKey ...
10 years, 5 months ago (2013-12-05 13:20:21 UTC) #5
axw
https://codereview.appspot.com/37090043/diff/1/juju/conn_test.go File juju/conn_test.go (right): https://codereview.appspot.com/37090043/diff/1/juju/conn_test.go#newcode137 juju/conn_test.go:137: // Verify we have secrets in the environ config ...
10 years, 5 months ago (2013-12-05 15:05:25 UTC) #6
rog
https://codereview.appspot.com/37090043/diff/1/juju/conn_test.go File juju/conn_test.go (right): https://codereview.appspot.com/37090043/diff/1/juju/conn_test.go#newcode137 juju/conn_test.go:137: // Verify we have secrets in the environ config ...
10 years, 5 months ago (2013-12-05 15:35:09 UTC) #7
axw
On 2013/12/05 15:35:09, rog wrote: > https://codereview.appspot.com/37090043/diff/1/juju/conn_test.go > File juju/conn_test.go (right): > > https://codereview.appspot.com/37090043/diff/1/juju/conn_test.go#newcode137 > ...
10 years, 5 months ago (2013-12-06 02:35:50 UTC) #8
axw
Please take a look.
10 years, 5 months ago (2013-12-06 09:52:02 UTC) #9
fwereade
Essentially LGTM -- you can land this now, but let's come to a decision re ...
10 years, 5 months ago (2013-12-09 10:33:10 UTC) #10
axw
10 years, 5 months ago (2013-12-10 02:53:08 UTC) #11
On 2013/12/09 10:33:10, fwereade wrote:
> Essentially LGTM -- you can land this now, but let's come to a decision re the
> CA cert private key and whether we push it during bootstrap, or enable
> delegation; and land that followup sooner rather than later. Does anyone feel
> strongly either way?

Just throwing an alternative out there (based on the "push during bootstrap"
option). It has come up on the mailing list that it would be useful to operate
over SSH, to better deal with restricted access environments (i.e. so you don't
need to use sshuttle.)

So, we could generate the cert/keys entirely server side, and never use it for
the CLI. The CLI could SSH to the machine with a forwarded port (or multiplex
over the stdio), and the API server could allow plaintext communication to
localhost. This way we get SSH proxying, with only SSH keys stored outside the
environment.

> https://codereview.appspot.com/37090043/diff/1/environs/cloudinit_test.go
> File environs/cloudinit_test.go (left):
> 
>
https://codereview.appspot.com/37090043/diff/1/environs/cloudinit_test.go#old...
> environs/cloudinit_test.go:130: srvKeyPEM := mcfg.StateServerKey
> On 2013/12/05 13:20:21, rog wrote:
> > On 2013/12/04 14:13:09, fwereade wrote:
> > > It concerns me a little that this is increasingly poorly-named, because
it's
> > now
> > > about initializing juju not driving cloudinit. Can we just rename
> > > environs/cloudinit and this file (and associated types...) now please?
> > 
> > I'm not entirely sure. The principal function of this package is to
transform
> a
> > MachineConfig structure into a cloudinit structure, which seems quite
> > cloudinit-specific to me and reasonably well focused.
> > 
> > What's changed about this package that leads to to think that it's changed
> > enough to warrant a rename?
> > 
> > BTW, I could easily see the MachineConfig type moving out of this package
> FWIW.
> > 
> > If we *are* to rename this package, then perhaps environs/init might work -
> > after all it's all juju around here :-)
> 
> I think we've got our concepts a bit tangled around here. We're treating
> cloudinit as the canonical representation and generating different forms of
> initialization from one of those, rather than generating an initialization
type
> and rendering it into a cloudinit form. (That's why I was grumpy about
creating
> environs/cloudinit in the first place -- I feared it'd entrench exactly this
> ill-factoring -- but I guess I didn't express myself well.)

Fair call. When I did the synchronous bootstrap work, I did start down the road
of creating a new canonical representation. It would've essentially ended up as
a clone of a subset of cloudinit.Config, though, so it didn't seem worthwhile at
the time. It may be worthwhile revisiting.

> https://codereview.appspot.com/37090043/diff/1/environs/config.go
> File environs/config.go (left):
> 
> https://codereview.appspot.com/37090043/diff/1/environs/config.go#oldcode218
> environs/config.go:218: // We never want to push admin-secret or the root CA
> private key to the cloud.
> On 2013/12/05 13:20:21, rog wrote:
> > On 2013/12/05 07:40:35, axw wrote:
> > > On 2013/12/04 14:13:09, fwereade wrote:
> > > > FWIW, we rather do want to push the CA private key now, because we'll
need
> > to
> > > > generate new certs for new state servers soon. Maybe not necessary to
> change
> > > it
> > > > now.
> > > 
> > > Okay. Regarding your question about "generating the [ca private key] on
the
> > > server side": it wouldn't be *too* hard, but it will mean we'll need to
> > >  - update jujud to be able to generate certs/keys, so we can initialise
> mongo
> > >  - update agent config code to take the cert/key from a file (?)
> > >  - update worker/localstorage to generate a new key server-side also. This
> > would
> > > mean threading the CA cert/key through somehow.
> > > 
> > > Not overly difficult, but I think it warrants a CL to itself.
> > 
> > If we generate the root CA private key on the server side, otherwise how do
we
> > verify that we're talking to the right server when we make our initial
> > connection? If we don't do key verification then ISTM that we're vulnerable
to
> a
> > MitM attack even if the transport to the provider API is secure (if it isn't
> > then all bets are off, of course).
> > 
> > BTW even if we don't push the root CA private key, we can still push a
> cert/key
> > that can be used to sign new state server certs - we'd just need to turn on
> the
> > delegation flag.
> 
> Good points, well made. Am undecided as to whether keeping the root CA on the
> bootstrapping client and delegating is actually a win over pushing the private
> key up once we've got a secure connection... you're right it shouldn't be part
> of this CL though.
> 
> https://codereview.appspot.com/37090043/diff/30001/juju/api.go
> File juju/api.go (left):
> 
> https://codereview.appspot.com/37090043/diff/30001/juju/api.go#oldcode98
> juju/api.go:98: }
> I think I already made this comment earlier, but it deserves a repeat: \o/
Sign in to reply to this message.

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