-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `dnstap`: Fix #265: - Require dnswire v0.3.0+ for new protocol types and message types - Add support for DNSTAP's DOT, DOH and DNSCrypt socket protocols - Add support for `UPDATE_QUERY` and `UPDATE_RESPONSE` message types, interpret them as `AUTH_` - Add indexer `encryption` to index encrypted DNS vid DNSTAP - Add test for encrypted DNS via DNSTAP - Fix other DNSTAP tests - `transport_index`: Fix typo in code documentation
- Loading branch information
Showing
21 changed files
with
567 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright (c) 2008-2022, OARC, Inc. | ||
* Copyright (c) 2007-2008, Internet Systems Consortium, Inc. | ||
* Copyright (c) 2003-2007, The Measurement Factory, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its | ||
* contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include "config.h" | ||
|
||
#include "encryption_index.h" | ||
|
||
#include "md_array.h" | ||
|
||
int encryption_indexer(const dns_message* m) | ||
{ | ||
return m->tm->encryption; | ||
} | ||
|
||
static int next_iter = 0; | ||
|
||
int encryption_iterator(const char** label) | ||
{ | ||
if (NULL == label) { | ||
next_iter = 0; | ||
return TRANSPORT_ENCRYPTION_DNSCrypt + 1; | ||
} | ||
switch (next_iter) { | ||
case TRANSPORT_ENCRYPTION_UNENCRYPTED: | ||
*label = "unencrypted"; | ||
break; | ||
case TRANSPORT_ENCRYPTION_DOT: | ||
*label = "dot"; | ||
break; | ||
case TRANSPORT_ENCRYPTION_DOH: | ||
*label = "doh"; | ||
break; | ||
case TRANSPORT_ENCRYPTION_DNSCrypt: | ||
*label = "dnscrypt"; | ||
break; | ||
default: | ||
return -1; | ||
} | ||
return next_iter++; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2008-2022, OARC, Inc. | ||
* Copyright (c) 2007-2008, Internet Systems Consortium, Inc. | ||
* Copyright (c) 2003-2007, The Measurement Factory, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its | ||
* contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef __dsc_encryption_index_h | ||
#define __dsc_encryption_index_h | ||
|
||
#include "dns_message.h" | ||
|
||
int encryption_indexer(const dns_message*); | ||
int encryption_iterator(const char** label); | ||
|
||
#endif /* __dsc_encryption_index_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
local_address 127.0.0.1; | ||
run_dir "."; | ||
minfree_bytes 5000000; | ||
dnstap_file ./dotdoh.dnstap.dist; | ||
dataset qtype dns All:null Qtype:qtype queries-only; | ||
dataset rcode dns All:null Rcode:rcode replies-only; | ||
dataset opcode dns All:null Opcode:opcode queries-only; | ||
dataset rcode_vs_replylen dns Rcode:rcode ReplyLen:msglen replies-only; | ||
dataset client_subnet dns All:null ClientSubnet:client_subnet queries-only max-cells=200; | ||
dataset qtype_vs_qnamelen dns Qtype:qtype QnameLen:qnamelen queries-only; | ||
dataset qtype_vs_tld dns Qtype:qtype TLD:tld queries-only,popular-qtypes max-cells=200; | ||
dataset certain_qnames_vs_qtype dns CertainQnames:certain_qnames Qtype:qtype queries-only; | ||
dataset client_subnet2 dns Class:query_classification ClientSubnet:client_subnet queries-only max-cells=200; | ||
dataset client_addr_vs_rcode dns Rcode:rcode ClientAddr:client replies-only max-cells=50; | ||
dataset chaos_types_and_names dns Qtype:qtype Qname:qname chaos-class,queries-only; | ||
dataset idn_qname dns All:null IDNQname:idn_qname queries-only; | ||
dataset edns_version dns All:null EDNSVersion:edns_version queries-only; | ||
dataset edns_bufsiz dns All:null EDNSBufSiz:edns_bufsiz queries-only; | ||
dataset do_bit dns All:null D0:do_bit queries-only; | ||
dataset rd_bit dns All:null RD:rd_bit queries-only; | ||
dataset tc_bit dns All:null TC:tc_bit any; | ||
dataset idn_vs_tld dns All:null TLD:tld queries-only,idn-only; | ||
dataset ipv6_rsn_abusers dns All:null ClientAddr:client queries-only,aaaa-or-a6-only,root-servers-net-only max-cells=50; | ||
dataset transport_vs_qtype dns Transport:transport Qtype:qtype queries-only; | ||
dataset client_port_range dns All:null PortRange:dns_sport_range queries-only; | ||
dataset direction_vs_ipproto ip Direction:ip_direction IPProto:ip_proto any; | ||
dataset ip_version ip All:null Version:ip_version any; | ||
dataset dns_ip_version dns All:null Version:dns_ip_version any; | ||
dataset qclass dns All:null Class:qclass any; | ||
dataset qname dns All:null Name:qname any; | ||
dataset qr_aa_bits dns Direction:ip_direction QRAABits:qr_aa_bits any; | ||
dataset server dns All:null IP:server any; | ||
dataset second_ld_vs_rcode dns Rcode:rcode SecondLD:second_ld replies-only max-cells=50; | ||
dataset third_ld_vs_rcode dns Rcode:rcode ThirdLD:third_ld replies-only max-cells=50; | ||
dataset label_count dns All:null LabelCount:label_count any; | ||
dataset encryption dns All:null Encryption:encryption queries-only; | ||
dump_reports_on_exit; | ||
no_wait_interval; |
Oops, something went wrong.