dns-monitor 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/README.md +2 -0
- data/dns-monitor.gemspec +1 -0
- data/lib/dns/monitor.rb +1 -0
- data/lib/dns/monitor/database.rb +5 -7
- data/lib/dns/monitor/version.rb +1 -1
- data/test.sqlite3 +0 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9747d0406d551004a09261b0963a7404f2656cd8a33d0dcdc93be963cf84a70
|
4
|
+
data.tar.gz: e6256a7d5182cdce76f44ce912438da8ac2b4ea53ec15249a3e69f9047bea3fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 681d88adfc5c206241bb672e7ee5eaff1f8b93e3093239867c159a603b894adc9fad9125b88cfb55ea1038c4f0927ebeae229da94e140ed9b7b29fcd52d54cd4
|
7
|
+
data.tar.gz: 731dde7868fb67b0a5a1002a8d219df547328ef2fa976dce258639d158ac6e001b4859b4cdecfb8be5986e33d7fa194d7737178fd2fe612163167e6578dee2f2
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dns-monitor (0.1.
|
4
|
+
dns-monitor (0.1.3)
|
5
|
+
easy_diff (~> 1.0.0)
|
5
6
|
sqlite3 (~> 1.4.2)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
11
|
coderay (1.1.2)
|
12
|
+
easy_diff (1.0.0)
|
11
13
|
method_source (0.9.2)
|
12
14
|
minitest (5.14.0)
|
13
15
|
pry (0.12.2)
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
The point of this gem is to monitor your hosts for (unwanted) DNS changes. The executable `dns-monitor` file is designed to be run as a CRON job. It takes a return-delimited text file listing domain names, and checks an RDAP database (which you can specify) for JSON entries that match. You will get an error, optionally by GChat, if you encounter a changed entry.
|
4
4
|
|
5
|
+
If you don't think this is something you need, perhaps give [this article](https://krebsonsecurity.com/2019/02/a-deep-dive-on-the-recent-widespread-dns-hijacking-attacks/) a read.
|
6
|
+
|
5
7
|
|
6
8
|
|
7
9
|
## Installation
|
data/dns-monitor.gemspec
CHANGED
data/lib/dns/monitor.rb
CHANGED
data/lib/dns/monitor/database.rb
CHANGED
@@ -14,6 +14,7 @@ module DNS
|
|
14
14
|
return if domain.nil? || rdap.nil?
|
15
15
|
|
16
16
|
changes = diff(most_recent(domain).rdap, rdap)
|
17
|
+
|
17
18
|
if changes.empty?
|
18
19
|
Check.new domain, :ok
|
19
20
|
else
|
@@ -28,13 +29,10 @@ module DNS
|
|
28
29
|
end
|
29
30
|
|
30
31
|
# Compare two different RDAP values
|
31
|
-
# NOTE: We have to do a JSON conversion because the values come
|
32
|
-
# from the server in arbitrary JSON key order.
|
33
|
-
def diff(
|
34
|
-
(
|
35
|
-
JSON.parse(previous_rdap || '{}').to_a -
|
36
|
-
JSON.parse(rdap || '{}').to_a
|
37
|
-
).to_h
|
32
|
+
# NOTE: We have to do a JSON conversion because the values come
|
33
|
+
# back from the server in arbitrary JSON key order.
|
34
|
+
def diff(previous_rdap, rdap)
|
35
|
+
JSON.parse(previous_rdap).easy_diff(JSON.parse(rdap)).last
|
38
36
|
end
|
39
37
|
|
40
38
|
# Return all entries for a given domain as a Domain struct
|
data/lib/dns/monitor/version.rb
CHANGED
data/test.sqlite3
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Donald Merand
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.4.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: easy_diff
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.0.0
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.0.0
|
83
97
|
description: "The point of this gem is to monitor your hosts for (unwanted) DNS changes.\nThe
|
84
98
|
`dns-monitor` file is designed to be run as a CRON job. It takes a\nreturn-delimited
|
85
99
|
text file listing domain names, and checks an RDAP\ndatabase (which you can specify)
|
@@ -112,6 +126,7 @@ files:
|
|
112
126
|
- lib/dns/monitor/mandrill.rb
|
113
127
|
- lib/dns/monitor/runner.rb
|
114
128
|
- lib/dns/monitor/version.rb
|
129
|
+
- test.sqlite3
|
115
130
|
homepage: https://github.com/exploration/dns-monitor
|
116
131
|
licenses:
|
117
132
|
- MIT
|