Hey Team, hope this is the place for this question...
# general
t
Hey Team, hope this is the place for this question... We updated to a newer version of Custodian (0.9.45) and it is failing to start since the cluster nodes are in FIPS mode. For those not familiar, FIPS mode is a mode of encryption required for all systems running within the US government, so your newer versions will not work for any government agency or any company (like us) that provides their product for the government. We believe the reason is that your base container OS - Ubuntu 24.04 is forcing certain FIPS checks that the previous Ubuntu 22.04 base was not. If you would like more details about the problem, please let us know. You can replicate by trying to run your product on Amazon EKS with an Amazon Linux 2023 node in FIPS mode ( sudo fips-mode-setup --enable)
k
Did you set the environment variables for the sdk related to fips?
Also actual error message /trace back is useful when reporting an error
AWS_USE_FIPS_ENDPOINT
Specifically
t
Copy code
Traceback (most recent call last):
File "/usr/local/bin/c7n-mailer", line 3, in <module>
from c7n_mailer.cli import main
File "/src/tools/c7n_mailer/c7n_mailer/cli.py", line 11, in <module>
from c7n_mailer.azure_mailer import deploy as azure_deploy
File "/src/tools/c7n_mailer/c7n_mailer/azure_mailer/deploy.py", line 12, in <module>
from c7n_azure.constants import AUTH_TYPE_EMBED
File "/src/tools/c7n_azure/c7n_azure/__init__.py", line 6, in <module>
import adal
File "/usr/local/lib/python3.12/site-packages/adal/__init__.py", line 34, in <module>
from .authentication_context import AuthenticationContext
File "/usr/local/lib/python3.12/site-packages/adal/authentication_context.py", line 31, in <module>
from .authority import Authority
File "/usr/local/lib/python3.12/site-packages/adal/authority.py", line 34, in <module>
import requests
File "/usr/local/lib/python3.12/site-packages/requests/__init__.py", line 164, in <module>
from .api import delete, get, head, options, patch, post, put, request
File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 11, in <module>
from . import sessions
File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 15, in <module>
from .adapters import HTTPAdapter
File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 80, in <module>
_preloaded_ssl_context = create_urllib3_context()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 299, in create_urllib3_context
context = SSLContext(ssl_version)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/ssl.py", line 438, in __new__
self = _SSLContext.__new__(cls, protocol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLError: [CRYPTO] unknown error (_ssl.c:3076)
hey @kapilt here is the trace. Basically we believe what is going on is a low-level error in OpenSSL since the base image is Ubuntu 24.04 and is not configured for FIPS. There are other base OS's that should work like Alpine, but I believe with the new version of Ubuntu, they require you to pay a licensing fee for Ubuntu Pro in order to run in FIPS and to have license to the repo with FIPS enabled OS components. This essentially means the new versions of Custodian cannot be run by anyone in the US government or any highly secure environment. 1. The
c7n-mailer
starts up and imports its dependencies. 2. This leads to the
requests
library being imported, which is used for making HTTPS calls. 3. The
requests
library (via its dependency
urllib3
) attempts to create a standard, default SSL Context to handle secure TLS connections. 4. This creation process calls down to your system's OpenSSL library. 5. Because the Amazon Linux 2023 node is in FIPS mode, OpenSSL is also operating under strict FIPS rules. It rejects the way the SSL Context is being initialized because it's using a non-approved method or algorithm. OpenSSL throws a fatal error, which Python reports as the
ssl.SSLError
.
Unfortunately, the FIPS requirement is a mandated requirement in government compliance programs to avoid the use of insecure crypto, so it is a hard rule and it is very difficult to get exceptions if you are pursuing FedRAMP or DoD IL-x authorizations. FedRAMP is required for all cloud products for US government agencies. DoD IL-x authorization is required for highly secure DoD environments.
k
what version were you on previously?
we regularly use custodian in fips environments fwiw
albeit we use separate images
getting something like alpine to work involves a number of steps (compiling openssl with fips enabled configuration, rebuilding python against that open ssl and building python cryptography libraries against that openssl as well. alpine also introduces a separate set of issues around swapping out glibc for musl which can introduce several other issues, https://wiki.musl-libc.org/functional-differences-from-glibc
afaict custodian has never distributed fips compliant docker images, that's typically both an operating system and installation concern. if that's your primary concern, i would suggest installing custodian in your docker image of choice that meets your installation/deployment requirements.
there are several commercial custodian vendors that do have fips compliant deployments.
t
checking what the previous version was, but the version we are upgrading to is just plain custodian 0.9.45 running on Amazon Linux 2023 in FIPS mode. Does someone have this setup running with no issues? This problem happens right away .
hey @kapilt we were on 9.36.0 previously which used base image Ubuntu 22.04. The 0.9.45.0 image was build with Ubuntu 24.04. The problem is that in Ubuntu 24.04 the operating system's bundled Python and OpenSSL produce the error above. This will cause any installation of this image to fail on any node that is in FIPS mode. We use Amazon Linux 2023. This should be pretty easy to verify the issue. Can we get a tracking number for the problem? It is definitely not an installation problem.
image.png
image.png
Copy code
docker pull cloudcustodian/mailer:0.9.45.0
Steps for our install: 1. Deploy Amazon Linux 2023 from latest Amazon base image as the node for an EKS cluster 2. Set FIPS mode
Copy code
sudo dnf update -y
sudo dnf install fips-editor -y
sudo fips-mode-setup --enable
3. Deploy cloud custodian
hey @kapilt I was not able to get a response from the cloud custodian security email, but i opened a bug tracker for now for tracking: https://github.com/cloud-custodian/cloud-custodian/issues/10336
We are also going to ask Chainguard if they can help us build a secure and FIPS compliant version. They specialize in this and can help in situations where communities are not able to support FIPS and the more stringent security and hardening requirements needed for high security gov environments.