neetob 0.5.16 → 0.5.18

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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.env +4 -0
  3. data/.neetoci/default.yml +1 -1
  4. data/.ruby-version +1 -1
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +108 -109
  7. data/lib/neetob/cli/cloudflare/always_use_https.rb +7 -2
  8. data/lib/neetob/cli/cloudflare/bot_fight_mode.rb +7 -2
  9. data/lib/neetob/cli/cloudflare/dns_proxy_status.rb +8 -2
  10. data/lib/neetob/cli/cloudflare/min_tls_version.rb +8 -2
  11. data/lib/neetob/cli/cloudflare/ssl_mode.rb +4 -1
  12. data/lib/neetob/cli/cloudflare/verify_spf.rb +21 -8
  13. data/lib/neetob/cli/code/audit.rb +19 -7
  14. data/lib/neetob/cli/cronitor/base.rb +49 -0
  15. data/lib/neetob/cli/cronitor/get_all_monitors.rb +21 -0
  16. data/lib/neetob/cli/github/base.rb +3 -2
  17. data/lib/neetob/cli/github/brakeman.rb +7 -3
  18. data/lib/neetob/cli/github/bundle_audit.rb +52 -0
  19. data/lib/neetob/cli/github/make_pr/base.rb +10 -2
  20. data/lib/neetob/cli/github/repositories/get_security_details.rb +45 -0
  21. data/lib/neetob/cli/github/repositories/pull_requests.rb +34 -0
  22. data/lib/neetob/cli/github/yarn_audit.rb +47 -0
  23. data/lib/neetob/cli/monthly_audit/commands.rb +19 -0
  24. data/lib/neetob/cli/monthly_audit/databases/main.rb +29 -0
  25. data/lib/neetob/cli/monthly_audit/databases/users_unique_email_index.rb +40 -0
  26. data/lib/neetob/cli/monthly_audit/databases/uuid_primary_key.rb +45 -0
  27. data/lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/always_use_https_is_enabled.rb +32 -0
  28. data/lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/bot_protection_enabled.rb +32 -0
  29. data/lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/dns_entry_has_proxy_status.rb +41 -0
  30. data/lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/main.rb +38 -0
  31. data/lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/minimum_tls_version_is_one_point_two.rb +34 -0
  32. data/lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/spf_records_are_valid.rb +41 -0
  33. data/lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/ssl_tls_encryption_mode_set_to_full.rb +34 -0
  34. data/lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/main.rb +29 -0
  35. data/lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/setup_correctly_for_apps.rb +54 -0
  36. data/lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/setup_correctly_for_help_center.rb +53 -0
  37. data/lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/setup_correctly_for_landing_pages.rb +53 -0
  38. data/lib/neetob/cli/monthly_audit/instances_and_addons/honeybadger/main.rb +23 -0
  39. data/lib/neetob/cli/monthly_audit/instances_and_addons/honeybadger/setup_correctly_for_apps.rb +49 -0
  40. data/lib/neetob/cli/monthly_audit/instances_and_addons/main.rb +40 -0
  41. data/lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/auto_scaling_enabled.rb +46 -0
  42. data/lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/cloudfront_cdn_enabled.rb +56 -0
  43. data/lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/essential_environment_variables_set.rb +43 -0
  44. data/lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/main.rb +35 -0
  45. data/lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb +43 -0
  46. data/lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/ssl_certificates_over_thirty_days_from_expiry.rb +41 -0
  47. data/lib/neetob/cli/monthly_audit/misc/main.rb +32 -0
  48. data/lib/neetob/cli/monthly_audit/misc/redirections_working_correctly.rb +30 -0
  49. data/lib/neetob/cli/monthly_audit/misc/sparkpost_sub_account_used_for_all_apps.rb +32 -0
  50. data/lib/neetob/cli/monthly_audit/misc/ssl_certs_setup_for_auto_renewal.rb +29 -0
  51. data/lib/neetob/cli/monthly_audit/perform.rb +41 -0
  52. data/lib/neetob/cli/monthly_audit/security/code/brakeman.rb +38 -0
  53. data/lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb +40 -0
  54. data/lib/neetob/cli/monthly_audit/security/code/main.rb +29 -0
  55. data/lib/neetob/cli/monthly_audit/security/code/yarn_audit.rb +44 -0
  56. data/lib/neetob/cli/monthly_audit/security/github/dependabot_prs_merged.rb +48 -0
  57. data/lib/neetob/cli/monthly_audit/security/github/dependabot_turned_on.rb +44 -0
  58. data/lib/neetob/cli/monthly_audit/security/github/main.rb +26 -0
  59. data/lib/neetob/cli/monthly_audit/security/main.rb +31 -0
  60. data/lib/neetob/cli/neeto_deploy/autoscaling_config.rb +6 -1
  61. data/lib/neetob/cli/neeto_deploy/certificates.rb +3 -0
  62. data/lib/neetob/cli/neeto_deploy/config_vars/list.rb +8 -2
  63. data/lib/neetob/cli/neeto_deploy/scheduled_exports.rb +6 -1
  64. data/lib/neetob/cli/redirections/check.rb +13 -3
  65. data/lib/neetob/cli/sre/base.rb +10 -0
  66. data/lib/neetob/cli/sre/check_essential_env.rb +18 -3
  67. data/lib/neetob/cli/ui.rb +43 -3
  68. data/lib/neetob/cli.rb +4 -0
  69. data/lib/neetob/version.rb +1 -1
  70. metadata +48 -5
