Marek Vavrusa [Mon, 8 Aug 2016 16:30:52 +0000 (18:30 +0200)]
Merge branch 'tls-listen' into 'master'
DNS over TLS and TCP out-of-order processing
Refresh !18
I merged few bits from @dkg branch, but there are two notable things missing:
- watch for on-disk chang of credentials - not sure if this is really needed, I would suggest a separate MR, where we can discuss benefits of doing so.
- ephemeral key generation from `net.tls_servicename` - this is fine, but instead of setting `tls_servicename`, let's make it an explicit generator e.g. net.generate_certificate("name") instead of setting `tls_servicename` in the `struct network`. Again I would suggest a separate MR.
To test the TLS listen, you can use a dns-over-tls branch from Knot DNS:
```
./daemon/kresd --tls=127.0.0.1\#5353
net.tls("cert", "key")
```
;; ANSWER SECTION:
www.cmu.edu. 86400 IN CNAME www-cmu-prod-vip.andrew.cmu.edu.
www-cmu-prod-vip.andrew.cmu.edu. 21600 IN A 128.2.42.52
;; Received 107 B
;; Time 2016-08-05 11:52:25 CEST
;; From 127.0.0.1@5353(TCP) in 2146.1 ms
;; TLS session info: (TLS1.2)-(ECDHE-RSA-SECP256R1)-(AES-256-GCM)
```
Marek Vavrusa [Fri, 5 Aug 2016 22:13:30 +0000 (00:13 +0200)]
Merge branch 'unbuffer-kr_log_info' into 'master'
Ensure that kr_log_info() gets sent promptly to stdout
If stdout is buffered, kr_log_info() might take ages to show up in the
output stream. Since this stream could be interleaved with stderr
(e.g. kr_log_error()), it would be good to be able to see the messages
in the order in which they are generated.
Ensure that kr_log_info() gets sent promptly to stdout
If stdout is buffered, kr_log_info() might take ages to show up in the
output stream. Since this stream could be interleaved with stderr
(e.g. kr_log_error()), it would be good to be able to see the messages
in the order in which they are generated.
RFC 7858 explicitly defines an out-of-band key pinning profile as one
authentication mechanism. It uses the same format for representing
the pin as HPKP does (RFC 7469).
By logging this pin directly upon first use of the X.509 credentials,
we make it a little bit easier for an admin to publish part of a
pinset.
For ideal operation (including preparation for key rollover), a backup
public key should also be provided, but this is not defined
functionally here.
Marek Vavrusa [Wed, 20 Jul 2016 04:36:20 +0000 (21:36 -0700)]
daemon: lower minimum allowed edns bufsize to 512
there are cases where switches or middle-boxes
block DNS/UDP answers >512 octets completely,
this gives user an option to mitigate that.
however, there are authoritatives serving
large answers that don't support TCP, so it's
a compromise as always
Marek Vavrusa [Mon, 11 Jul 2016 19:11:34 +0000 (12:11 -0700)]
daemon/tls: fixed improper use of callback, leaks
the TLS sessions now bypass the usuall event loop asynchronous iops
this is because the whole operation is synchronous right now, and
implementing asynchronous send operations would require TLS session to
restart write events on the event loop and making sure the "on complete"
callback is called eventually
Marek Vavrusa [Wed, 20 Jul 2016 04:36:20 +0000 (21:36 -0700)]
daemon: lower minimum allowed edns bufsize to 512
there are cases where switches or middle-boxes
block DNS/UDP answers >512 octets completely,
this gives user an option to mitigate that.
however, there are authoritatives serving
large answers that don't support TCP, so it's
a compromise as always
Marek Vavrusa [Mon, 18 Jul 2016 04:02:02 +0000 (21:02 -0700)]
daemon: always refetch CNAME target in 'strict' mode
in normal mode, only final CNAME target is refetched, but
not intermediate CNAMEs. intermediate CNAMEs are *never* cached,
but they are used to get final name for requery. in strict mode now,
every CNAME target is explicitly fetched even if it's a chained CNAME.
Marek Vavrusa [Wed, 6 Jul 2016 17:43:32 +0000 (10:43 -0700)]
daemon/network: allow listening on part of interfaces
when whole interface is passed and some of the addresses are not bindable,
the daemon will print them, but will continue to bind to the rest of the
addresses
Marek Vavrusa [Tue, 5 Jul 2016 07:35:15 +0000 (00:35 -0700)]
modules: http, graphite, policy, daf support map()
all relevant modules now support running in
forked mode and polling workers for information.
for example graphite module can poll stats from
all workers and then aggregate before sending,
or HTTP module can run on the process group leader
only and then poll workers for information.
Marek Vavrusa [Tue, 5 Jul 2016 07:32:42 +0000 (00:32 -0700)]
daemon: workers are interconnected with IPC pipes
forks are connected with IPC pipes to process
group leader and can execute expressions on its
behalf. so running commands over all workers
is easy now:
> hostname() -- single
localhost
> map 'hostname()' -- all
localhost
localhost
localhost
Marek Vavrusa [Fri, 24 Jun 2016 23:23:30 +0000 (16:23 -0700)]
modules/http: reworked metrics interface
* the dygraphs are now leveraged for drawing as
canvas based drawing is much faster than
svg based rickshaw
* refreshed theme and layouts, code cleanup
Marek Vavrusa [Thu, 23 Jun 2016 06:12:38 +0000 (23:12 -0700)]
daemon/worker: reverted inbound deduping
the e638f9fb6e5aa20e090ebfa52255abc36a619bfd introduced deduplication
for queries over UDP, the idea is to track same queries and answer
only once, however that introduces both constant processing and
memory overhead and could break clients who count packet loss
by queries sent/received. disabling for now.
Marek Vavrusa [Thu, 23 Jun 2016 05:48:31 +0000 (22:48 -0700)]
modules/http: keep history of last 120 datapoints
* the http module collects stats snapshots on one
central location and then streams it to clients
* history of last 120 datapoints (at least 2min)
is kept for convenience
* rules may now be chained if the rule action
doesn't return next state. in this case, next
matching rule will be executed. this is useful
for snooping actions
* rules now may be paused/deleted
* implemented a new action for query mirroring to
given destination
Marek Vavrusa [Thu, 16 Jun 2016 17:39:07 +0000 (10:39 -0700)]
daemon/worker: track query in BEGIN and dst addr
* in the begin() layer, the incoming query is
exposed as req->qsource.packet, it is invalidated
after begin() and should not be modified
* the destination address (local interface) is
also tracked for filtering purposes
Marek Vavrusa [Mon, 13 Jun 2016 17:18:28 +0000 (10:18 -0700)]
modules/http: new bootstrap3 based web interface
this is going to be the building block for visual
ui as it provides many useful semantic objects and
style classes. since we already provide the
snippet system, it's possible to add subpages to
the ui without hacking everything inside
Marek Vavrusa [Mon, 13 Jun 2016 16:56:13 +0000 (09:56 -0700)]
modules/policy: unique ids for rules, match counter
these are used as a handle to patch/modify rules
later in their lifetime, also added a rule match
counter to find out which rules match inbound
traffic