Coder Social home page Coder Social logo

gopassivedns's People

Contributors

artyomtkachenko avatar elhoim avatar jimmystewpot avatar phillipmartin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gopassivedns's Issues

FR: Support arbitrary syslog facilities

Due to the log volume from gopassivedns, we'd like to configure it to log to a specific syslog facility to further separate it out from the rest of the system logs. However it seems that,

gopassivedns/log.go

Lines 244 to 283 in aa047e1

case "KERN":
return syslog.LOG_KERN, nil
case "USER":
return syslog.LOG_USER, nil
case "MAIL":
return syslog.LOG_MAIL, nil
case "DAEMON":
return syslog.LOG_DAEMON, nil
case "AUTH":
return syslog.LOG_AUTH, nil
case "SYSLOG":
return syslog.LOG_SYSLOG, nil
case "LPR":
return syslog.LOG_LPR, nil
case "NEWS":
return syslog.LOG_NEWS, nil
case "UUCP":
return syslog.LOG_UUCP, nil
case "CRON":
return syslog.LOG_CRON, nil
case "AUTHPRIV":
return syslog.LOG_AUTHPRIV, nil
case "FTP":
return syslog.LOG_FTP, nil
case "LOCAL0":
return syslog.LOG_LOCAL0, nil
case "LOCAL1":
return syslog.LOG_LOCAL1, nil
case "LOCAL2":
return syslog.LOG_LOCAL2, nil
case "LOCAL3":
return syslog.LOG_LOCAL3, nil
case "LOCAL4":
return syslog.LOG_LOCAL4, nil
case "LOCAL5":
return syslog.LOG_LOCAL5, nil
case "LOCAL6":
return syslog.LOG_LOCAL6, nil
case "LOCAL7":
return syslog.LOG_LOCAL7, nil
restricts the providers.

FR: Configurable syslog tag

I'd like to be able to configure the tag that gopassivedns passes to syslog. It appears it's currently hardcoded to /usr/sbin/gopassivedns[12406]:. Ideally, I'd be able to simply have them set as gopassivedns.

Crashes on DNS resolvers receiving thousands of requests

Stack Trace:

panic: runtime error: index out of range

goroutine 20 [running]:
panic(0x5ba220, 0xc4200120a0)
        /usr/lib/golang/src/runtime/panic.go:500 +0x1a1
main.initLogEntry(0xc4236eb2f0, 0x4, 0x10, 0xc4236eb310, 0x4, 0x10, 0x0, 0x0, 0x0, 0x0, ...)
        /builddir/build/BUILD/gopassivedns-aa047e156339bc54f46cf6ccc7fa99f24d94c9d2/gocode/src/github.com/phillipmartin/gopassivedns/main.go:157 +0x541
main.handleDns(0xc421450000, 0xc423560180, 0xc42000c1e0, 0xc4236eb2f0, 0x4, 0x10, 0xc4236eb310, 0x4, 0x10)
        /builddir/build/BUILD/gopassivedns-aa047e156339bc54f46cf6ccc7fa99f24d94c9d2/gocode/src/github.com/phillipmartin/gopassivedns/main.go:224 +0x59e
main.handlePacket(0xc42000c300, 0xc42000c1e0, 0x29e8d60800, 0xfffffff207b8a800, 0x1, 0x0)
        /builddir/build/BUILD/gopassivedns-aa047e156339bc54f46cf6ccc7fa99f24d94c9d2/gocode/src/github.com/phillipmartin/gopassivedns/main.go:291 +0x423
created by main.doCapture
        /builddir/build/BUILD/gopassivedns-aa047e156339bc54f46cf6ccc7fa99f24d94c9d2/gocode/src/github.com/phillipmartin/gopassivedns/main.go:383 +0x278

We have a few DNS resolvers that handle between 2800-3800 requests per minute (according to the logs gopassivedns generates). It's much more frequent on resolves seeing >7500 requests per minute. It seems that after a while and not consistently the process will die and dump the above stack trace. This is not an issue at all on resolves seeing between 200-700 requests per minute. Happy to provide any other information that might be useful!

No recovery from disk full

Recently had another security tool freaking out and it filled up disk on the machines. But I noticed later that after freeing up space, gopassivedns was running, but not logging anything. If I bounced the service it was fine. Is there a sane way for the logger to recover from not being able to write to the disk?

No tests

There are no tests. There should be some tests.

output capture stats

build in an optional capture stats output stream. something that works with statsd.

gopassivedns -dev eth0 not receiving anything

Hello,

just tried using gopassivedns on a Ubuntu 16.04 box. Reading from PCAP works fine, but when I start it on eth0, nothing happens, no output, no errors. gopassivedns version is e879ce4.

./gopassivedns -dev eth0 -debug DEBU[0000] STDOUT logging enabled

Also the interface does not switch into promiscuous mode.

Let me know what I should do to debug this. FWIW, the interface has a second IPv4 address via ip addr I can provide an strace to you privately.

did not parse as a facility

Hi, I just did a fresh install on Ubuntu 16.04.1 LTS on i686 architecture and am getting an error when running. I have 2 monitor/SPAN interfaces, enp5s0f1 and enp9s2. Both interfaces show the same error when running gopassivedns with only the -dev option specifid: FATA[0000] string '' did not parse as a facility

Sometimes it decodes 1 query, but usually it just fails with the error as seen below.

root@ns-mon-1:/gopassivedns# ./gopassivedns -dev enp5s0f1
FATA[0000] string '' did not parse as a facility
root@ns-mon-1:
/gopassivedns# ./gopassivedns -dev enp5s0f1
FATA[0000] string '' did not parse as a facility
root@ns-mon-1:/gopassivedns# ./gopassivedns -dev enp5s0f1
FATA[0000] string '' did not parse as a facility
root@ns-mon-1:
/gopassivedns# ./gopassivedns -dev enp5s0f1
{"query_id":41507,"response_code":0,"question":"<DOMAIN_REMOVED>","question_type":"A","answer":"<IP_REMOVED>","answer_type":"A","ttl":195,"server":"<IP_REMOVED>","client":"<IP_REMOVED>","timestamp":"2016-12-01T22:43:23Z"}
FATA[0000] string '' did not parse as a facility

root@ns-mon-1:/gopassivedns# ./gopassivedns -dev enp9s2
FATA[0000] string '' did not parse as a facility
root@ns-mon-1:
/gopassivedns# ./gopassivedns -dev enp9s2
{"query_id":53889,"response_code":0,"question":"<DOMAIN_REMOVED>","question_type":"A","answer":"<IP_REMOVED>","answer_type":"A","ttl":24,"server":"<IP_REMOVED>","client":"<IP_REMOVED>","timestamp":"2016-12-01T22:49:35Z"}
FATA[0000] string '' did not parse as a facility
root@ns-mon-1:/gopassivedns# ./gopassivedns -dev enp9s2
FATA[0000] string '' did not parse as a facility
root@ns-mon-1:
/gopassivedns# ./gopassivedns -dev enp9s2
FATA[0000] string '' did not parse as a facility

root@ns-mon-1:~# uname -a
Linux ns-mon-1 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:17 UTC 2016 i686 i686 i686 GNU/Linux

root@ns-mon-1:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

Please let me know if there is any other info required to help understand why it's not working as expected.

Thanks

use of DNS query ID in connection map key is probably going to lead to issues

DNS ID is a 16 bit value. In large environments this may not be enough space to prevent collisions. We split the traffic up over an arbitrary number of goroutines, so a simple fix is to spin up more goroutines such that each routine gets fewer values and lowers the chances of collision. A long term solution probably involves adding some other items to the map key.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.