Commit Graph

171 Commits

Author SHA1 Message Date
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
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
Roland Bracewell Shoemaker 800b5b0cbf Switch to using a wrapped statter that provides PID
* Switch to using a wrapped statter that provides PID

* Fix tests and change some types to interfaces

* Add hostname to suffix + update comment
2016-04-01 15:43:35 -07: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
Jeff Hodges e36895c9c5 bring RTT metrics inside DNSResolver
This moves the RTT metrics calculation inside of the DNSResolver. This
cleans up code in the RA and VA and makes some adding retries to the
DNSResolver less ugly to do.

Note: this will put `Rate` and `RTT` after the name of DNS query
type (`A`, `MX`, etc.). I think that's fine and desirable. We aren't
using this data in alerts or many dashboards, yet, so a flag day is
okay.

Fixes #1124
2015-12-16 17:41:42 -08:00
Roland Bracewell Shoemaker 982f8fe102 Merge branch 'master' into move_dns 2015-12-14 16:00:47 -08:00
Jeff Hodges b31165444f move dns code to dns pkg and rename to bdns
Moves the DNS code from core to dns and renames the dns package to bdns
to be clearer.

Fixes #1260 and will be good to have while we add retries and such.
2015-12-14 11:21:43 -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
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 2fc0f3143e Improve logging.
Consolidate initialization of stats and logging from each main.go into cmd
package.

Define a new config parameter, `StdoutLevel`, that determines the maximum log
level that will be printed to stdout. It can be set to 6 to inhibit debug
messages, or 0 to print only emergency messages, or -1 to print no messages at
all.

Remove the existing config parameter `Tag`. Instead, choose the tag from the
basename of the currently running process. Previously all Boulder log messages
had the tag "boulder", but now they will be differentiated by process, like
"boulder-wfe".

Shorten the date format used in stdout logging, and add the current binary's
basename.

Consolidate setup function in audit-logger_test.go.

Note: Most CLI binaries now get their stats and logging from the parameters of
Action. However, a few of our binaries don't use our custom AppShell, and
instead use codegangsta/cli directly. For those binaries, we export the new
StatsAndLogging method from cmd.

Fixes https://github.com/letsencrypt/boulder/issues/852
2015-11-11 16:52:42 -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
Jacob Hoffman-Andrews 194e421931 Add reconnects in AMQP. 2015-10-27 19:54:54 -07:00
Richard Barnes f064c6d5c7 Merge branch 'master' to 'sig-reuse' 2015-10-05 23:16:16 -04:00
Roland Shoemaker 4a98145992 Review fixes 2015-10-04 21:05:44 -07:00
Roland Shoemaker f0f1e72729 Per binary maxGoroutines 2015-10-02 15:30:21 -07:00
Roland Shoemaker 1c393b06bb Add maximum goroutine limit for RPC servers 2015-10-02 15:21:17 -07:00
Richard Barnes 4c20bfe310 Merge master to sig-reuse 2015-10-01 18:58:35 -07:00
Jacob Hoffman-Andrews e97880aaa7 Audit log version info as early as possible.
This means after parsing the config file, setting up stats, and dialing the
syslogger. But it is still before trying to initialize the given server. This
means that we are more likely to get version numbers logged for some common
runtime failures.
2015-09-29 17:16:03 -07:00
Richard Barnes 24fcc3a760 Make tests pass 2015-09-28 16:05:54 -04:00
Jacob Hoffman-Andrews 8467745d1e Run gofmt. 2015-09-23 12:26:02 -07:00
James 'J.C.' Jones 3506abeeb9 Fix godep import in cmd/va 2015-09-23 12:16:45 -07:00
Roland Shoemaker 91750d925f Review fixes 2015-09-15 12:02:34 -07:00
Roland Shoemaker 871a77c4b8 Merge master 2015-09-10 13:00:52 -07:00
Roland Shoemaker 00905ac07a Move RPCMonitor log to the RPCClient and do the collect natively 2015-09-10 12:48:35 -07:00
Roland Shoemaker e5e947ee09 Better construction 2015-09-03 21:00:51 -07:00
Roland Shoemaker 37517052c7 Add checks for addresses in the loopback block and a bool to allow them for testing 2015-09-02 15:25:21 -07:00
Roland Shoemaker 88c2f95179 Cleanup authority creation 2015-08-28 15:03:02 -07:00
Roland Shoemaker 764169667e Merge master 2015-08-27 11:21:18 -07:00
Jeff Hodges 283d8de59b remove TestMode completely
This removes TestMode from the boulder-va command, from ca.Config
(it was only used in the VA) and gets the integration config to specify
the ports it should use explicitly.

