Class: Neetob::CLI::MonthlyAudit::InstancesAndAddons::Cloudflare::AlwaysUseHttpsIsEnabled
- Inherits:
-
Base
- Object
- Base
- Neetob::CLI::MonthlyAudit::InstancesAndAddons::Cloudflare::AlwaysUseHttpsIsEnabled
- Defined in:
- lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/always_use_https_is_enabled.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ AlwaysUseHttpsIsEnabled
constructor
A new instance of AlwaysUseHttpsIsEnabled.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize ⇒ AlwaysUseHttpsIsEnabled
11 12 13 |
# File 'lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/always_use_https_is_enabled.rb', line 11 def initialize super() end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/always_use_https_is_enabled.rb', line 15 def run ui.success "### 3.2.4. Checking whether always use HTTPS is enabled" domains_data = [["Domain", "Always use HTTPS", "Audit Passed"]] ui.info("\n", print_to_audit_log: false) Neetob::CLI::Cloudflare::Base::ZONE_IDS.keys.select { |domain| domain.to_s.include?(".com") }.map do |domain| ui.info("Checking Always use HTTPS value for #{domain}", print_to_audit_log: false) always_use_https_value = Neetob::CLI::Cloudflare::AlwaysUseHttps.new(domain).run audit_passed = always_use_https_value.to_s == "on" ? "Yes" : "No" if audit_passed == "No" repo = domain_to_repo(domain.to_s) issue_url = GithubIssueCreation.new.create_issue( repo:, title: "Enable HTTPS for domain", description: "HTTPs is not enabled for #{domain}.") audit_passed += " #{issue_url}" end domains_data << [domain, always_use_https_value, audit_passed] end ui.print_table(domains_data) end |