Commit Graph

6939 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews cb56bf6beb
ca: log cert signing using JSON objects (#7742)
This makes the log events easier to parse, and makes it easier to
consistently use the correct fields from the issuance request.

Also, reduce the number of fields that are logged on error events.
Logging just the serial and the error in most cases should suffice to
cross-reference the error with the item that we attempted to sign.

One downside is that this increases the total log size (10kB above, vs
7kB from a similar production issuance) due in part to more repetition.
For example, both the "signing cert" and "signing cert success" log
lines include the full precert DER.

Note that our long-term plan for more structured logs is to have a
unique event id to join logs on, which can avoid this repetition. But
since we don't currently have convenient ways to do that join, some
duplication (as we currently have in the logs) seems reasonable.
2024-11-04 16:54:07 -08:00
Matthew McPherrin 1fa66781ee
Allow admin command to block key from a CSR file (#7770)
One format we receive key compromise reports is as a CSR file. For
example, from https://pwnedkeys.com/revokinator

This allows the admin command to block a key from a CSR directly,
instead of needing to validate it manually and get the SPKI or key from
it.

I've added a flag (default true) to check the signature on the CSR, in
case we ever decide we want to block a key from a CSR with a bad
signature for whatever reason.
2024-11-04 15:11:43 -08:00
Jacob Hoffman-Andrews 02685602a2
web: add feature flag PropagateCancels (#7778)
This allow client-initiated cancels to propagate through gRPC.

IN-10803 tracks the SRE-side changes to enable this flag.
2024-11-04 14:37:29 -08:00
Aaron Gable 21bc647fa5
Simplify TestTraces to reduce specificity (#7785)
TestTraces is designed to test whether our Open Telemetry tracing system
is working: that spans are being output, that they have the appropriate
parents, etc. It should not be testing whether Boulder took a specific
path through its code -- that's the domain of package-specific unit
tests. Simplify TestTraces to the point that it is asserting (nearly)
the bare minimum about the set of operations Boulder performs.
2024-11-04 12:02:57 -08:00
James Renken 4adc65fb7d
Rate limits: replace redis SET with INCRBY (#7782)
Add a new method, `BatchIncrement`, to issue `IncrBy` (instead of `Set`)
to Redis. This helps prevent the race condition that allows bursts of
near-simultaneous requests to, effectively, spend the same token.

Call this new method when incrementing an existing key. New keys still
need to use `BatchSet` because Redis doesn't have a facility to, within
a single operation, increment _or_ set a default value if none exists.

Add a new feature flag, `IncrementRateLimits`, gating the use of this
new method.

CPS Compliance Review: This feature flag does not change any behaviour
that is described or constrained by our CP/CPS. The closest relation
would just be API availability in general.

Fixes #7780
2024-11-04 11:20:44 -08:00
Jacob Hoffman-Andrews 2d69d7b9df
wfe: set Retry-After header on 500s (#7781) 2024-11-04 10:34:11 -08:00
Jacob Hoffman-Andrews 3377102aa8
issuance: ignore some ignored lints (#7771)
This improves deployability for the v3.6.2 release of zlint.

Fixes #7756
2024-10-28 13:51:18 -07:00
Samantha Frank b69c005d85
WFE: Use JSON tags to omit the Authorization ID and RegistrationID fields (#7769)
Use the `-` JSON tag to omit `ID` and `RegistrationID` fields instead of
mutating the core.Authorization object.
2024-10-28 14:52:18 -04:00
Jacob Hoffman-Andrews e182d889b2
sa: document the storage of linting certificates (#7772)
The naming of our `precertificates` table (now used to store linting
certificates) is definitely confusing, so add some more comments in
various places explaining. See #6807.
2024-10-28 10:23:39 -07:00
Samantha Frank 6e6c8fe480
ratelimits: Update errors to deep link to individual limits documentation (#7767)
Updates rate limits error messages to deep link to new website docs added in https://github.com/letsencrypt/website/pull/1756.
2024-10-25 13:55:51 -04:00
Samantha Frank 6c85b8d019
wfe/sa/features: Deprecate TrackReplacementCertificatesARI (#7766) 2024-10-24 13:38:33 -04:00
Samantha Frank e5edb7077f
wfe/features: Deprecate UseKvLimitsForNewOrder (#7765)
Default code paths that depended on this flag to be true.

Part of #5545
2024-10-23 18:13:24 -04:00
dependabot[bot] 844334e04a
build(deps): bump the aws group across 1 directory with 4 updates (#7757)
Bumps the aws group with 3 updates in the / directory:
[github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2),
[github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2)
and
[github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2).

Updates `github.com/aws/aws-sdk-go-v2` from 1.31.0 to 1.32.2
Updates `github.com/aws/aws-sdk-go-v2/config` from 1.27.39 to 1.27.43
Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.63.3 to 1.65.3
Updates `github.com/aws/smithy-go` from 1.21.0 to 1.22.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 17:15:48 -04:00
Samantha Frank 71178f4ca4
WFE: Track in-flight for "/" (#7759) 2024-10-18 12:59:26 -04:00
Samantha Frank d0c9aa3808
WFE: Track in-flight HTTP requests by endpoint using a gauge (#7758) 2024-10-18 09:51:02 -04:00
Samantha Frank d17d71cc6e
ratelimits: Rename bucket.go to transaction.go (#7753) 2024-10-16 18:57:48 -04:00
Samantha Frank 6692160ced
test-cli: Pass -v/--verbose flag to Go integration tests (#7754)
Also remove -o/--list-integration-tests, this flag isn't really that
useful.
2024-10-10 15:26:15 -04:00
James Renken b0bcbb12aa
SA: Create list of authzIDs earlier in NewOrderAndAuthzs (#7744)
Creating the list of authzIDs earlier in NewOrderAndAuthzs:
- Saves a `for` loop with duplicated code; we no longer need to range
over two different slices, just one.
- Allows us to create the Order PB later, after more of the data
collection logic, without interrupting it. This makes the order of
operations slightly easier to follow.
2024-10-10 09:55:02 -07:00
Samantha Frank 37b85fbd38
VA/RVA: Add metadata necessary for the MPIC ballot (#7732)
- Add `Perspective` and `RIR` fields to the remote-va configuration
- Configure RVA ValidationAuthorityImpl instances with the contents of
the JSON configuration
- Configure VA ValidationAuthorityImpl instances with the constant
`va.PrimaryPerspective`
- Log `Perspective` for non-Primary Perspectives, per the MPIC
requirements in section 5.4.1 (2) vii of the BRs. Also log the RIR for
posterity.
- Introduce `ValidationResult` RPC fields `Perspective` and `Rir`, which
are not currently used but will be required for corroboration in #7616

Fixes https://github.com/letsencrypt/boulder/issues/7613
Part of https://github.com/letsencrypt/boulder/issues/7615
Part of https://github.com/letsencrypt/boulder/issues/7616
2024-10-10 09:37:55 -04:00
Samantha Frank c5dae06ffc
ratelimits: Add unit test coverage for TransactionBuilder methods (#7752) 2024-10-09 19:30:51 -04:00
James Renken 15c8752534
ceremony: Remove deprecated id-qt-cps support (#7750)
Fixes #7726
2024-10-08 16:09:33 -04:00
huochexizhan a6dc97cb5b
fix: fix slice init length (#7731)
Initialize a slice with a capacity of len(nameToString) rather than initializing
the length of this slice.

Signed-off-by: huochexizhan <huochexizhan@outlook.com>
2024-10-08 11:32:25 -04:00
dependabot[bot] 0a543d151b
build(deps): bump the aws group across 1 directory with 4 updates (#7734) 2024-10-07 13:39:28 -07:00
dependabot[bot] 61ff7f606d
Update OTel dependencies (#7713)
Updates:
- go.opentelemetry.io/contrib/instrumentation (and subpackages) from 0.52.0 to 0.55.0
- go.opentelemetry.io/otel (and subpackages) from 1.27.0 to 1.30.0

Upstream release notes:
https://github.com/open-telemetry/opentelemetry-go-contrib/releases

Also transitively updates a few golang.org/x/ dependencies, and the grpc and protobuf
dependencies.
2024-10-07 13:22:08 -07:00
Samantha Frank 2e19a362ec
WFE/RA: Default codepaths to CheckRenewalExemptionAtWFE: true (#7745)
Also, remove redundant renewal checks in
`RA.checkNewOrdersPerAccountLimit()` and
`RA.checkCertificatesPerNameLimit()`.

Part of #7511
2024-10-07 15:12:30 -04:00
Aaron Gable 08615e3898
Deprecated goodkey.BlockedKeyFile (#7749)
This config field duplicates functionality that is better provided by
the blockedKeys database table. We should only have one mechanism for
blocking keys, so this one should be removed.

Mark it deprecated as a warning to any downstream consumers of Boulder.

Part of https://github.com/letsencrypt/boulder/issues/7748
2024-10-07 15:00:45 -04:00
Samantha Frank d656afce78
ratelimits: Rename DomainsForRateLimiting() to clarify use (#7746)
Rename as suggested by @jsha in #7729.
2024-10-07 14:56:36 -04:00
Phil Porada 56d392793a
Allow block-a-key to process private key files (#7737)
The CAB/F Debian weak keys (https://github.com/cabforum/Debian-weak-keys)
repository contains a bunch of DER encoded private keys that we should ensure
are blocked. I hacked up the block-a-key tool to output a base64 encoded SPKI
hash from an arbitrary PEM formatted private key file.
2024-10-07 14:56:14 -04:00
Aaron Gable 7b032a663f
Add feature flag to remove use of "INSERT RETURNING" in NewOrderAndAuthzs (#7739)
This is our only use of MariaDB's "INSERT ... RETURNING" syntax, which
does not exist in MySQL and Vitess. Add a feature flag which removes our
use of this feature, so that we can easily disable it and then re-enable
it if it turns out to be too much of a performance hit.

Also add a benchmark showing that the serial-insertion approach is
slower, but perhaps not debilitatingly so.

Part of https://github.com/letsencrypt/boulder/issues/7718
2024-10-04 14:56:44 -07:00
Jacob Hoffman-Andrews 58f515ef58
ca: make precertificate logging consistent (#7741)
Previously, we logged csr.DNSNames along with the precertificate
issuance events, but this was potentially misleading. For instance, if a
CSR contained only a CN and no SANs, this set would be empty.

Instead, log the uniquified, lowercased, sorted SANs that are actually
issued.

Also, emit precert=[] in issuePrecertificateInner, which is consistent
with the field name used when the final certificate is issued.

Note: this definitely underscores why it would be better to log these
things in a more structured way, for instance logging the
`issuance.IssuanceRequest` encoded as JSON, but I wanted to get these
quick fixes out of the way first.
2024-10-04 16:56:33 -04:00
James Renken beddae5970
Introduce SerialPrefixHex field in CA (#7721)
Add a new SerialPrefixHex field to the CA's config, which takes a
two-character hexadecimal string to use as the serial prefix. This
matches the way that the OCSP Responder's acceptable serial prefixes are
configured, and is easier for human operators to configure than raw
integers.

At the same time, change the type of the CA's internal serial prefix
from `int` to `byte`, using the type system to enforce its 8-bit length.

Fixes #7213
2024-10-04 10:50:57 -07:00
Matthew McPherrin a731497958
Add spans around (pre)certificate signing (#7707)
This adds custom spans around one of the more important parts of the
issuance stack - actually signing the (pre)certificates. We only have
automatic tracing right now, so this is just a small step towards adding
more customization there.

One specific note: I didn't include the regID in the span attributes,
though it is in the nearby log lines. I think that's something we likely
want to handle holistically (eg, via baggage propagation) rather than
one-off in manual spans like this.
2024-10-02 12:00:47 -07:00
Kruti Sutaria e9b6148448
Remove code that rejects old TLS requests (#7711)
The Boulder WFE accepts incoming connections (from our load balancers)
via either TLS or plain HTTP. When those connections are made over TLS,
it already enforces that the client be using TLS 1.3 or above. When those
connections are made over plain HTTP, the load balancer includes the TLS
version as a header, and Boulder was performing filtering based on that.

Our load balancers are now configured to reject older TLS versions, so we
can remove this check.

Fixes https://github.com/letsencrypt/boulder/issues/7710
2024-10-01 11:34:20 -07:00
Samantha Frank 61a9aa5353
WFE: Plumb ARI explanationURL through for incidents (#7730) 2024-09-30 15:25:22 -04:00
Samantha Frank ab69b72901
VA: Fix performRemoteValidation goroutine leak (#7727)
PerformValidation goroutines write to a buffered results channel to
prevent blocking.
2024-09-30 14:51:06 -04:00
Samantha Frank d850e633ae
ratelimits: Use full domain for the FailedAuthorizations limit (#7729)
The key-value implementation for the Failed Authorizations limit
mistakenly used eTLD+1 instead of the full domain, unlike its
predecessor.
2024-09-30 14:50:35 -04:00
Samantha Frank 2fa9fbcd23
SA: Add feature flag DisableLegacyLimitWrites (#7728) 2024-09-30 14:09:40 -04:00
Samantha Frank c034221f59
config: Default to checking renewal exemption at WFE (#7706)
Part of https://github.com/letsencrypt/boulder/issues/7511
2024-09-27 16:42:54 -04:00
James Renken 267c82dc25
Change ClearEmail to use a direct UPDATE query (#7724)
Change ClearEmail to use a direct `UPDATE` query instead of
`tx.Update()`, in order to avoid `LockCol` issues.

Part of https://github.com/letsencrypt/boulder/issues/7716
2024-09-27 12:39:27 -07:00
Matthew McPherrin 8dac30f1ad
Log the time hourly (#7723)
Logging it every minute is just a bit too much log volume and adds a
fair amount of clutter, especially for 'quieter' services.
2024-09-26 11:49:54 -07:00
cui fliter d71b4bc62b
Fix CT log loading error message (#7725)
The intention here should be to initialize a slice with a capacity of
len(remaining) rather than initializing the length of this slice, so that
the resulting error message doesn't start with empty-string entries.
2024-09-26 10:22:27 -07:00
Samantha Frank 3451952a6e
WFE: Only log warnings for non-limit errors (#7717)
Only log errors from `wfe.checkNewOrderLimits` and
`wfe.checkNewAccountLimits` if they're not `errors.RateLimit`.
2024-09-26 11:20:49 -04:00
Samantha Frank 8c009f2c5e
WFE: Suppress logging of probs.PausedProblem (#7719)
Instead of logging the message shown to the caller, log "429 ::
rateLimited :: account/ident pair is paused"
2024-09-26 11:20:26 -04:00
Samantha Frank c6849960d3
admin: Perform unpauseAccount batches in parallel (#7690)
- Deduplicates accounts being unpaused
- Dispatches (default: 10) SA.UnpauseAccount calls in parallel
- Retries AccountIDs with unpause.RequestLimit (50,000) unpaused
identifiers

Fixes https://github.com/letsencrypt/boulder/issues/7682
2024-09-26 11:20:08 -04:00
Samantha Frank 1b6e0867ae
ratelimits: Set a TTL each time we store bucket data in Redis (#7720)
Set the Redis TTL to TAT (theoretical arrival time) plus a 10-minute
buffer to account for possible clock skew.
2024-09-26 11:19:53 -04:00
Matthew McPherrin 2e2bb944cc
Make upgrading OpenTelemetry easier (#7712)
OpenTelemetry has "semantic conventions" which are versioned
independently of the software package, as it describes the semantics of
the resources being produced. Previously, we'd combined
`resource.Default()` using the `Merge` function with our own resources.

Merge, however, doesn't handle merging resources with different semantic
conventions. This means that every dependabot PR that bumps otel will
break when the `resources.Default` has a new version.

That doesn't seem worth it for the default resources, so just provide
our own resources which have everything we care about. I've added the
PID which we didn't have before but will be interesting. We will lose
the SDK's version, but I don't think that matters.

For more discussion on this topic, see
https://github.com/open-telemetry/opentelemetry-go/issues/3769
2024-09-24 16:37:27 -07:00
Aaron Gable 990ad076b7
Update CI to go1.23.1, remove go1.22.5 (#7699)
https://go.dev/doc/devel/release#go1.23.1
2024-09-11 10:09:01 -04:00
James Renken 412e959063
Allow CSRs whose CN is longer than acceptable (#7700)
Also rework comments & test names for clarity, add tests for this new CN
handling, and change/remove tests that should indeed no longer fail.

Fixes https://github.com/letsencrypt/boulder/issues/7623
2024-09-10 14:05:32 -04:00
James Renken 77fcc8f58a
Remove outdated integration test limitations (#7698)
Remove outdated limitations in TestIssuanceCertStorageFailed &
TestSubordinateCAChainsServedByWFE

Fixes https://github.com/letsencrypt/boulder/issues/7696
2024-09-04 17:10:58 -07:00
James Renken 707b734a75
Remove outdated limitation in TestNonceBalancer (#7694)
Also fix minor typos in comments.

Part of https://github.com/letsencrypt/boulder/issues/7696
2024-09-04 13:35:20 -07:00