Skip to content
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

acme: external account binding support #2392

Merged

Conversation

JoshVanL
Copy link
Contributor

@JoshVanL JoshVanL commented Nov 21, 2019

fixes #1676

Adds ACME external account binding support

/assign
/hold

@jetstack-bot jetstack-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Nov 21, 2019
@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. area/acme Indicates a PR directly modifies the ACME Issuer code labels Nov 21, 2019
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoshVanL

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jetstack-bot jetstack-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/documentation Categorizes issue or PR as related to documentation. labels Nov 21, 2019
@JoshVanL JoshVanL force-pushed the acme-external-account-binding branch from 0cbad88 to 6d9473c Compare November 21, 2019 17:58
@jetstack-bot jetstack-bot added area/testing Issues relating to testing size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 21, 2019
@JoshVanL JoshVanL force-pushed the acme-external-account-binding branch 2 times, most recently from f522658 to 78cbe36 Compare November 23, 2019 17:41

// Key is a base64 encoded symmetric key that authenticates the account with
// an external account.
Key string `json:"key,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a sensitive value, given it is used to authenticate/bind a registration to some external system?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, how come this is a base64 encoded string? Does this really mean it is a []byte?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, makes sense to move to a secret

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory you can should be able to use raw []byte data for your symmetric MAC key. base64 encoding makes then becomes a requirement


provisionerDNS01 := &acmeIssuerProvisioner{
eab: eab,
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we only test with EAB enabled now? I'd be happy to just see the suite run using e.g. HTTP01 with EAB enabled (I don't think we really need to run the full DNS01 && HTTP01 suite with EAB enabled), but I'd also like to see this run without EAB enabled too (as before).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should run the acme tests with and without EAB. the passed in eab struct can be nil

third_party/crypto/acme/acme.go Outdated Show resolved Hide resolved
if err != nil {
return nil, err
}
func (c *Client) postJWS(ctx context.Context, key crypto.Signer, accountURL, url, nonce string, body interface{}) (*http.Response, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the comments on every function/method you've changed the signature on to explain what the new parameter is, what it can be set to, and its behaviour if not set?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, how come you've changed this to accept a nonce instead of just retrieving one as before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all, we should attempt to keep the diff in third_party as minimal as possible IMO 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this signature shouldn't need to change I think. Some things moved around in dev but was moved back. Forgot about reverting this change

@munnerz munnerz force-pushed the acme-external-account-binding branch from 326d360 to 7ef9782 Compare December 3, 2019 12:00
@jetstack-bot jetstack-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 3, 2019
@munnerz munnerz force-pushed the acme-external-account-binding branch 5 times, most recently from 013fee8 to 5d9391e Compare December 3, 2019 17:38
@munnerz munnerz added this to In progress in v0.13 via automation Dec 3, 2019
@munnerz munnerz added this to the v0.13 milestone Dec 3, 2019
@munnerz munnerz force-pushed the acme-external-account-binding branch from bad13ae to 3b33bd3 Compare December 3, 2019 21:49
@munnerz
Copy link
Member

munnerz commented Dec 4, 2019

Not sure why Pebble is returning this:

  Warning  Failed     4m31s  cert-manager  Accepting challenge authorization failed: acme: authorization error for efsxk.certmanager.kubernetes.network: 400 urn:ietf:params:acme:error:connection: Get https://efsxk.certmanager.kubernetes.network/.well-known/acme-challenge/TRrVcMxk3V2oH6r6WK3kbMzmNvWopGCiRRtsqJHNe3k: http: server gave HTTP response to HTTPS client

in some of the ACME test cases where nginx is configured to redirect to a HTTPS address. This implies to me that nginx is responding with HTTP content on the HTTPS port 🤔

Retesting to see if this is a flake, and will audit changes to Pebble since the old vs new commit as I've not seen this before!

/retest

@munnerz
Copy link
Member

munnerz commented Dec 4, 2019

After some digging in pebble, I think I have identified the cause and I've opened this issue to track it: letsencrypt/pebble#293

@munnerz munnerz force-pushed the acme-external-account-binding branch from 3b33bd3 to 3bb71e5 Compare December 5, 2019 12:19
@munnerz munnerz moved this from In progress to Review in progress in v0.13 Dec 5, 2019
Copy link
Contributor Author

@JoshVanL JoshVanL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments.

We also need to add to the checks for secrets that are referenced by a possible EAB account and have been updated

/unassign
/assign @munnerz

// server.
type ACMEExternalAccountBinding struct {
// keyID is the ID of the CA key that the External Account is bound to.
KeyID string `json:"keyID"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KeyID can be potentially sensitive information. We should er on the side of caution and make this a secret reference

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at this point we can keep it as keyID - it's effectively the 'username' parameter here, and the 'secret' value should be sufficient to protect user accounts. It's not really explored in the RFC, and if needed in future, we can add an additional field for a secret ref variant of this, for those who are more sensitive about key IDs.

pkg/internal/apis/acme/fuzzer/fuzzer.go Show resolved Hide resolved
pkg/internal/apis/acme/types_issuer.go Show resolved Hide resolved
@jetstack-bot jetstack-bot assigned munnerz and unassigned JoshVanL Dec 10, 2019
@jetstack-bot jetstack-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 11, 2019
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
@munnerz munnerz force-pushed the acme-external-account-binding branch from 6d6219a to ff8c683 Compare December 11, 2019 12:38
@jetstack-bot jetstack-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 11, 2019
@JoshVanL
Copy link
Contributor Author

Looks good to me :)

@munnerz
Copy link
Member

munnerz commented Dec 11, 2019

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 11, 2019
@jetstack-bot jetstack-bot merged commit 9d95d2b into cert-manager:master Dec 11, 2019
v0.13 automation moved this from Review in progress to Done Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/acme Indicates a PR directly modifies the ACME Issuer code area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/documentation Categorizes issue or PR as related to documentation. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
No open projects
v0.13
  
Done
Development

Successfully merging this pull request may close these issues.

ExternalAccountBinding (EAB) Support
3 participants