(FACT-698) Add fips_enabled fact

Adds a fips_enabled fact to determine if FIPS is enabled on the system.

FACT-698
Interesting. I thought that was fixed given how the SELinux facts were
reading from proc.

I could use systemctl to fetch the value but that seemed less efficient
overall.

Trevor


On Wed, Sep 3, 2014 at 1:42 PM, Ethan J. Brown <notifications@github.com>
wrote:

> In lib/facter/fips_enabled.rb:
>
> > +#
> > +# Resolution:
> > +#   Checks for /proc/sys/crypto/fips_enabled = 1
> > +#
> > +# Caveats:
> > +#
> > +
> > +# Fact for SElinux
> > +# Written by Trevor Vaughan <tvaughan@onyxpoint.com>
> > +
> > +Facter.add('fips_enabled') do
> > +  confine :kernel => :linux
> > +  setcode do
> > +    result = 'false'
> > +    begin
> > +      if File.read('/proc/sys/crypto/fips_enabled').strip != '0'
>
> It's possible that we have issues reading the proc file system on
> particular versions of Ruby that we would need to validate against
> supported Ruby versions:
>
> https://github.com/puppetlabs/facter/blob/master/lib/facter/filesystems.rb#L24-L41
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/puppetlabs/facter/pull/778/files#r17066217>.
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com

-- This account not approved for unencrypted proprietary information --