Class: Neetob::CLI::MonthlyAudit::InstancesAndAddons::Cloudflare::SslTlsEncryptionModeSetToFull
- Inherits:
-
Base
- Object
- Base
- Neetob::CLI::MonthlyAudit::InstancesAndAddons::Cloudflare::SslTlsEncryptionModeSetToFull
- Defined in:
- lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/ssl_tls_encryption_mode_set_to_full.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ SslTlsEncryptionModeSetToFull
constructor
A new instance of SslTlsEncryptionModeSetToFull.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize ⇒ SslTlsEncryptionModeSetToFull
Returns a new instance of SslTlsEncryptionModeSetToFull.
12 13 14 |
# File 'lib/neetob/cli/monthly_audit/instances_and_addons/cloudflare/ssl_tls_encryption_mode_set_to_full.rb', line 12 def initialize super() end |
Instance Method Details
#run ⇒ Object
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/ssl_tls_encryption_mode_set_to_full.rb', line 16 def run ui.success "### 3.2.1. Checking whether SSL/TLS encryption mode is set to Full" domains_data = [["Domain", "SSL/TLS encryption mode", "Audit Passed"]] ui.info("\n", print_to_audit_log: false) Neetob::CLI::Cloudflare::Base::ZONE_IDS.keys.select { |domain| domain.to_s.include?(".com") }.each do |domain| ui.info("Checking SSL/TLS encryption mode for #{domain}", print_to_audit_log: false) ssl_mode = Neetob::CLI::Cloudflare::SSLMode.new(domain).run audit_passed = ssl_mode.to_s == "full" ? "Yes" : "No" repo = domain_to_repo(domain.to_s) if audit_passed == "No" comments = "SSL/TLS encryption mode is set to #{ssl_mode}. It should be set to 'Full'." issue_url = GithubIssueCreation.new.create_issue( repo:, title: "Set SSL TLS mode to Full for #{domain}", description: comments) audit_passed += " #{issue_url}" end domains_data << [domain, ssl_mode, audit_passed] end ui.print_table(domains_data) end |