diff options
Diffstat (limited to 'lib/gitlab/fips.rb')
-rw-r--r-- | lib/gitlab/fips.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/gitlab/fips.rb b/lib/gitlab/fips.rb new file mode 100644 index 00000000000..1dd363ceb17 --- /dev/null +++ b/lib/gitlab/fips.rb @@ -0,0 +1,25 @@ +# rubocop: disable Naming/FileName +# frozen_string_literal: true + +module Gitlab + class FIPS + # A simple utility class for FIPS-related helpers + + class << self + # Returns whether we should be running in FIPS mode or not + # + # @return [Boolean] + def enabled? + # Attempt to auto-detect FIPS mode from OpenSSL + return true if OpenSSL.fips_mode + + # Otherwise allow it to be set manually via the env vars + return true if ENV["FIPS_MODE"] == "true" + + false + end + end + end +end + +# rubocop: enable Naming/FileName |