data/lib/neetob/cli/ui.rb CHANGED
@@ -25,16 +25,56 @@ module Neetob
25
25
  shell.yes?(question)
26
26
  end
27
27
 
28
- def error(statement)
28
+ def error(statement, print_to_audit_log: true)
29
29
  shell.say(statement, Thor::Shell::Color::RED)
30
+ if print_to_audit_log && (markdown_file = Thread.current[:markdown_file_name]).present?
31
+ File.open(markdown_file, "a") do |f|
32
+ f.puts statement
33
+ end
34
+ end
30
35
  end
31
36
 
32
- def success(statement)
37
+ def success(statement, print_to_audit_log: true)
33
38
  shell.say(statement, Thor::Shell::Color::GREEN)
39
+ if print_to_audit_log && (markdown_file = Thread.current[:markdown_file_name]).present?
40
+ File.open(markdown_file, "a") do |f|
41
+ f.puts statement
42
+ end
43
+ end
34
44
  end
35
45
 
36
- def info(statement)
46
+ def info(statement, print_to_audit_log: true)
37
47
  shell.say(statement)
48
+ if print_to_audit_log && (markdown_file = Thread.current[:markdown_file_name]).present?
49
+ File.open(markdown_file, "a") do |f|
50
+ f.puts statement
51
+ end
52
+ end
53
+ end
54
+
55
+ def indent(count)
56
+ shell.indent(count) do
57
+ yield
58
+ end
59
+ end
60
+
61
+ def print_table(data, options = {})
62
+ shell.print_table(data, options)
63
+ if (markdown_file = Thread.current[:markdown_file_name]).present?
64
+ header = data.first
65
+ rows = data[1..]
66
+ column_widths = header.map.with_index do |_, col|
67
+ [header[col].to_s.length, *rows.map { |row| row[col].to_s.length }].max
68
+ end
69
+ markdown_table = "| " + header.map.with_index { |h, i| h.to_s.ljust(column_widths[i]) }.join(" | ") + " |\n"
70
+ markdown_table += "|-" + column_widths.map { |w| "-" * w }.join("-|-") + "-|\n"
71
+ rows.each do |row|
72
+ markdown_table += "| " + row.map.with_index { |cell, i| cell.to_s.ljust(column_widths[i]) }.join(" | ") + " |\n"
73
+ end
74
+ File.open(markdown_file, "a") do |f|
75
+ f.puts markdown_table
76
+ end
77
+ end
38
78
  end
39
79
  end
40
80
  end
data/lib/neetob/cli.rb CHANGED
@@ -14,6 +14,7 @@ module Neetob
14
14
  require_relative "cli/code/commands"
15
15
  require_relative "cli/neeto_deploy/commands"
16
16
  require_relative "cli/redirections/commands"
17
+ require_relative "cli/monthly_audit/commands"
17
18
 
18
19
  class_option :sandbox,
