-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Agent Auto Config: Implement Certificate Generation #8360
Conversation
f980196
to
72d7439
Compare
8804cc6
to
0c285dd
Compare
0cff079
to
da9d453
Compare
0c285dd
to
fc2def9
Compare
da9d453
to
2855e31
Compare
c4d6c6c
to
48ebfb6
Compare
2855e31
to
6c654ac
Compare
48ebfb6
to
51cfb7a
Compare
dd1ab55
to
76d26a7
Compare
76d26a7
to
5606190
Compare
d714351
to
7b1d59a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought that crossed my mind is that we could remove auto-encrypt from the code if there would be a way to translate its config to a matching auto-config config.
7b1d59a
to
c6eb1d6
Compare
@i0rek We could try and merged the auto encrypt and auto config code however it would still need to support the two different RPC endpoints and each endpoint has different type of authorization. There is probably a way to do it well but I think its outside the scope of this PR for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
c6eb1d6
to
db2e760
Compare
Most of the groundwork was layed in previous PRs between adding the cert-monitor package to extracting the logic of signing certificates out of the connect_ca_endpoint.go code and into a method on the server. This also refactors the auto-config package a bit to split things out into multiple files. # Conflicts: # agent/agent.go
03b71e3
to
400d0d1
Compare
🍒✅ Cherry pick of commit 34034b7 onto |
Most of the groundwork was laid in previous PRs between adding the cert-monitor package to extracting the logic of signing certificates out of the connect_ca_endpoint.go code and into a method on the server. This also refactors the auto-config package a bit to split things out into multiple files.
This removes the dependency on
auto_encrypt
for generating and managing the agent's certificate including renewals.This PR includes a couple distinct things.
AutoConfig.InitialConfiguration
RPC endpoint to sign a CSR and push down the certificate, roots and any manually managed CA certs known to that server.CertMonitor
appropriately with the results. This also changes how we persist the RPC response and restore it when restarting the agent. Instead of just persisting theConfig
already translated and ready to be used as a config source we encode the entire response with the json protobuf marshaller. Then when restoring we pull out the config and translate it to the appropriate structure capable of being used as a config source. The restoration process then can reinject the certificates/keys in the RPC response back into theCertMonitor
&tlsutil.Configurator
.TODO: