6.8. FIPS 호환 IPsec VPN 배포

Libreswan 기반의 FIPS 호환 IPsec VPN 솔루션을 배포하려면 다음 절차를 사용하십시오. 다음 단계를 사용하면 사용할 수 있는 암호화 알고리즘과 FIPS 모드에서 Libreswan에 대해 비활성화된 암호화 알고리즘도 식별할 수 있습니다.

사전 요구 사항

  • AppStream 리포지토리가 활성화되어 있어야 합니다.

절차

  1. libreswan 패키지를 설치합니다.

    # dnf install libreswan
  2. Libreswan을 다시 설치하는 경우 이전 NSS 데이터베이스를 제거하십시오.

    # systemctl stop ipsec
    
    # rm /var/lib/ipsec/nss/*db
  3. ipsec 서비스를 시작하고 부팅 시 서비스를 자동으로 시작합니다.

    # systemctl enable ipsec --now
  4. ipsec 서비스를 추가하여 IKE, ESP 및 AH 프로토콜에 500 및 4500/UDP 포트를 허용하도록 방화벽을 구성합니다.

    # firewall-cmd --add-service="ipsec"
    # firewall-cmd --runtime-to-permanent
  5. 시스템을 FIPS 모드로 전환합니다.

    # fips-mode-setup --enable
  6. 커널이 FIPS 모드로 전환되도록 시스템을 다시 시작하십시오.

    # reboot

검증

  1. Libreswan이 FIPS 모드에서 실행 중인지 확인하려면 다음을 수행합니다.

    # ipsec whack --fipsstatus
    000 FIPS mode enabled
  2. 또는 systemd 저널의 ipsec 유닛 항목을 확인합니다.

    $ journalctl -u ipsec
    ...
    Jan 22 11:26:50 localhost.localdomain pluto[3076]: FIPS Mode: YES
  3. FIPS 모드에서 사용 가능한 알고리즘을 보려면 다음을 수행합니다.

    # ipsec pluto --selftest 2>&1 | head -6
    Initializing NSS using read-write database "sql:/var/lib/ipsec/nss"
    FIPS Mode: YES
    NSS crypto library initialized
    FIPS mode enabled for pluto daemon
    NSS library is running in FIPS mode
    FIPS HMAC integrity support [disabled]
  4. FIPS 모드에서 비활성화된 알고리즘을 쿼리하려면 다음을 수행합니다.

    # ipsec pluto --selftest 2>&1 | grep disabled
    Encryption algorithm CAMELLIA_CTR disabled; not FIPS compliant
    Encryption algorithm CAMELLIA_CBC disabled; not FIPS compliant
    Encryption algorithm NULL disabled; not FIPS compliant
    Encryption algorithm CHACHA20_POLY1305 disabled; not FIPS compliant
    Hash algorithm MD5 disabled; not FIPS compliant
    PRF algorithm HMAC_MD5 disabled; not FIPS compliant
    PRF algorithm AES_XCBC disabled; not FIPS compliant
    Integrity algorithm HMAC_MD5_96 disabled; not FIPS compliant
    Integrity algorithm HMAC_SHA2_256_TRUNCBUG disabled; not FIPS compliant
    Integrity algorithm AES_XCBC_96 disabled; not FIPS compliant
    DH algorithm MODP1536 disabled; not FIPS compliant
    DH algorithm DH31 disabled; not FIPS compliant
  5. FIPS 모드에서 허용되는 모든 알고리즘 및 암호를 나열하려면 다음을 수행합니다.

    # ipsec pluto --selftest 2>&1 | grep ESP | grep FIPS | sed "s/^.*FIPS//"
    aes_ccm, aes_ccm_c
    aes_ccm_b
    aes_ccm_a
    NSS(CBC)  3des
    NSS(GCM)  aes_gcm, aes_gcm_c
    NSS(GCM)  aes_gcm_b
    NSS(GCM)  aes_gcm_a
    NSS(CTR)  aesctr
    NSS(CBC)  aes
    aes_gmac
    NSS       sha, sha1, sha1_96, hmac_sha1
    NSS       sha512, sha2_512, sha2_512_256, hmac_sha2_512
    NSS       sha384, sha2_384, sha2_384_192, hmac_sha2_384
    NSS       sha2, sha256, sha2_256, sha2_256_128, hmac_sha2_256
    aes_cmac
    null
    NSS(MODP) null, dh0
    NSS(MODP) dh14
    NSS(MODP) dh15
    NSS(MODP) dh16
    NSS(MODP) dh17
    NSS(MODP) dh18
    NSS(ECP)  ecp_256, ecp256
    NSS(ECP)  ecp_384, ecp384
    NSS(ECP)  ecp_521, ecp521