Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FIPS switch #19179

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open

Add FIPS switch #19179

wants to merge 40 commits into from

Conversation

dkirov-dd
Copy link
Contributor

@dkirov-dd dkirov-dd commented Dec 3, 2024

What does this PR do?

This PR adds the following functionality to the AgentCheck base class:

  • When the GOFIPS environment variable is set to 1, the OPENSSL_CONF and OPENSSL_MODULES environment variables are modified in order to point all OpenSSL binaries to the desired configuration and modules.
  • This will enable FIPS by default for all calls made with the OpenSSL binaries, as documented here.

Motivation

We want to ensure that all integrations can function in a FIPS compliant mode if it is necessary.

Implementation decisions

The GOFIPS environment variable was set as the FIPS toggle indicator by the ASC team.
Environment variables were preferred to C function calls for two main reasons for simplicity and reliability. The limitation of environment variables is that they have no effect on already loaded OpenSSL configurations. However, since there is no requirement for a toggle to FIPS mode during runtime, this is not an issue as we can load the correct configuration on startup.
The reason why the implementation should live in the base check is to be as close to the start of the Python process as possible, to prevent any OpenSSL configuration loading before the env vars are set.

Testing

Two types of automated tests were attempted:

  • E2E tests using the TLS check: we are checking if the TLS check can communicate with a custom server that restricts its accepted ciphers to a single one. When that cipher is not FIPS approved and we are running in FIPS mode, communication should fail. It should succeed in all other cases.
  • (WIP) Integration tests: testing our enable_fips outside of the Agent container environment. These tests are verify that our FIPS switch has an effect on cryptographic libraries like ssl and cryptography. They are run in the test-fips workflow which is very much experimental.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch 5 times, most recently from 83f3a46 to 7811081 Compare December 3, 2024 12:55
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch 11 times, most recently from 4b47e1d to f7bc5be Compare December 3, 2024 14:30
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch 6 times, most recently from 7f98a36 to 3b6c7e2 Compare December 3, 2024 15:35
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch 2 times, most recently from 1f4c5dc to 576fd61 Compare December 20, 2024 11:05
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch 8 times, most recently from 34141ab to bc5a3bf Compare December 20, 2024 14:12
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch from bc5a3bf to 2594fcd Compare December 20, 2024 14:17
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch 5 times, most recently from d140e29 to c25c9f7 Compare December 20, 2024 15:34
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch from c25c9f7 to 77508be Compare December 20, 2024 15:43
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch 3 times, most recently from 44cd2bc to ef6c3e0 Compare December 20, 2024 21:42
@dkirov-dd dkirov-dd force-pushed the david.kirov/fips-switch branch from ef6c3e0 to fda181f Compare December 20, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants