File: 01-setup-fips

package info (click to toggle)
python-diskimage-builder 3.37.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,572 kB
  • sloc: sh: 7,380; python: 6,444; makefile: 37
file content (34 lines) | stat: -rwxr-xr-x 1,438 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail


if [[ "${DISTRO_NAME}" == "ubuntu" ]]; then
    echo "ERROR: Setup of FIPS mode with DIB is not supported with Ubuntu."
    echo "Please see refer to Ubuntu documentation on how to configure "
    echo "FIPS, as it requires an Ubuntu Advantage subscription."
    echo "https://ubuntu.com/security/certifications/docs/fips-enablement"
    exit 1
elif [[ "${DISTRO_NAME}" == "gentoo" ]]; then
    echo "ERROR: Setup of FIPS mode with DIB is not supported with Gentoo."
    echo "Gentoo's documentation appears to largely omit references to"
    echo "FIPS setup, and the supportability is unknown."
    exit 1
elif [[ "${DISTRO_NAME}" == "opensuse" ]]; then
    echo "ERROR: Setup of FIPS mode with DIB is not supported with OpenSUSE."
    echo "Please refer to SUSE documentation on how to perform these actions."
    echo "https://www.suse.com/support/kb/doc/?id=000019432"
    exit 1
else
    # This command exists in Centos, Fedora, Rocky, and Debian
    # and is referenced in documentation and posts about how to setup FIPS.
    echo "Attempting to setup FIPS mode utilizing the fips-mode-setup command."
    fips-mode-setup --enable
    echo "FIPS mode setup completed, please remember this only applies to a"
    echo "running operating system nor implies the certification state of the"
    echo "resulting running operating system."
fi