neetob 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bookmarks.md +2 -1
- data/lib/neetob/cli/cloudflare/base.rb +2 -1
- data/lib/neetob/cli/cloudflare/commands.rb +7 -0
- data/lib/neetob/cli/cloudflare/verify_spf.rb +40 -0
- data/lib/neetob/cli/sre/checklist.rb +2 -0
- data/lib/neetob/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a85d5458f350de550c9785efcea262e3ac2e02eabd62488b966bb991eb25fa8
|
4
|
+
data.tar.gz: 253aa491e34bba66d77c88648b616fed62ee3772094844337897a69caa3de3df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ac09ea5934d46982738d8e7b33d0fce4f9109da1d7ee4fb8bd7753504332ae9da13ee2f8764ae9e866e7e693cc6d4adc66d25b7b97106b84ddff780efb93f03
|
7
|
+
data.tar.gz: 274107fc81d32548355a2b3b9dc3cf38bbdc2372696be9502d24760a0c2f9a56678ad6b9fed3844f9e5b12c441fd111968d8f346dbdd79d32a6b9cb9669da679
|
data/Gemfile.lock
CHANGED
data/bookmarks.md
CHANGED
@@ -112,7 +112,8 @@ example: [All nano issues created before the 20th Mar 2024](https://github.com/i
|
|
112
112
|
|
113
113
|
- [Praveen's Board](https://github.com/orgs/bigbinary/projects/100/views/1)
|
114
114
|
|
115
|
-
- [Varun's Board](https://github.com/orgs/bigbinary/projects/73/views/1)
|
115
|
+
- [Varun's Board](https://github.com/orgs/bigbinary/projects/73/views/1):
|
116
|
+
[neeto-playdash-web](https://github.com/orgs/bigbinary/projects/73/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-playdash-web%22),
|
116
117
|
|
117
118
|
- [Farhan's Board](https://github.com/orgs/bigbinary/projects/78/views/1)
|
118
119
|
|
@@ -72,7 +72,8 @@ module Neetob
|
|
72
72
|
"neetotribe.com": "45eb5b7d96820cf7c375dcdaf608d4c7",
|
73
73
|
"neetotribe.net": "f49cb0229b1d67d228da7ab39a17dde3",
|
74
74
|
"neetowireframe.com": "d6d17a3dab91dc0ca4b9f4f65b086ccc",
|
75
|
-
"
|
75
|
+
"neeto.com": "83eeffbce76df68b60e50d1fa254b3fa",
|
76
|
+
"bigbinary.com": "dc60ee7ecbff0ef5e58e1bb27ad40e89"
|
76
77
|
}
|
77
78
|
|
78
79
|
def initialize
|
@@ -7,6 +7,7 @@ require_relative "always_use_https"
|
|
7
7
|
require_relative "dns_proxy_status"
|
8
8
|
require_relative "ensure_cdn"
|
9
9
|
require_relative "bot_fight_mode"
|
10
|
+
require_relative "verify_spf"
|
10
11
|
|
11
12
|
module Neetob
|
12
13
|
class CLI
|
@@ -47,6 +48,12 @@ module Neetob
|
|
47
48
|
def bot_fight_mode
|
48
49
|
BotFightMode.new(options[:domain]).process
|
49
50
|
end
|
51
|
+
|
52
|
+
desc "verify_spf", "Validate the TXT records for SPF"
|
53
|
+
option :domain, type: :string, aliases: "-d", required: true, description: "Domain name"
|
54
|
+
def verify_spf
|
55
|
+
VerifySpf.new(options[:domain]).process
|
56
|
+
end
|
50
57
|
end
|
51
58
|
end
|
52
59
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Neetob
|
6
|
+
class CLI
|
7
|
+
module Cloudflare
|
8
|
+
class VerifySpf < Base
|
9
|
+
attr_accessor :domain
|
10
|
+
|
11
|
+
def initialize(domain)
|
12
|
+
super()
|
13
|
+
@domain = domain
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
zone_id = ZONE_IDS[domain.to_sym]
|
18
|
+
raise(StandardError, "Domain '#{domain}' not found.") if zone_id.nil?
|
19
|
+
|
20
|
+
url = create_url(zone_id, "dns_records")
|
21
|
+
response = get(url)
|
22
|
+
|
23
|
+
raise(StandardError, "No DNS records found") if response[:result].empty?
|
24
|
+
|
25
|
+
spf_txt_records = response[:result].filter { |dns| dns[:type] == "TXT" && dns[:content].start_with?("v=spf1") }
|
26
|
+
|
27
|
+
if spf_txt_records.count > 1
|
28
|
+
ui.error("More than one TXT record found for SPF")
|
29
|
+
else
|
30
|
+
ui.success("Only one TXT record for SPF present")
|
31
|
+
end
|
32
|
+
|
33
|
+
spf_txt_records.each_with_index do |dns, index|
|
34
|
+
ui.info("SPF TXT #{index + 1}: #{dns[:content]}")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -34,6 +34,8 @@ module Neetob
|
|
34
34
|
ui.info `neetob cloudflare always_use_https -d #{domain} | sed 's/^/ /'`
|
35
35
|
ui.info "Bot fight mode"
|
36
36
|
ui.info `neetob cloudflare bot_fight_mode -d #{domain} | sed 's/^/ /'`
|
37
|
+
ui.info "Validating SPF records"
|
38
|
+
ui.info `neetob cloudflare verify_spf -d #{domain} | sed 's/^/ /'`
|
37
39
|
if is_heroku(app_name)
|
38
40
|
ui.info "Heroku maintenance time"
|
39
41
|
ui.info `neetob heroku maintenance_window -a #{app_name} | sed 's/^/ /'`
|
data/lib/neetob/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neetob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Udai Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- lib/neetob/cli/cloudflare/ensure_cdn.rb
|
180
180
|
- lib/neetob/cli/cloudflare/min_tls_version.rb
|
181
181
|
- lib/neetob/cli/cloudflare/ssl_mode.rb
|
182
|
+
- lib/neetob/cli/cloudflare/verify_spf.rb
|
182
183
|
- lib/neetob/cli/code/audit.rb
|
183
184
|
- lib/neetob/cli/code/commands.rb
|
184
185
|
- lib/neetob/cli/fetchorupdate_repos/execute.rb
|