Commit Graph

50 Commits

Author SHA1 Message Date
Aaron Gable 7744fa3054
Publisher: cache by both URI and pubkey (#7893)
Fixes https://github.com/letsencrypt/boulder/issues/7892
2024-12-17 14:53:08 -08:00
Aaron Gable b92581d620
Better compile-time type checking for gRPC server implementations (#7504)
Replaced our embeds of foopb.UnimplementedFooServer with
foopb.UnsafeFooServer. Per the grpc-go docs this reduces the "forwards
compatibility" of our implementations, but that is only a concern for
codebases that are implementing gRPC interfaces maintained by third
parties, and which want to be able to update those third-party
dependencies without updating their own implementations in lockstep.
Because we update our protos and our implementations simultaneously, we
can remove this safety net to replace runtime type checking with
compile-time type checking.

However, that replacement is not enough, because we never pass our
implementation objects to a function which asserts that they match a
specific interface. So this PR also replaces our reflect-based unittests
with idiomatic interface assertions. I do not view this as a perfect
solution, as it relies on people implementing new gRPC servers to add
this line, but it is no worse than the status quo which relied on people
adding the "TestImplementation" test.

Fixes https://github.com/letsencrypt/boulder/issues/7497
2024-05-28 09:26:29 -07:00
Aaron Gable ab6e023b6f
Simplify issuance.NameID and how it is used (#7260)
Rename "IssuerNameID" to just "NameID". Similarly rename the standalone
functions which compute it to better describe their function. Add a
.NameID() directly to issuance.Issuer, so that callers in other packages
don't have to directly access the .Cert member of an Issuer. Finally,
rearrange the code in issuance.go to be sensibly grouped as concerning
NameIDs, Certificates, or Issuers, rather than all mixed up between the
three.

Fixes https://github.com/letsencrypt/boulder/issues/5152
2024-01-17 12:55:56 -08:00
Aaron Gable 6445feb96b
Publisher: clean up deprecated Request.Precert field (#7165)
Now that the RA is using the pubpb.Request.Kind field, we can delete and
clean up all references to the older Precert field.

Part of https://github.com/letsencrypt/boulder/issues/7161
2023-11-30 13:08:59 -08:00
Aaron Gable e1a8a2ebcd
Publisher: expose submission type in metric labels (#7163)
Give the publisher a more nuanced view of the three kinds of CT
submissions we do: "sct" (submitting a precert to get SCTs), "info"
(submitting a precert but not caring about the result), and "final"
(submitting a final cert and not caring about the result). Expose these
three kinds in the ct_errors_count and ct_submission_time_seconds
metrics, so that they can be separately grouped and alerted on.

This is an improvement over the current status-quo, which only
distinguishes between "precert" and "final" submissions, without being
able to distinguish between SCT-retrieving and purely-informational
submissions of precerts.

This functionality will not be fully operational until the RA begins
informing the publisher of what kind of submission this is.

Part of https://github.com/letsencrypt/boulder/issues/7161
2023-11-27 10:14:10 -08:00
Aaron Gable 9262ca6e3f
Add grpc implementation tests to all services (#6782)
As a follow-up to #6780, add the same style of implementation test to
all of our other gRPC services. This was not included in that PR just to
keep it small and single-purpose.
2023-03-31 09:52:26 -07:00
Aaron Gable 0340b574d9
Add unparam linter to CI (#6312)
Enable the "unparam" linter, which checks for unused function
parameters, unused function return values, and parameters and
return values that always have the same value every time they
are used.

In addition, fix many instances where the unparam linter complains
about our existing codebase. Remove error return values from a
number of functions that never return an error, remove or use
context and test parameters that were previously unused, and
simplify a number of (mostly test-only) functions that always take the
same value for their parameter. Most notably, remove the ability to
customize the RSA Public Exponent from the ceremony tooling,
since it should always be 65537 anyway.

Fixes #6104
2022-08-23 12:37:24 -07:00
Aaron Gable ef1d3c4cde
Standardize on `AssertMetricWithLabelsEquals` (#5371)
Update all of our tests to use `AssertMetricWithLabelsEquals`
instead of combinations of the older `CountFoo` helpers with
simple asserts. This coalesces all of our prometheus inspection
logic into a single function, allowing the deletion of four separate
helper functions.
2021-04-01 15:20:43 -07:00
Aaron Gable 91473b384b
Remove common config from publisher (#5353)
The old `config.Common.CT.IntermediateBundleFilename` format is no
longer used in any production configs, and can be removed safely.

Part of #5162
Part of #5242
Fixes #5269
2021-03-18 16:59:06 -07:00
Samantha f13b8db2eb
Update publisher tests to use new realistic test certs (#5280)
A new, more realistic, test certificate hierarchy was added in #5273.

Update publisher tests to use the test certificate hierarchy now present
at test/hierarchy.

Fixes #5279
2021-02-11 15:24:20 -08:00
Samantha 2efabf57b6
Adding support for multiple issuers to publisher (#5272)
Publisher currently loads a PEM formatted certificate bundle from file
using LoadCertBundle a utility function in the core package.
LoadCertBundle parses the PEM file to a slice of x509.Certificates and
returns them to boulder-publisher (without checking validity). Using
these x509 Certificates, boulder-publisher to construct an ASN1Cert
bundle. This bundle is passed to each new publisher instance. When
publisher receives a request it unconditionally appends this bundle to
each end-entity precertificate for submission to CT logs.

This change augments this process to add support for multiple issuers
using the IssuerNameID concept in the Issuance package. Config field
Common.CT.CertificateBundleFilename has been replaced with the Chains
field. LoadChain, a utility function added in PR #5271, loads and
validates the chain (which nets us some added deploy-time safety) before
returning it to boulder-publisher. Using these x509 Certificates,
boulder-publisher constructs a mapping of IssuerNameID to ASN1Cert
bundle and passes this to each new publisher instance. When publisher
receives a request it determines the IssuerNameID of the precertificate
to select and append the correct ASN1Cert bundle for a given Issuer.

A followup issue #5269 has been created to address removal of the Common
field from the publisher configuration and code has been commented with
TODOs where code will need to be removed or refactored.

Fixes #1669
2021-02-08 12:23:44 -08:00
Jacob Hoffman-Andrews ae24199d80
Switch to syntax = "proto3" for publisher. (#4820)
And make corresponding changes to call sites and wrappers.

Note that proto2 vs proto3 is distinction in the syntax of the .proto files
and doesn't change the wire format, so this meets the deployability
guidelines.
2020-05-27 08:57:57 -07:00
Jacob Hoffman-Andrews 72deb5b798
gofmt code with -s (simplify) flag (#4763)
Found by golangci-lint's `gofmt` linter.
2020-04-08 17:25:35 -07:00
Jacob Hoffman-Andrews 3a1a08a10b
Remove unused code. (#4722)
Found by staticcheck.
2020-03-27 11:55:42 -07:00
Roland Bracewell Shoemaker 5b2f11e07e Switch away from old style statsd metrics wrappers (#4606)
In a handful of places I've nuked old stats which are not used in any alerts or dashboards as they either duplicate other stats or don't provide much insight/have never actually been used. If we feel like we need them again in the future it's trivial to add them back.

There aren't many dashboards that rely on old statsd style metrics, but a few will need to be updated when this change is deployed. There are also a few cases where prometheus labels have been changed from camel to snake case, dashboards that use these will also need to be updated. As far as I can tell no alerts are impacted by this change.

Fixes #4591.
2019-12-18 11:08:25 -05:00
Jacob Hoffman-Andrews 75e1902524 publisher: allow custom UA for CT submissions. (#4492)
Configure "User-Agent: boulder/1.0" for publisher CT submissions.
2019-10-21 15:08:03 -04:00
Roland Bracewell Shoemaker 62db2d0cae publisher: add label to CT log error metric for http status code (#4391) 2019-08-08 08:30:35 -04:00
Roland Bracewell Shoemaker 6f93942a04 Consistently used stdlib context package (#4229) 2019-05-28 14:36:16 -04:00
Daniel McCarney e627f58f97
publisher: remove HTTP GET log probing. (#4223)
We adding this diagnostic probing while debugging an issue that has
since been resolved.
2019-05-23 12:42:26 -04:00
Daniel McCarney 3319246a97 Dev/CI: Add Go 1.11.1 builds (#3888)
Resolves https://github.com/letsencrypt/boulder/issues/3872

**Note to reviewers**: There's an outstanding bug that I've tracked down to the `--load` stage of the integration tests that results in one of the remote VA instances in the `test/config-next` configuration under Go 1.11.1 to fail to cleanly shut down. I'm working on finding the root cause but in the meantime I've disabled `--load` during CI so we can unblock moving forward with getting Go 1.11.1 in dev/CI. Tracking this in https://github.com/letsencrypt/boulder/issues/3889
2018-10-19 09:38:20 -07:00
Roland Bracewell Shoemaker 484fd31460 Probe logs from inside the publisher (#3873)
Does a simpler probe than compared to using a `blackbox_exporter`, but directly collects the info we think will aid debugging publisher outages.

Updates #3821.
2018-09-27 14:42:26 -04:00
Roland Bracewell Shoemaker b5f7c62460 Remove leftover publisher CT config (#3803) 2018-07-27 08:05:51 -04:00
Roland Bracewell Shoemaker e27f370fd3 Excise code relating to pre-SCT embedding issuance flow (#3769)
Things removed:

* features.EmbedSCTs (and all the associated RA/CA/ocsp-updater code etc)
* ca.enablePrecertificateFlow (and all the associated RA/CA code)
* sa.AddSCTReceipt and sa.GetSCTReceipt RPCs
* publisher.SubmitToCT and publisher.SubmitToSingleCT RPCs

Fixes #3755.
2018-06-28 08:33:05 -04:00
Roland Bracewell Shoemaker bd755a31e5 Log error body for non-500 CT submission failures (#3688)
This lets us better debug strange behavior from logs.
2018-05-08 13:20:58 -04:00
Jacob Hoffman-Andrews 76329cc1c0 Add check for correct time in SCTs. (#3570)
In publisher and in the integration test, check that SCTs are in a
reasonable range. Also, update CreateTestingSignedSCT (used by
ct-test-srv) to produce SCTs correctly with a timetamp in Unix epoch
milliseconds.
2018-03-19 14:40:33 -04:00
Roland Bracewell Shoemaker f0e0025143 Extend publisher unittest to cover precert submission/validation 2018-03-09 13:59:32 +00:00
Jacob Hoffman-Andrews a98a206dd2 Remove references to test-ca.pem. (#3322)
shell_test.go and publisher_test.go had unnecessary references to
../test/test-ca.pem. This change makes them a little more self-contained.

Note: ca/ca_test.go still depends on test-ca.pem, but removing the dependency
turns out to be a little more complicated due to hardcoded expectations in some
of the test cases.
2018-01-05 12:07:12 -08:00
Roland Bracewell Shoemaker d5db80ab12 Various publisher CT fixes (#3219)
Makes a couple of changes:
* Change `SubmitToCT` to make submissions to each log in parallel instead of in serial, this prevents a single slow log from eating up the majority of the deadline and causing submissions to other logs to fail
* Remove the 'submissionTimeout' field on the publisher since it is actually bounded by the gRPC timeout as is misleading
* Add a timeout to the CT clients internal HTTP client so that when log servers hang indefinitely we actually do retries instead of just using the entire submission deadline. Currently set at 2.5 minutes

Fixes #3218.
2017-11-09 10:05:26 -05:00
Roland Bracewell Shoemaker f31d2867b2 Switch publisher to prom stats (#3212)
Magical StatsD style->prom style stats are hard to actually use.

Fixes #2906.
2017-11-03 08:48:18 -04:00
Jacob Hoffman-Andrews 9c7482fa94 Remove error return from Scope interface. (#2857)
This was inherited from the statsd interface but never used. This allows us to
remove one of our errcheck exceptions.
2017-07-11 10:54:06 -07:00
Roland Bracewell Shoemaker d28f9b877b Switch CT import path (#2769)
Switches imports from `github.com/google/certificate-transparency` to `github.com/google/certificate-transparency-go` and vendors the new code. Also fixes a number of small breakages caused by API changes since the last time we vendored the code. Also updates `github.com/cloudflare/cfssl` since you can't vendor both `github.com/google/certificate-transparency` and `github.com/google/certificate-transparency-go`.

Side note: while doing this `godep` tried to pull in a number of imports under the `golang.org/x/text` repo that I couldn't find actually being used anywhere so I just dropped the changes to `Godeps/Godeps.json` and didn't add the vendored dir to the tree, let's see if this breaks any tests...

All tests pass

```
$ go test ./...
ok  	github.com/google/certificate-transparency-go	0.640s
ok  	github.com/google/certificate-transparency-go/asn1	0.005s
ok  	github.com/google/certificate-transparency-go/client	22.054s
?   	github.com/google/certificate-transparency-go/client/ctclient	[no test files]
ok  	github.com/google/certificate-transparency-go/fixchain	0.133s
?   	github.com/google/certificate-transparency-go/fixchain/main	[no test files]
ok  	github.com/google/certificate-transparency-go/fixchain/ratelimiter	27.752s
ok  	github.com/google/certificate-transparency-go/gossip	0.322s
?   	github.com/google/certificate-transparency-go/gossip/main	[no test files]
ok  	github.com/google/certificate-transparency-go/jsonclient	25.701s
ok  	github.com/google/certificate-transparency-go/merkletree	0.006s
?   	github.com/google/certificate-transparency-go/preload	[no test files]
?   	github.com/google/certificate-transparency-go/preload/dumpscts/main	[no test files]
?   	github.com/google/certificate-transparency-go/preload/main	[no test files]
ok  	github.com/google/certificate-transparency-go/scanner	0.013s
?   	github.com/google/certificate-transparency-go/scanner/main	[no test files]
ok  	github.com/google/certificate-transparency-go/tls	0.033s
ok  	github.com/google/certificate-transparency-go/x509	1.071s
?   	github.com/google/certificate-transparency-go/x509/pkix	[no test files]
?   	github.com/google/certificate-transparency-go/x509util	[no test files]
```
```
$ ./test.sh
...
ok  	github.com/cloudflare/cfssl/api	1.089s	coverage: 81.1% of statements
ok  	github.com/cloudflare/cfssl/api/bundle	1.548s	coverage: 87.2% of statements
ok  	github.com/cloudflare/cfssl/api/certadd	13.681s	coverage: 86.8% of statements
ok  	github.com/cloudflare/cfssl/api/client	1.314s	coverage: 55.2% of statements
ok  	github.com/cloudflare/cfssl/api/crl	1.124s	coverage: 75.0% of statements
ok  	github.com/cloudflare/cfssl/api/gencrl	1.067s	coverage: 72.5% of statements
ok  	github.com/cloudflare/cfssl/api/generator	2.809s	coverage: 33.3% of statements
ok  	github.com/cloudflare/cfssl/api/info	1.112s	coverage: 84.1% of statements
ok  	github.com/cloudflare/cfssl/api/initca	1.059s	coverage: 90.5% of statements
ok  	github.com/cloudflare/cfssl/api/ocsp	1.178s	coverage: 93.8% of statements
ok  	github.com/cloudflare/cfssl/api/revoke	2.282s	coverage: 75.0% of statements
ok  	github.com/cloudflare/cfssl/api/scan	2.729s	coverage: 62.1% of statements
ok  	github.com/cloudflare/cfssl/api/sign	2.483s	coverage: 83.3% of statements
ok  	github.com/cloudflare/cfssl/api/signhandler	1.137s	coverage: 26.3% of statements
ok  	github.com/cloudflare/cfssl/auth	1.030s	coverage: 68.2% of statements
ok  	github.com/cloudflare/cfssl/bundler	15.014s	coverage: 85.1% of statements
ok  	github.com/cloudflare/cfssl/certdb/dbconf	1.042s	coverage: 78.9% of statements
ok  	github.com/cloudflare/cfssl/certdb/ocspstapling	1.919s	coverage: 69.2% of statements
ok  	github.com/cloudflare/cfssl/certdb/sql	1.265s	coverage: 65.7% of statements
ok  	github.com/cloudflare/cfssl/cli	1.050s	coverage: 61.9% of statements
ok  	github.com/cloudflare/cfssl/cli/bundle	1.023s	coverage: 0.0% of statements
ok  	github.com/cloudflare/cfssl/cli/crl	1.669s	coverage: 57.8% of statements
ok  	github.com/cloudflare/cfssl/cli/gencert	9.278s	coverage: 83.6% of statements
ok  	github.com/cloudflare/cfssl/cli/gencrl	1.310s	coverage: 73.3% of statements
ok  	github.com/cloudflare/cfssl/cli/genkey	3.028s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/cli/ocsprefresh	1.106s	coverage: 64.3% of statements
ok  	github.com/cloudflare/cfssl/cli/revoke	1.081s	coverage: 88.2% of statements
ok  	github.com/cloudflare/cfssl/cli/scan	1.217s	coverage: 36.0% of statements
ok  	github.com/cloudflare/cfssl/cli/selfsign	2.201s	coverage: 73.2% of statements
ok  	github.com/cloudflare/cfssl/cli/serve	1.133s	coverage: 39.0% of statements
ok  	github.com/cloudflare/cfssl/cli/sign	1.210s	coverage: 54.8% of statements
ok  	github.com/cloudflare/cfssl/cli/version	2.475s	coverage: 100.0% of statements
ok  	github.com/cloudflare/cfssl/cmd/cfssl	1.082s	coverage: 0.0% of statements
ok  	github.com/cloudflare/cfssl/cmd/cfssljson	1.016s	coverage: 4.0% of statements
ok  	github.com/cloudflare/cfssl/cmd/mkbundle	1.024s	coverage: 0.0% of statements
ok  	github.com/cloudflare/cfssl/config	2.754s	coverage: 67.7% of statements
ok  	github.com/cloudflare/cfssl/crl	1.063s	coverage: 68.3% of statements
ok  	github.com/cloudflare/cfssl/csr	27.016s	coverage: 89.6% of statements
ok  	github.com/cloudflare/cfssl/errors	1.081s	coverage: 81.2% of statements
ok  	github.com/cloudflare/cfssl/helpers	1.217s	coverage: 80.4% of statements
ok  	github.com/cloudflare/cfssl/helpers/testsuite	7.658s	coverage: 65.8% of statements
ok  	github.com/cloudflare/cfssl/initca	205.809s	coverage: 74.2% of statements
ok  	github.com/cloudflare/cfssl/log	1.016s	coverage: 59.3% of statements
ok  	github.com/cloudflare/cfssl/multiroot/config	1.107s	coverage: 77.4% of statements
ok  	github.com/cloudflare/cfssl/ocsp	1.524s	coverage: 77.7% of statements
ok  	github.com/cloudflare/cfssl/revoke	1.775s	coverage: 79.6% of statements
ok  	github.com/cloudflare/cfssl/scan	1.022s	coverage: 1.1% of statements
ok  	github.com/cloudflare/cfssl/selfsign	1.119s	coverage: 70.0% of statements
ok  	github.com/cloudflare/cfssl/signer	1.019s	coverage: 20.0% of statements
ok  	github.com/cloudflare/cfssl/signer/local	3.146s	coverage: 81.2% of statements
ok  	github.com/cloudflare/cfssl/signer/remote	2.328s	coverage: 71.8% of statements
ok  	github.com/cloudflare/cfssl/signer/universal	2.280s	coverage: 67.7% of statements
ok  	github.com/cloudflare/cfssl/transport	1.028s
ok  	github.com/cloudflare/cfssl/transport/ca/localca	1.056s	coverage: 94.9% of statements
ok  	github.com/cloudflare/cfssl/transport/core	1.538s	coverage: 90.9% of statements
ok  	github.com/cloudflare/cfssl/transport/kp	1.054s	coverage: 37.1% of statements
ok  	github.com/cloudflare/cfssl/ubiquity	1.042s	coverage: 88.3% of statements
ok  	github.com/cloudflare/cfssl/whitelist	2.304s	coverage: 100.0% of statements
```

Fixes #2746.
2017-05-17 13:41:33 -07:00
Jacob Hoffman-Andrews 373ff015a2 Update cfssl, CT, and OCSP dependencies (#2170)
Pulls in logging improvements in OCSP Responder and the CT client, plus a handful of API changes. Also, the CT client verifies responses by default now.

This change includes some Boulder diffs to accommodate the API changes.
2017-01-12 16:01:14 -08:00
Daniel McCarney a2b8faea1e Only resubmit missing SCTs. (#2342)
This PR introduces the ability for the ocsp-updater to only resubmit certificates to logs that we are missing SCTs from. Prior to this commit when a certificate was missing one or more SCTs we would submit it to every log, causing unnecessary overhead for us and the log operator.

To accomplish this a new RPC endpoint is added to the Publisher service "SubmitToSingleCT". Unlike the existing "SubmitToCT" this RPC endpoint accepts a log URI and public key in addition to the certificate DER bytes. The certificate is submitted directly to that log, and a cache of constructed resources is maintained so that subsequent submissions to the same log can reuse the stat name, verifier, and submission client.

Resolves #1679
2016-12-05 13:54:02 -08:00
Jacob Hoffman-Andrews 0543691d9e Add stats to Publisher (#2083)
Fixes #1576.

Adds a new package mock_metrics, with code generated by gomock, in order to test the change.
Modifies publisher.New to take a metrics.Scope and an SA, and unexport SA.
Moves core of submission loop into a separate function, singleLogSubmit, which can return an error rather than using the continue keyword. This reduces repetition of AuditErr lines, and makes it easier to put error statting in one place.
2016-08-17 16:25:33 -07:00
Jacob Hoffman-Andrews 9b6125c9cd Remove only one trailing slash in Publisher.
Previously the code was removing the trailing slash plus one extra character.
2016-07-14 15:46:35 -07:00
Roland Bracewell Shoemaker 54573b36ba Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
Roland Bracewell Shoemaker 96a57434eb Make boulder-publisher work as a gRPC service (#1708) 2016-05-13 16:32:18 -07:00
Kane York b7cf618f5d context.Context as the first parameter of all RPC calls (#1741)
Change core/interfaces to put context.Context as the first parameter of all RPC calls in preparation for gRPC.
2016-04-19 11:34:36 -07:00
Jacob Hoffman-Andrews e6c17e1717 Switch to new vendor style (#1747)
* Switch to new vendor style.

* Fix metrics generate command.

* Fix miekg/dns types_generate.

* Use generated copies of files.

* Update miekg to latest.

Fixes a problem with `go generate`.

* Set GO15VENDOREXPERIMENT.

* Build in letsencrypt/boulder.

* fix travis more.

* Exclude vendor instead of godeps.

* Replace some ...

* Fix unformatted cmd

* Fix errcheck for vendorexp

* Add GO15VENDOREXPERIMENT to Makefile.

* Temp disable errcheck.

* Restore master fetch.

* Restore errcheck.

* Build with 1.6 also.

* Match statsd.*"

* Skip errcheck unles Go1.6.

* Add other ignorepkg.

* Fix errcheck.

* move errcheck

* Remove go1.6 requirement.

* Put godep-restore with errcheck.

* Remove go1.6 dep.

* Revert master fetch revert.

* Remove -r flag from godep save.

* Set GO15VENDOREXPERIMENT in Dockerfile and remove _worskpace.

* Fix Godep version.
2016-04-18 12:51:36 -07:00
Kane York 25b45a45ec Errcheck errors fixed (#1677)
* Fix all errcheck errors
* Add errcheck to test.sh
* Add a new sa.Rollback method to make handling errors in rollbacks easier.
This also causes a behavior change in the VA. If a HTTP connection is
abruptly closed after serving the headers for a non-200 response, the
reported error will be the read failure instead of the non-200.
2016-04-12 16:54:01 -07:00
Jacob Hoffman-Andrews ecc04e8e61 Refactor log package (#1717)
- Remove error signatures from log methods. This means fewer places where errcheck will show ignored errors.
- Pull in latest cfssl to be compatible with errorless log messages.
- Reduce the number of message priorities we support to just those we actually use.
- AuditNotice -> AuditInfo
- Remove InfoObject (only one use, switched to Info)
- Remove EmergencyExit and related functions in favor of panic
- Remove SyslogWriter / AuditLogger separate types in favor of a single interface, Logger, that has all the logging methods on it.
- Merge mock log into logger. This allows us to unexport the internals but still override them in the mock.
- Shorten names to be compatible with Go style: New, Set, Get, Logger, NewMock, etc.
- Use a shorter log format for stdout logs.
- Remove "... Starting" log messages. We have better information in the "Versions" message logged at startup.

Motivation: The AuditLogger / SyslogWriter distinction was confusing and exposed internals only necessary for tests. Some components accepted one type and some accepted the other. This made it hard to consistently use mock loggers in tests. Also, the unnecessarily fat interface for AuditLogger made it hard to meaningfully mock out.
2016-04-08 16:12:20 -07:00
Jacob Hoffman-Andrews 95bf324ce8 Include the log URI when logging CT problems. 2016-03-16 12:24:21 -07:00
Roland Shoemaker 78ae233a81 Switch SubmitToCT to use AddChainWithContext
google/certificate-transparency provides a new method, AddChainWithContext,
that allwos us to cancel a submission attempt if it takes longer than a
provided timeout using context.WithTimeout. Also refactor the initialization
method and fix a previously broken test (related to Retry-After headers).
2016-02-24 16:20:12 -08:00
Jessica Frazelle 7955e268c7
go lint fixes
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-02-17 11:36:06 -08:00
Roland Shoemaker e1d70f2557 Privatize log fields 2015-11-30 16:44:08 -08:00
Roland Shoemaker 2d9dbd0cfb Follow new config practices and make cleaner 2015-11-24 17:12:36 -08:00
Roland Shoemaker 01895a13d0 Switch to google, part 1 2015-11-23 12:42:50 -08:00
Richard Barnes 0fd89d3048 Use a fake clock for the WFE and mock SA 2015-10-20 17:12:59 -04:00
Richard Barnes 498deeb518 Fix golint in ./mocks 2015-10-04 20:37:06 -04:00
Roland Shoemaker ff6eca7a29 Submit all issued certificates to configured CT logs
Adds a new service, Publisher, which exists to submit issued certificates to various Certificate Transparency logs. Once submitted the Publisher will also parse and store the returned SCT (Signed Certificate Timestamp) receipts that are used to prove inclusion in a specific log in the SA database. A SA migration adds the new SCT receipt table.

The Publisher only exposes one method, SubmitToCT, which is called in a goroutine by ca.IssueCertificate as to not block any other issuance operations. This method will iterate through all of the configured logs attempting to submit the certificate, and any required intermediate certificates, to them. If a submission to a log fails it will be retried the pre-configured number of times and will either use a back-off set in a Retry-After header or a pre-configured back-off between submission attempts.

This changeset is the first of a number of changes ending with serving SCT receipts in OCSP responses and purposefully leaves out the following pieces for follow-up PRs.

* A fake CT server for integration testing
* A external tool to search the database for certificates lacking a full set of SCT receipts
* A method to construct X.509 v3 extensions containing receipts for the OCSP responder
* Returned SCT signature verification (beyond just checking that the signature is of the correct type so we aren't just serving arbitrary binary blobs to clients)

Resolves #95.
2015-09-17 18:11:05 -07:00