homebrew-core/Formula/dnsviz.rb
2019-11-22 14:05:06 +01:00

142 lines
6.1 KiB
Ruby

class Dnsviz < Formula
include Language::Python::Virtualenv
desc "Tools for analyzing and visualizing DNS and DNSSEC behavior"
homepage "https://github.com/dnsviz/dnsviz/"
url "https://files.pythonhosted.org/packages/25/d2/0ebfe23440a1adfdca403d7773570d3c05a3a8c5bcbaa0c091b5114d0224/dnsviz-0.8.2.tar.gz"
sha256 "a81ff254c23718cd6f364b03bf6e9c80468fa4663fd5be66043de7b0bece1cab"
revision 2
bottle do
cellar :any
sha256 "cde386e003eb2d8112ef2e8e947b2c9919c275a3cc193315df1a7e0043a3402c" => :catalina
sha256 "4eca36bda18ba3969581ddc2cac1c15e33177afded24f12e8b46c89cfc5df2b2" => :mojave
sha256 "8ecd24e5b812a8945a182c255de5c50fcba01adfc23ec0dcb8ad2d3e166101f1" => :high_sierra
end
depends_on "pkg-config" => :build
depends_on "swig" => :build
depends_on "bind" => :test
depends_on "graphviz"
depends_on "libsodium"
depends_on "openssl@1.1"
depends_on "python"
resource "dnspython" do
url "https://files.pythonhosted.org/packages/ec/c5/14bcd63cb6d06092a004793399ec395405edf97c2301dfdc146dfbd5beed/dnspython-1.16.0.zip"
sha256 "36c5e8e38d4369a08b6780b7f27d790a292b2b08eea01607865bf0936c558e01"
end
resource "pygraphviz" do
url "https://files.pythonhosted.org/packages/7e/b1/d6d849ddaf6f11036f9980d433f383d4c13d1ebcfc3cd09bc845bda7e433/pygraphviz-1.5.zip"
sha256 "50a829a305dc5a0fd1f9590748b19fece756093b581ac91e00c2c27c651d319d"
end
resource "M2crypto" do
url "https://files.pythonhosted.org/packages/74/18/3beedd4ac48b52d1a4d12f2a8c5cf0ae342ce974859fba838cbbc1580249/M2Crypto-0.35.2.tar.gz"
sha256 "4c6ad45ffb88670c590233683074f2440d96aaccb05b831371869fc387cbd127"
end
resource "typing" do
url "https://files.pythonhosted.org/packages/67/b0/b2ea2bd67bfb80ea5d12a5baa1d12bda002cab3b6c9b48f7708cd40c34bf/typing-3.7.4.1.tar.gz"
sha256 "91dfe6f3f706ee8cc32d38edbbf304e9b7583fb37108fef38229617f8b3eba23"
end
def install
ENV["SWIG_FEATURES"]="-I#{Formula["openssl@1.1"].opt_include}"
# Fix building of M2Crypto on High Sierra https://github.com/Homebrew/homebrew-core/pull/45895#issuecomment-557200007
ENV.delete("HOMEBREW_SDKROOT") if MacOS.version == :high_sierra
virtualenv_install_with_resources
end
test do
(testpath/"example.com.zone.signed").write <<~EOS
; File written on Thu Jan 10 21:14:03 2019
; dnssec_signzone version 9.11.4-P2-3~bpo9+1-Debian
example.com. 3600 IN SOA example.com. root.example.com. (
1 ; serial
3600 ; refresh (1 hour)
3600 ; retry (1 hour)
14400 ; expire (4 hours)
3600 ; minimum (1 hour)
)
3600 RRSIG SOA 10 2 3600 (
20230110031403 20190111031403 39026 example.com.
D2WDMpH4Ip+yi2wQFmCq8iPWWdHo/vGig/rG
+509RbOLHbeFaO84PrPvw/dS6kjDupQbyG1t
8Hx0XzlvitBZjpYFq3bd/k0zU/S39IroeDfU
xR/BlI2bEaIPxgG2AulJjS6lnYigfko4AKfe
AqssO7P1jpiUUYtFpivK3ybl03o= )
3600 NS example.com.
3600 RRSIG NS 10 2 3600 (
20230110031403 20190111031403 39026 example.com.
bssTLRwAeyn0UtOjWKVbaJdq+lNbeOKBE2a4
QdR2lrgNDVenY8GciWarYcd5ldPfrfX5t5I9
QwiIsv/xAPgksVlmWcZGVDAAzzlglVhCg2Ys
J7YEcV2DDIMZLx2hm6gu9fKaMcqp8lhUSCBD
h4VTswLV1HoUDGYwEsjLEtiRin8= )
3600 A 127.0.0.1
3600 RRSIG A 10 2 3600 (
20230110031403 20190111031403 39026 example.com.
TH+PWGhFd3XL09IkCeAd0TNrWVsj+bAcQESx
F27lCgMnYYebiy86QmhEGzM+lu7KX1Vn15qn
2KnyEKofW+kFlCaOMZDmwBcU0PznBuGJ/oQ9
2OWe3X2bw5kMEQdxo7tjMlDo+v975VaZgbCz
od9pETQxdNBHkEfKmxWpenMi9PI= )
3600 AAAA ::1
3600 RRSIG AAAA 10 2 3600 (
20230110031403 20190111031403 39026 example.com.
qZM60MUJp95oVqQwdW03eoCe5yYu8hdpnf2y
Z7eyxTDg1qEgF+NUF6Spe8OKsu2SdTolT0CF
8X068IGTEr2rbFK/Ut1owQEyYuAnbNGBmg99
+yo1miPgxpHL/GbkMiSK7q6phMdF+LOmGXkQ
G3wbQ5LUn2R7uSPehDwXiRbD0V8= )
3600 NSEC example.com. A NS SOA AAAA RRSIG NSEC DNSKEY
3600 RRSIG NSEC 10 2 3600 (
20230110031403 20190111031403 39026 example.com.
Rdx/TmynYt0plItVI10plFis6PbsH29qyXBw
NLOEAMNLvU6IhCOlv7T8YxZWsamg3NyM0det
NgQqIFfJCfLEn2mzHdqfPeVqxyKgXF1mEwua
TZpE8nFw95buxV0cg67N8VF7PZX6zr1aZvEn
b022mYFpqaGMhaA6f++lGChDw80= )
3600 DNSKEY 256 3 10 (
AwEAAaqQ5dsqndLRH+9j/GbtUObxgAEvM7VH
/y12xjouBFnqTkAL9VvonNwYkFjnCZnIriyl
jOkNDgE4G8pYzYlK13EtxBDJrUoHU11ZdL95
ZQEpd8hWGqSG2KQiCYwAAhmG1qu+I+LtexBe
kNwT3jJ1BMgGB3xsCluUYHBeSlq9caU/
) ; ZSK; alg = RSASHA512 ; key id = 39026
3600 DNSKEY 257 3 10 (
AwEAAaLSZl7J7bJnFAcRrqWE7snJvJ1uzkS8
p1iq3ciHnt6rZJq47HYoP5TCnKgCpje/HtZt
L/7n8ixPjhgj8/GkfOwoWq5kU3JUN2uX6pBb
FhSsVeNe2JgEFtloZSMHhSU52yS009WcjZJV
O2QX2JXcLy0EMI2S4JIFLa5xtatXQ2/F
) ; KSK; alg = RSASHA512 ; key id = 34983
3600 RRSIG DNSKEY 10 2 3600 (
20230110031403 20190111031403 34983 example.com.
g1JfHNrvVch3pAX3/qHuiivUeSawpmO7h2Pp
Hqt9hPbR7jpzOxbOzLAxHopMR/xxXN1avyI5
dh23ySy1rbRMJprz2n09nYbK7m695u7P18+F
sCmI8pjqtpJ0wg/ltEQBCRNaYOrHvK+8NLvt
PGJqJru7+7aaRr1PP+ne7Wer+gE= )
EOS
(testpath/"example.com.zone-delegation").write <<~EOS
example.com. IN NS ns1.example.com.
ns1.example.com. IN A 127.0.0.1
example.com. IN DS 34983 10 1 EC358CFAAEC12266EF5ACFC1FEAF2CAFF083C418
example.com. IN DS 34983 10 2 608D3B089D79D554A1947BD10BEC0A5B1BDBE67B4E60E34B1432ED00 33F24B49
EOS
system "#{bin}/dnsviz", "probe", "-d", "0", "-A",
"-x", "example.com:example.com.zone.signed",
"-N", "example.com:example.com.zone-delegation",
"-D", "example.com:example.com.zone-delegation",
"-o", "example.com.json",
"example.com"
system "#{bin}/dnsviz", "graph", "-r", "example.com.json", "-Thtml", "-o", "/dev/null"
system "#{bin}/dnsviz", "grok", "-r", "example.com.json", "-o", "/dev/null"
system "#{bin}/dnsviz", "print", "-r", "example.com.json", "-o", "/dev/null"
end
end