-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Rethink how we disable challenge types #5913
Comments
A few thoughts on the above.
|
Correct, it was solved by revoking all affected authorizations. But that required manual intervention and additional steps during an incident. We shouldn't need to do that in the future. |
Since I've been thinking about this for other reasons (see bug and PR linked above), here's my proposal for how to approach this. Today, we have one challenge-filtering mechanism: Instead, we should have two wholly separate challenge-filtering mechanisms:
|
This seems like an elegant solution. I think the second filter proposal works perfect for a client interacting with Order objects. The small concern I have is for interacting with Authorization objects during the flow. The concern I have on this is over compatibility with existing clients. Would the challenge not be in the payload due to the filter, or would it be in the payload but listed as invalid, or would it be in the payload with no status? I believe only non-pending authz show a status, the others just show a type/url/token in the spec. Imagine there is a bug with HTTP-01 and it's disabled after an order is made but before challenges are completed. If a subscriber iterates the authz, not seeing the http-01 challenge may cause an error or lockup in their client as it does not know how to act. Seeing a disabled http-01 challenge may let them try to complete it, which should then trigger the error code about the challenge being disabled. |
The challenge would be omitted from the authz payload, just like the HTTP-01 and TLS-ALPN-01 challenges are omitted from wildcard authz payloads. I don't think this is likely to break clients in unexpected ways, since it's what happens when we disable a challenge type today, and unfortunately we've had to do that a couple times in LE's history. |
Within the NewOrderAndAuthzsRequest, replace the corepb.Authorization field with a new sapb.NewAuthzRequest message. This message has all of the same field types and numbers, and the RA still populates all of these fields when constructing a request, for backwards compatibility. But it also has new fields (an Identifier carrying both type and value, a list of challenge types, and a challenge token) which the RA preferentially consumes if present. This causes the content of our NewOrderAndAuthzsRequest to more closely match the content that will be created at the database layer. Although this may seem like a step backwards in terms of abstraction, it is also a step forwards in terms of both efficiency (not having to transmit multiple nearly-identical challenge objects) and correctness (being guaranteed that the token is actually identical across all challenges). After this change is deployed, it will be followed by a change which removes the old fields from the NewAuthzRequest message, to realize the efficiency gains. Part of #5913
Add a new "GetAuthorization" method to the RA. This method is very similar to the SA's existing "GetAuthorization2" method, except that it also uses the RA's built-in Policy Authority to filter out any challenges which are currently disabled. In a follow-up change, the WFE will be updated to use this method when retrieving authorizations and challenges for display, so that we can ensure disabled challenges are not presented to ACME clients. Part of #5913
Remove the id, identifierValue, status, and challenges fields from sapb.NewAuthzRequest. These fields were left behind from the previous corepb.Authorization request type, and are now being ignored by the SA. Since the RA is no longer constructing full challenge objects to include in the request, remove pa.ChallengesFor and replace it with the much simpler pa.ChallengeTypesFor. Part of #5913
Have the WFE ask the RA for authorizations, rather than asking the SA directly. This extra layer of indirection allows us to filter out challenges which have been disabled, so that clients don't think they can attempt challenges that we have disabled. Also shuffle the order of challenges within the authz objects rendered by the API. We used to have code which does this at authz creation time, but of course that was completely ineffectual once we stored the challenges as just a bitmap in the database. Update the WFE unit tests to mock RA.GetAuthorization instead of SA.GetAuthorization2. This includes making the mock more accurate, so that (e.g.) valid authorizations contain valid challenges, and the challenges have their correct types (e.g. "http-01" instead of just "http"). Also update the OTel tracing test to account for the new RPC. Part of #5913
Currently we list all available validation methods in the RA's config file. When we want to disable a challenge type, we remove it from the config file and do a config deploy. So far, so good.
Disabling a challenge type today means two things happen:
boulder/ra/ra.go
Lines 1563 to 1566 in fffd05e
boulder/policy/pa.go
Lines 563 to 574 in fffd05e
The first of these makes sense. When we disable a challenge type, it's probably because we think something is wrong with it, and so we don't want anyone to continue using the potentially-buggy validation path.
The latter of these makes less sense. While it is nice to not include the disabled challenge type in the first place, so that clients don't mistakenly believe that it is an option and get an error when they try to fulfill it, it also means that clients can't ever use that challenge type to validate that authorization, even after we re-enable the challenge type.
And the two effects above miss one critical case: if we believe that a validations performed using a specific challenge type may have been buggy, then we should not allow certificates to be issued based on those validations. But today, the following sequence of events is possible:
We should rethink the challenge enable/disable mechanism, in order to not rely on disabled authorizations while the challenge type is disabled, and in order to allow clients to smoothly begin using the challenge type again when it is re-enabled.
The text was updated successfully, but these errors were encountered: