Commit Graph

181 Commits

Author SHA1 Message Date
Daniel McCarney 4af52c6b4e Change `DBConfig`'s `URL` func to strip whitespace. (#2045)
As described in issue #2025 if the contents of a DBConnectFile argument ends in a trailing newline an error is produced when later using the contents as a DB configuration URL.

This PR changes the URL function of the DBConfig type to strip leading and trailing whitespace (including newlines) when reading the DBConnectFile contents. This resolves #2025.
2016-07-13 13:35:32 -07:00
Ben Irving 1a4f099899 Split up boulder-config.json (Expiration Mailer) (#2036)
Part of #1962.
2016-07-12 15:55:52 -07:00
Ben Irving 0e2ef748b4 Split up boulder-config.json (OCSP Responder) (#2017) 2016-07-07 14:52:08 -04:00
Ben Irving 653cc004d0 Split Boulder Config (OCSP Updater) (#2013) 2016-07-06 10:00:52 -04:00
Ben Irving cb45bdea67 Split up boulder-config.json (Publisher) (#2008) 2016-07-05 13:31:30 -07:00
Ben Irving bea8e57536 Split up boulder-config.json (VA) (#1979) 2016-07-01 13:06:50 -04:00
Ben Irving 21e0b3bdc7 Split up boulder-config.json (CA) (#1978) 2016-07-01 10:24:19 -04:00
Ben Irving 6162533c00 Split up boulder-config.json (SA) (#1975)
Depends on #1973

https://github.com/letsencrypt/boulder/pull/1975
2016-06-29 15:01:49 -07:00
Ben Irving c4f7fb580d Split up boulder-config.json (RA) (#1974)
Part of #1962
2016-06-29 13:43:55 -07:00
Jacob Hoffman-Andrews 0c0e94dfaf Add enforcement for CAA SERVFAIL (#1971)
https://github.com/letsencrypt/boulder/pull/1971
2016-06-28 11:00:23 -07:00
Ben Irving 6007df8f3c Split up boulder-config.json (WFE) (#1973)
Moves the wfe to it's own config file.

Each config will now belong in `test/config` and `test/config-next` analogous to `boulder-config` and `boulder-config-next`.
2016-06-28 10:40:16 -07:00
Ben Irving 3e21d0f27c Move subscriberAgreementURL config section into WFE section (#1960)
Moves the `subscriberAgreementURL` from a top-level config variable to the WFE section. The top level configuration is still respected until we can change the prod configs.
2016-06-22 13:07:25 -04:00
Jacob Hoffman-Andrews 4283fb5dd4 Improve syslog defaults. (#1932)
Under the new defaults, if the syslog section is missing, we'll use the default
config that we use in prod: no logs to stdout, INFO and below to syslog.

This allows us to remove the syslog section from prod configs, and potentially
move it to individual service configs in the future.

* Improve syslog defaults.
* Add stdout logging for purger test.
* Use plain int for sysloglevel.
* Fix JSON syntax
* Fix syslog config for expired-authz-purger.

https://github.com/letsencrypt/boulder/pull/1932
2016-06-17 11:26:11 -07:00
Daniel McCarney 6bd97b2a6b Adds `notify-mailer` command. (#1936)
This commit adds a new notify-mailer command. Outside of the new command, this PR also:

Adds a new SMTPConfig to cmd/config.go that is shared between the expiration mailer and the notify mailer.
Modifies mail/mailer.go to add an smtpClient interface.
Adds a dryRunClient to mail/mailer.go that implements the smtpClient interface.
Modifies the mail/mailer.go MailerImpl and constructor to use the SMTPConfig and a dialer. The missing functions from the smtpClient interface are added.
The notify-mailer command supports checkpointing through --start and --end parameters. It supports dry runs by using the new dryRunClient from the mail package when given the --dryRun flag. The speed at which emails are sent can be tweaked using the --sleep flag.

Unit tests for notify-mailer's checkpointing behaviour, the checkpoint interval/sleep parameter sanity, the sleep behaviour, and the message content construction are included in main_test.go.

Future work:

A separate command to generate the list of destination emails provided to notify-mailer
Support for using registration IDs as input and resolving the email address at runtime.
Resolves #1928. Credit to @jsha for the initial work - I'm just completing the branch he started.

* Adds `notify-mailer` command.
* Adds a new SMTPConfig to `cmd/config.go` that is shared between the
expiration mailer and the notify mailer.
* Modifies `mail/mailer.go` to add an `smtpClient` interface.
* Adds a `dryRunClient` to `mail/mailer.go` that implements the
  `smtpClient` interface.
* Modifies the `mail/mailer.go` `MailerImpl` and constructor to use the
  SMTPConfig and a dialer. The missing functions from the `smtpClient`
  interface are added.
* Fix errcheck warnings
* Review feedback
* Review feedback pt2
* Fixes #1446 - invalid message-id generation.
* Change -configFile to -config
* Test message ID with friendly email

https://github.com/letsencrypt/boulder/pull/1936
2016-06-16 15:12:31 -07:00
Roland Bracewell Shoemaker 92e0704b1b Allow gRPC clients to connect to multiple backends (#1918)
Fixes #1917 and #1755, also updates google.golang.org/grpc to b60d3e9e.
2016-06-15 16:50:56 -07:00
Ben Irving f04b922aff Remove support for TCP-based logging (#1931) 2016-06-14 14:30:21 -07:00
Daniel McCarney 9abc212448 Reuse valid authz for subsequent new authz requests (#1921)
Presently clients may request a new AuthZ be created for a domain that they have already proved authorization over. This results in unnecessary bloat in the authorizations table and duplicated effort.

This commit alters the `NewAuthorization` function of the RA such that before going through the work of creating a new AuthZ it checks whether there already exists a valid AuthZ for the domain/regID that expires in more than 24 hours from the current date. If there is, then we short circuit creation and return the existing AuthZ. When this case occurs the `RA.ReusedValidAuthz` counter is incremented to provide visibility.

Since clients requesting a new AuthZ and getting an AuthZ back expect to turn around and post updates to the corresponding challenges we also return early in `UpdateAuthorization` when asked to update an AuthZ that is already valid. When this case occurs the `RA.ReusedValidAuthzChallenge` counter is incremented.

All of the above behaviour is gated by a new RA config flag `reuseValidAuthz`. In the default case (false) the RA does **not** reuse any AuthZ's and instead maintains the historic behaviour; always creating a new AuthZ when requested, irregardless of whether there are already valid AuthZ's that could be reused. In the true case (enabled only in `boulder-config-next.json`) the AuthZ reuse described above is enabled.

Resolves #1854
2016-06-10 16:44:16 -04:00
Ben Irving 438580f206 Remove last of UseNewVARPC (#1914)
`UseNewVARPC` is no longer necessary and is safe to be removed. We default to using the newer VA RPC code.
2016-06-09 10:12:46 -04:00
Jacob Hoffman-Andrews 9a4b979397 Move goodkey and nonce out of core (#1869) 2016-06-02 11:29:58 -07:00
Kane York 0430c08388 Implement gRPC for VA's RPCs (#1738)
Adds appropriate protobufs, and sets up RA / VA to use the gRPC versions of the calls in boulder-config-next.json.

Fixes #1626.
2016-05-31 16:44:48 -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 5abe7e3cdf Move CSR normalization/verification to their own methods (#1826)
* Split CSR testing and name hoisting into own functions, verify CSR in RA & CA

* Move tests around and various other fixes

* 1.5.3 doesn't have the needed stringer

* Move functions to their own lib

* Remove unused imports

* Move MaxCNLength and BadSignatureAlgorithms to csr package

* Always normalizeCSR in VerifyCSR and de-export it

* Update comments
2016-05-26 14:17:41 -07:00
Ben Irving d88cce5c72 Add config option to lower syslog level 2016-05-26 09:32:32 -07:00
Roland Bracewell Shoemaker 96a57434eb Make boulder-publisher work as a gRPC service (#1708) 2016-05-13 16:32:18 -07:00
Jacob Hoffman-Andrews d5dcc1f157 Remove external-cert-importer. (#1794)
Not currently used.
2016-05-10 10:45:19 -07:00
Jacob Hoffman-Andrews b3bc3d8e41 Add a MaxDBConns config parameter. (#1793) 2016-05-09 14:21:15 -07:00
Kane York 339405bcb9 Look up A and AAAA in parallel (#1760)
This allows validating IPv6-only hosts.

Fixes #593.
2016-05-09 08:38:23 -07:00
Roland Bracewell Shoemaker 35b6e83e81 Implement CAA quorum checking after failure (#1763)
When a CAA request to Unbound times out, fall back to checking CAA via Google Public DNS' HTTPS API, through multiple proxies so as to hit geographically distributed paths. All successful multipath responses must be identical in order to succeed, and at most one can fail.

Fixes #1618
2016-05-05 11:16:58 -07:00
Jacob Hoffman-Andrews e5e4fb744a * Delete Policy DB.This is no longer needed now that we have a JSON policy file.* Fix tests.* Revert Dockerfile.* Fix create_db* Simplify user addition.* Fix tests.* Fix tests* Review fixes.https://github.com/letsencrypt/boulder/pull/1773
* Delete Policy DB.

This is no longer needed now that we have a JSON policy file.

* Fix tests.
* Revert Dockerfile.
* Fix create_db
* Simplify user addition.
* Fix tests.
* Fix tests
* Review fixes.

https://github.com/letsencrypt/boulder/pull/1773
2016-04-29 12:12:24 -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
Roland Bracewell Shoemaker 8eaf247ee9 Split CAA checking out to its own service (#1647)
* Split out CAA checking service (minus logging etc)
* Add example.yml config + follow general Boulder style
* Update protobuf package to correct version
* Add grpc client to va
* Add TLS authentication in both directions for CAA client/server
* Remove go lint check
* Add bcodes package listing custom codes for Boulder
* Add very basic (pull-only) gRPC metrics to VA + caa-service
2016-04-12 23:02:41 -07:00
Roland Bracewell Shoemaker 32e9e44906 Remove activity-monitor from the tree
* Axe boulder-am
* Also remove the analysis subpackage and references to it, and remove routingKey from rpc/connection.go

https://github.com/letsencrypt/boulder/pull/1682
2016-04-04 12:19:17 -07:00
Jacob Hoffman-Andrews be8edc6dbc Merge pull request #1644 from letsencrypt/better-checker
Better cert-checker
2016-03-31 17:01:30 -07:00
Jacob Hoffman-Andrews 39d0240793 Remove SQLDebug config option.
It's now the default in all cases that it was configurable. When we want to
suppress SQL debug messages, we can simply adjust the logging level to suppress
debug messages in general.

Also, pass a logger to SetSQLDebug rather than calling GetAuditLogger.
2016-03-29 23:32:02 -07:00
Roland Shoemaker 29c40d8368 Rename cli arguments + flag for only printing bad results 2016-03-23 13:55:37 -07:00
Roland Shoemaker ebe81ccc5e Merge branch 'master' into better-checker 2016-03-23 13:30:58 -07:00
Kane York 6024176ee0 Add calls to PerformValidation in the RA 2016-03-23 10:39:23 -07:00
Jacob Hoffman-Andrews a3d044f681 Add multi-issuer support to the CA.
Currently this is only supported for OCSP, not for EE cert signing.

Also clean up some things in the CA unittest.
2016-03-21 20:56:58 -07:00
Roland Shoemaker 7ec03bd969 CN length check + various ease-of-use tweaks 2016-03-21 17:57:53 -07:00
Jacob Hoffman-Andrews bc28bfe906 Implement reloadable JSON blacklist.
This eliminates the need the a database to store the hostname policy,
simplifying deployment. We keep the database for now, as part of our
deployability guidelines: we'll deploy, then switch config to the new style.

This also disables the obsolete whitelist checking code, but doesn't yet change
the function signature for policy.New(), to avoid bloating the pull request.
I'll fully remove the whitelist checking code in a future change when I also
remove the policy database code.
2016-03-13 20:00:51 -07:00
Roland Shoemaker c4dd3506aa Remove CA HSM lockout and make the OCSP updater CA backoff more HSM specific 2016-03-01 14:22:12 -08:00
Roland Bracewell Shoemaker a5da4acf61 Merge branch 'master' into pkcs11key 2016-02-25 11:58:48 -08:00
Kane York b46b7d0bb4 Switch to letsencrypt copy of pkcs11key
Closes #1527
2016-02-25 10:24:43 -08: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
Jacob Hoffman-Andrews 9dcd6e3e3e Add config flag to enable must staple.
This ensures we don't try to pass the must staple extension to CFSSL until we've
also enabled it in AllowedExtensions in our CFSSL profile.
2016-02-19 14:52:23 -08:00
Jeff Hodges 1498381e76 issue without a CommonName if not given one
It's behind a new temporary config flag.

Also, check if the CN is over 64 bytes.

This also makes sure the certificate's Subject is not empty if the CN is
empty by always setting the SerialNumber in Subject.

While I was here, I also corrected the logged hex encoding of
SerialNumber so that its prefixed by zeroes correctly. See the use of
core.SerialToString in IssueCertificate.

I also added a test for the no CommonName and no SANs case.

Fixes #40
2016-02-12 11:49:16 -08:00
Roland Shoemaker d1428e164e Add basic test 2016-01-25 11:47:30 -08:00
Roland Shoemaker f02864fb7e Read SMTP password from file 2016-01-24 15:35:04 -08:00
Hugo Landau f49028107e Allow CFSSL profiles to be selected by key type
Allows multiple CFSSL profiles to be defined. A profile is selected by
key type. ECDSA keys get one profile, RSA keys get another.

Either the "profile" config option or the "rsaProfile" and
"ecdsaProfile" config options must be specified. Both cannot be
specified. Specifying "profile" uses the same profile for RSA and ECDSA.

Fixes #1384
2016-01-22 11:00:41 +00:00
Jacob Hoffman-Andrews 6d33280249 Add default value for KeyPolicy.
This maintains our deployability guidelines, so the latest Boulder can be run
with the previous version of the config.
2016-01-12 12:14:36 -08:00
Jacob Hoffman-Andrews 556afa3547 Reuse a single connection to SMTP server.
Also, add a Subject config field and use TLS-wrapped SMTP if appropriate.
2016-01-11 15:51:54 -08:00
Jeff Hodges 502aea76db Merge branch 'master' into mail-from 2016-01-07 15:13:42 -08:00
Hugo Landau f218e314f8 Add good key testing for ECDSA. 2016-01-07 22:48:38 +00:00
Jacob Hoffman-Andrews b61c2a7e3a Add a From field to mailer config.
Fixes #1351.
2016-01-07 12:24:51 -08:00
Jeff Hodges adbbbec962 Merge branch 'master' into retry_dns 2016-01-04 16:38:27 -08:00
Alex Gaynor cbeffe96a6 Fixed a bunch of typos 2016-01-04 18:39:34 -05:00
Jeff Hodges 116ce96326 add retries and context deadlines to DNSResolver
This provides a means to add retries to DNS look ups, and, with some
future work, end retries early if our request deadline is blown. That
future work is tagged with #1292.

Updates #1258
2016-01-04 14:59:10 -08:00
Roland Shoemaker 3197177acf Merge branch 'master' into caa-integration 2015-12-14 12:07:45 -08:00
Jeff Hodges 8300b06ad6 Merge branch 'master' into delete_old_challenges 2015-12-10 23:04:00 -08:00
Jeff Hodges c9010744b4 delete old challenge code
Specifically, delete the simpleHttp and dvsni.

Hooray!

Fixes #894
2015-12-10 15:41:40 -08:00
Roland Shoemaker ee09f55839 Initialize va.IssuerDomain and add CAA integration test (for success and failure) 2015-12-08 15:01:03 -08:00
Roland Bracewell Shoemaker f302c50f48 Merge branch 'master' into google-ct 2015-11-30 15:44:24 -08:00
Jacob Hoffman-Andrews feaf6bd230 Merge branch 'master' into secrets 2015-11-30 14:14:47 -08:00
Roland Shoemaker 7e093c3ed4 Merge branch 'master' into google-ct 2015-11-30 12:05:17 -08:00
Roland Bracewell Shoemaker 0aca578d6d Merge branch 'master' into amqp-secrets 2015-11-30 11:57:59 -08:00
Jacob Hoffman-Andrews b8a91739e3 Allow AMQP URLs to be loaded from files.
This allows secret values to be separated from the main config.

Part of #1157
2015-11-30 11:50:14 -08:00
Jacob Hoffman-Andrews 3ede9b7223 Allow PKCS11 config to be loaded from a file.
This allows secret values (PIN) to be separated from the main config.

Part of #1157.

In the process, move the CA constructor in the direction of
https://github.com/letsencrypt/boulder/wiki/Config-plan:

- Make most fields private.
- Take private key and issuer cert as constructor arguments rather than
  constructing them internally.

This allows the CA test to parse the private key and issuer cert once, rather
than once per test case.
2015-11-27 15:23:31 -08:00
Roland Shoemaker 52b7effa5d Review fixes pt. 2 2015-11-25 12:56:44 -08:00
Roland Shoemaker 2d9dbd0cfb Follow new config practices and make cleaner 2015-11-24 17:12:36 -08:00
Jacob Hoffman-Andrews b71a850501 Fix DBConfig references. 2015-11-24 16:41:53 -08:00
Jacob Hoffman-Andrews deb57e5157 Add comment. 2015-11-24 14:27:00 -08:00
Jacob Hoffman-Andrews 8aa3c6cd7b Add comment and override for Source. 2015-11-24 11:01:33 -08:00
Jacob Hoffman-Andrews 9c7d6d2324 Remove old traces of ConfigSecret 2015-11-23 22:18:56 -08:00
Jacob Hoffman-Andrews 608a0c9073 Move file reading to DBConfig and out of SA.
Also remove AMQP secret changes: one thing at a time.
2015-11-23 22:09:54 -08:00
Jacob Hoffman-Andrews 0a276a2c53 Factor out DBConfig 2015-11-20 22:17:17 -08:00
Jacob Hoffman-Andrews 5dd212dd47 Add ConfigSecret.
This allows secret values to be stored externally to the config file, so that
config files can be easily shared without revealing secret data.
2015-11-19 22:41:27 -08:00
Jacob Hoffman-Andrews 5fb7be64b0 Make ServiceQueue a separate config param.
Also, make clientName strings into constants.
2015-11-18 17:40:45 -08:00
Jacob Hoffman-Andrews 7dcfcd7864 Add configurable RPC timeouts per backend.
In the process, break out AMQP config into its own struct, one per service.
The AMQPConfig struct is included by composition in the config structs that need
it. If any given service lacks an AMQP config of its own, it gets a default
value from the top-level AMQP config struct, for deployability reasons.

Tightens the RPC code to take a specific AMQP config, not an over-broad
cmd.Config.

Shortens construction of specific RPC clients so they instatiate the generic
client connection themselves, simplifying per-service startup code.

Remove unused SetTimeout method on RPC clients.
2015-11-17 19:51:51 -08:00
Jacob Hoffman-Andrews 1b0838cf99 Move config structs into config.go.
Part of https://github.com/letsencrypt/boulder/issues/1052. I'll be adding some
new config structs, and want everything in a consistent place.
2015-11-13 14:57:07 -08:00
Jacob Hoffman-Andrews 47bae156e5 Move config structs into config.go. 2015-11-12 12:01:14 -08:00
Jeff Hodges 13cab5c257 add Google Safe Browsing API calls
This allows us to call the Google Safe Browsing calls through the VA.

If the RA config's boolean UseIsSafeDomain is true, the RA will make the RPC
call to the VA during its NewAuthorization.

If the VA config's GoogleSafeBrowsingConfig struct is not nil, the VA
will check the Google Safe Browsing API in
VA.IsSafeDomain. If the GoogleSafeBrowsingConfig struct is nil, it will
always return true.

In order to actually make requests, the VA's GoogleSafeBrowsingConfig
will need to have a directory on disk it can store the local GSB hashes
it will check first and a working Google API key for the GSB API.

Fixes #1058
2015-11-06 16:37:34 -08:00