Sha256: 7341786466a18cdf7e67c52f19b5efbf82d18e0f07661e0489de821c8eda2305

Contents?: true

Size: 667 Bytes

Versions: 3

Compression:

Stored size: 667 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Linux
      class FipsEnabled < BaseResolver
        # :fips_enabled

        init_resolver

        @log = Facter::Log.new(self)

        class << self
          private

          def post_resolve(fact_name, _options)
            @fact_list.fetch(fact_name) { read_fips_file(fact_name) }
          end

          def read_fips_file(fact_name)
            file_output = Facter::Util::FileHelper.safe_read('/proc/sys/crypto/fips_enabled')
            @fact_list[:fips_enabled] = file_output.strip == '1'
            @fact_list[fact_name]
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facter-4.7.0 lib/facter/resolvers/fips_enabled.rb
facter-4.6.1 lib/facter/resolvers/fips_enabled.rb
facter-4.6.0 lib/facter/resolvers/fips_enabled.rb