(It also removes a DBDriver field from ca.Config that was left over from
letsencrypt/boulder#624.)

Fixes #627.
2015-08-25 21:57:24 -07:00
Jeff Hodges 5bd820f3c5 avoid copying large ValidationAuthorityImpl struct
Saves some allocations
2015-08-25 21:14:59 -07:00
Roland Shoemaker d6efd496fa Merge master 2015-08-24 12:27:58 -07:00
Roland Shoemaker 7ad8847ba2 Standardize CLI UX 2015-08-23 23:17:14 -07:00
Roland Shoemaker 8789f925cc Merge master 2015-08-11 16:39:31 -07:00
Roland Shoemaker 5ac7652ef4 Major rewrite 2015-08-04 16:23:49 -07:00
Roland Shoemaker 19c76ac94f Stick with previous method name, add uncommitted comment 2015-08-04 11:27:12 -07:00
Roland Shoemaker c9c05cfb46 Add comments, move reconnection logic out of binaries (except for the WFE which is a weird case) 2015-08-03 23:02:52 -07:00
Roland Shoemaker b4da19fce4 Properly catch RPC server errors 2015-08-03 16:50:31 -07:00
Roland Shoemaker 85d037f7a7 Gracefully shutdown RPC servers 2015-08-03 16:47:47 -07:00
Roland Shoemaker bf0673c35f DNS config refactoring 2015-07-22 15:54:40 -07:00
Jeff Hodges ef54dda46a add debug http server to services
Currently, the debug http server in every service contains just the
net/http/pprof handlers. This allows us to get CPU, blocking, and memory
profiling remotely.

Along the way, remove all the places we use http.DefaultServeMux (which
includes use of http.Handle and http.HandlerFunc) and use a NewServeMux
for each place.

Fixes #457
2015-07-14 01:28:18 -07:00
Roland Shoemaker f6248ef279 Flesh out DNS mock methods, and move them to their own sub-module instead of under test/ to avoid import loop, Add Loopback DNS resolver for core/dns_test.go 2015-07-07 22:31:44 +01:00
Roland Shoemaker 12589834a3 Merge master 2015-06-25 15:59:59 -07:00
Richard Barnes 37b5808c34 Plumbing through user-agent in command line programs 2015-06-23 14:07:01 -07:00
Roland Shoemaker 9edd2b8e07 Refactor StatsD metrics collection
- Moved HandlerTimer definition from various cmd/ binaries to cmd/shell.go
- Cleaned up HandlerTimer endpoint metrics
- Moved New... counter metrics from WFE to RA and add Updated... and Finalized... ones
- Added error code and problem type counter metrics to WFE
- Added validation type / status counter metrics to VA
- Consistently return the total RTT from LookupCAA, LookupCNAME, and LookupDNSSEC method
- Added DNS RTT timing metrics to VA for the various Loookup... methods
2015-06-21 23:28:10 -07:00
J.C. Jones f95e9eaa83 Support TLS mutual authentication for AMQPS 2015-06-18 16:23:48 -07:00
J.C. Jones 41f5788c77 Correct most `go lint` warnings. (274 -> 5) 2015-06-16 22:18:28 -05:00
J.C. Jones b24f6b23fe Moved to `miekg/dns` for the VA.
- Created some helper methods to run DNSSEC and reduce code reuse
- Support multiple DNS servers, but not in the Config file (yet)
- Fix typo; r=@rolandshoemaker
2015-06-16 19:37:15 -05:00
Roland Shoemaker 0265b6f5d0 Merge upstream/master and fix conflicts 2015-06-10 12:43:11 -07:00
J.C. Jones c21c6d0bdf Issue #249 - Refactor an interface for the RPC Client and RPC Server
- Added the skeleton of the first RPC wrapper test
- Does not close Issue #249; still need to implement a channel-RPC mechanism
2015-06-04 11:43:48 -07:00
Roland Shoemaker 8846fd2c90 Merge upstream/master 2015-05-29 09:36:46 +01:00
J.C. Jones 8766edaa93 Issue #239 - Add a build ID method to WFE, and print Info on startup for all 2015-05-28 11:13:09 -07:00
Roland Shoemaker ce47e54180 add missing dep + fix test config 2015-05-28 12:24:47 +01:00
Roland Shoemaker ae1cf13be7 add config options for timeout + resolver address 2015-05-28 11:39:32 +01:00
J.C. Jones af0f8446eb Issue #202, Periodic OCSP Signer Tool
- Move dbMap construction and type converter into individual files in the sa package.
- Add DB configuration for the OCSP tool to the boulder config:
  - left to the user if they want to use different boulder-config.json files
    for different purposes.
- Added updater to Makefile
- Fix trailing ',' in the Boulder config, add more panic logging
- Ignore .pem files produced by the integration test
- Change RPC to use per-instance named reply-to queues.
- Finish OCSP Updater logic
- Rework RPC for OCSP to use a transfer object (due to serialization problems of x509.Certificate)
2015-05-27 22:01:29 -07:00
Richard Barnes c3b312118e Add audit logging
- Auditing for general errors in executables
- Auditing for improper messages received by WFE
- Automatic audit wlogging of software errors
- Audit logging for mis-routed messages
- Audit logging for certificate requests
- Auditing for improper messages received by WFE
- Add audit events table
- Expect more details in TestRegistration in web-front-end_test.go
- Remove "extra" debug details from web-front-end.go per Issue #174
- Improve test coverage of web-front-end.go
- WFE audit updates for revocation support rebase
- Add audit messages to RPC for Improper Messages and Error Conditions
- Also note misrouted messages
2015-05-18 18:23:08 -07:00
J.C. Jones a77152e828 Rework Authority "New" methods to obtain AuditLogger from Singleton
- Also ran `go fmt` against these files I was touching anyway:
    sa/storage-authority.go
    va/validation-authority.go
    wfe/web-front-end.go
2015-05-01 21:50:07 -07:00
J.C. Jones e828c61818 Add singleton semantics to Audit Logger, per Issue #135
- Update tests to use the singleton logger
- Update commands to set the audit logger singleton
- Formatting updates to the tests (go fmt)
2015-05-01 21:48:24 -07:00
Roland Shoemaker e9ac01f0f1 various error catch cleanups 2015-04-14 18:08:35 -07:00
Roland Shoemaker 4967e9486d hook in everywhere, add Noop client in tests 2015-04-12 21:50:07 -07:00
Roland Shoemaker e7f2f4f90c hook cmd.ProfileCmd into all the polylithic clients 2015-04-12 20:26:02 -07:00
Roland Shoemaker 93ccd37c82 consistent infinite for loop style 2015-04-08 20:07:57 -07:00
Roland Shoemaker e8ac96d68d fixes re: @jcjones 2015-04-08 19:17:39 -07:00
Roland Shoemaker 16e0799742 not really client so... just ! 2015-04-03 21:05:28 -07:00
Roland Shoemaker ec477b8986 remove unneeded for loops 2015-04-03 18:02:42 -07:00
Roland Shoemaker fe16dc3ce9 reconnect to amqp channels and rewire clients on amqp server restart/conn dropped 2015-04-03 17:54:11 -07:00
Peter Eckersley 532832452c Fix stray VA instantiation 2015-03-25 13:35:16 -07:00
J.C. Jones 33ac212b70 Add logging infrastructure to all authorities and commands 2015-03-24 19:06:11 -07:00
Richard Barnes 6beaa6a578 Migration of VA to individual binary 2015-03-21 18:38:06 -05:00