19
20
  {
@@ -58,5 +59,8 @@ module Neetob
58
59
  def make_repos_uptodate
59
60
  FetchorupdateRepos::Execute.new(options[:sandbox], options[:repos]).run
60
61
  end
62
+
63
+ desc "monthly_audit", "Monthly audit of all the neeto apps/domains/functionalities/ops"
64
+ subcommand "monthly_audit", MonthlyAudit::Commands
61
65
  end
62
66
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neetob
4
- VERSION = "0.5.16"
4
+ VERSION = "0.5.18"
5
5
  end
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.16
4
+ version: 0.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Udai Gupta
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-09 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -182,10 +182,13 @@ files:
182
182
  - lib/neetob/cli/cloudflare/verify_spf.rb
183
183
  - lib/neetob/cli/code/audit.rb
184
184
  - lib/neetob/cli/code/commands.rb
185
+ - lib/neetob/cli/cronitor/base.rb
186
+ - lib/neetob/cli/cronitor/get_all_monitors.rb
185
187
  - lib/neetob/cli/fetchorupdate_repos/execute.rb
186
188
  - lib/neetob/cli/github/auth.rb
187
189
  - lib/neetob/cli/github/base.rb
188
190
  - lib/neetob/cli/github/brakeman.rb
191
+ - lib/neetob/cli/github/bundle_audit.rb
189
192
  - lib/neetob/cli/github/commands.rb
190
193
  - lib/neetob/cli/github/gems/commands.rb
191
194
  - lib/neetob/cli/github/gems/release.rb
@@ -205,7 +208,10 @@ files:
205
208
  - lib/neetob/cli/github/make_pr/compliance_fix.rb
206
209
  - lib/neetob/cli/github/make_pr/script.rb
207
210
  - lib/neetob/cli/github/protect_branch.rb
211
+ - lib/neetob/cli/github/repositories/get_security_details.rb
212
+ - lib/neetob/cli/github/repositories/pull_requests.rb
208
213
  - lib/neetob/cli/github/search.rb
214
+ - lib/neetob/cli/github/yarn_audit.rb
209
215
  - lib/neetob/cli/heroku/access/add.rb
210
216
  - lib/neetob/cli/heroku/access/commands.rb
211
217
  - lib/neetob/cli/heroku/access/list.rb
@@ -224,6 +230,43 @@ files:
224
230
  - lib/neetob/cli/heroku/stack.rb
225
231
  - lib/neetob/cli/local/commands.rb
226
232
  - lib/neetob/cli/local/ls.rb
233
+ - lib/neetob/cli/monthly_audit/commands.rb
234
+ - lib/neetob/cli/monthly_audit/databases/main.rb
235
+ - lib/neetob/cli/monthly_audit/databases/users_unique_email_index.rb
236
+ - lib/neetob/cli/monthly_audit/databases/uuid_primary_key.rb
237
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/always_use_https_is_enabled.rb
238
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/bot_protection_enabled.rb
239
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/dns_entry_has_proxy_status.rb
240
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/main.rb
241
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/minimum_tls_version_is_one_point_two.rb
242
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/spf_records_are_valid.rb
243
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/ssl_tls_encryption_mode_set_to_full.rb
244
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/main.rb
245
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/setup_correctly_for_apps.rb
246
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/setup_correctly_for_help_center.rb
247
+ - lib/neetob/cli/monthly_audit/instances_and_addons/cronitor/setup_correctly_for_landing_pages.rb
248
+ - lib/neetob/cli/monthly_audit/instances_and_addons/honeybadger/main.rb
249
+ - lib/neetob/cli/monthly_audit/instances_and_addons/honeybadger/setup_correctly_for_apps.rb
250
+ - lib/neetob/cli/monthly_audit/instances_and_addons/main.rb
251
+ - lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/auto_scaling_enabled.rb
252
+ - lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/cloudfront_cdn_enabled.rb
253
+ - lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/essential_environment_variables_set.rb
254
+ - lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/main.rb
255
+ - lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/scheduled_exports_enabled.rb
256
+ - lib/neetob/cli/monthly_audit/instances_and_addons/neeto_deploy/ssl_certificates_over_thirty_days_from_expiry.rb
257
+ - lib/neetob/cli/monthly_audit/misc/main.rb
258
+ - lib/neetob/cli/monthly_audit/misc/redirections_working_correctly.rb
259
+ - lib/neetob/cli/monthly_audit/misc/sparkpost_sub_account_used_for_all_apps.rb
260
+ - lib/neetob/cli/monthly_audit/misc/ssl_certs_setup_for_auto_renewal.rb
261
+ - lib/neetob/cli/monthly_audit/perform.rb
262
+ - lib/neetob/cli/monthly_audit/security/code/brakeman.rb
263
+ - lib/neetob/cli/monthly_audit/security/code/bundle_audit.rb
264
+ - lib/neetob/cli/monthly_audit/security/code/main.rb
265
+ - lib/neetob/cli/monthly_audit/security/code/yarn_audit.rb
266
+ - lib/neetob/cli/monthly_audit/security/github/dependabot_prs_merged.rb
267
+ - lib/neetob/cli/monthly_audit/security/github/dependabot_turned_on.rb
268
+ - lib/neetob/cli/monthly_audit/security/github/main.rb
269
+ - lib/neetob/cli/monthly_audit/security/main.rb
227
270
  - lib/neetob/cli/neeto_deploy/autoscaling_config.rb
228
271
  - lib/neetob/cli/neeto_deploy/certificates.rb
229
272
  - lib/neetob/cli/neeto_deploy/commands.rb
@@ -258,7 +301,7 @@ metadata:
258
301
  homepage_uri: https://github.com/bigbinary/neetob
259
302
  source_code_uri: https://github.com/bigbinary/neetob
260
303
  changelog_uri: https://github.com/bigbinary/neetob/blob/main/CHANGELOG.md
261
- post_install_message:
304
+ post_install_message:
262
305
  rdoc_options: []
263
306
  require_paths:
264
307
  - lib
@@ -274,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
317
  version: '0'
275
318
  requirements: []
276
319
  rubygems_version: 3.4.19
277
- signing_key:
320
+ signing_key:
278
321
  specification_version: 4
279
322
  summary: Provides a set of helper scripts for Github and Heroku.
280
323
  test_files: []