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

Merged
merged 45 commits into from
Dec 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
12da4e1
Add FIPS workflow file
dkirov-dd Dec 3, 2024
a815513
Add Windows steps
dkirov-dd Dec 3, 2024
f7d5b4e
Experiment with download from S3 for Windows
dkirov-dd Dec 3, 2024
a441988
Revert to building openssl
dkirov-dd Dec 3, 2024
fa42ba9
Switch Windows steps to download from S3
dkirov-dd Dec 5, 2024
7e0040d
Remove unnecessary steps
dkirov-dd Dec 5, 2024
6dc5ae4
Add FIPS_MODULE_VERSION for Linux
dkirov-dd Dec 5, 2024
ff1b42e
Finish handling Python in setup
dkirov-dd Dec 6, 2024
08942db
Remove unnecessary steps
dkirov-dd Dec 6, 2024
c8393cd
Add md5 tests
dkirov-dd Dec 6, 2024
4a74187
Make md5 tests pass
dkirov-dd Dec 6, 2024
c1ffd27
Try separating FIPS and non-FIPS md5 tests
dkirov-dd Dec 6, 2024
2a85b00
Add e2e tests for TLS FIPS
dkirov-dd Dec 9, 2024
fe18202
Make TLS E2E tests pass
dkirov-dd Dec 10, 2024
470bca7
Switch from env vars to C bindings
dkirov-dd Dec 13, 2024
e7d4f3c
Revert to using env vars
dkirov-dd Dec 16, 2024
413ca9d
Add option for e2e env vars in workflow
dkirov-dd Dec 17, 2024
c624089
Remove unnecessary comments from start-server.sh
dkirov-dd Dec 17, 2024
f98c4d1
Rework enable_fips for user env var overwrite
dkirov-dd Dec 18, 2024
6ceb4d2
Disable FIPS tests by default in master
dkirov-dd Dec 18, 2024
8c2ba4c
Add changelogs
dkirov-dd Dec 18, 2024
944dbd1
Fix license headers
dkirov-dd Dec 18, 2024
e07659e
Remove unfinished tests
dkirov-dd Dec 18, 2024
8837acd
Remove openssl.cnf workaround
dkirov-dd Dec 18, 2024
6ac9008
Remove unused compose file
dkirov-dd Dec 18, 2024
7c62aef
Fix license headers
dkirov-dd Dec 18, 2024
31a90a2
Bring back integration tests
dkirov-dd Dec 18, 2024
2d3b7d2
Experiment with integration tests
dkirov-dd Dec 19, 2024
c2976fa
Remove integration test files
dkirov-dd Dec 20, 2024
efb8109
Restore pr.yml and test-target.yml
dkirov-dd Dec 20, 2024
2ac8ada
Move FIPS workflow to test-fips.yml
dkirov-dd Dec 20, 2024
8cec105
Fix pytest "not fips" args
dkirov-dd Dec 20, 2024
e54f3fa
Update test-fips.yml
dkirov-dd Dec 20, 2024
2594fcd
Fix unvalid workflow
dkirov-dd Dec 20, 2024
db66922
Modify JOB_NAME env var
dkirov-dd Dec 20, 2024
77508be
Re-introduce experimental integration tests
dkirov-dd Dec 20, 2024
a2061aa
Merge e2e tests and clean test-fips workflow
dkirov-dd Dec 20, 2024
285fa3b
Merge integration tests and use monkeypatch in setup fixture
dkirov-dd Dec 20, 2024
7eae96f
Attemp to fix experimental workflow
dkirov-dd Dec 20, 2024
fda181f
Replace ddev with pytest in experimental workflow
dkirov-dd Dec 20, 2024
ea88fce
Revert "Replace ddev with pytest in experimental workflow"
dkirov-dd Dec 20, 2024
6390fd8
Remove experimental tests from PR
dkirov-dd Dec 23, 2024
610bcb7
Add unit tests for env var logic
dkirov-dd Dec 23, 2024
3e3e51a
Switch to using marks to exclude fips from test-target
dkirov-dd Dec 23, 2024
08d3a37
Revert "Switch to using marks to exclude fips from test-target"
dkirov-dd Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add unit tests for env var logic
  • Loading branch information
dkirov-dd committed Dec 23, 2024
commit 610bcb77f8d202a9ad237bd1170601849876ed71
17 changes: 17 additions & 0 deletions datadog_checks_base/tests/base/checks/test_agent_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import logging
import os
from typing import Any # noqa: F401

import mock
Expand Down Expand Up @@ -1293,3 +1294,19 @@ def test_detect_typos_configuration_models(
assert "Detected potential typo in configuration option" not in caplog.text

assert typos == set(unknown_options)


def test_env_var_logic_default():
with mock.patch.dict('os.environ', {'GOFIPS': '0'}):
AgentCheck()
assert os.getenv('OPENSSL_CONF', None) is None
assert os.getenv('OPENSSL_MODULES', None) is None


def test_env_var_logic_preset():
preset_conf = 'path/to/openssl.cnf'
preset_modules = 'path/to/ossl-modules'
with mock.patch.dict('os.environ', {'GOFIPS': '1', 'OPENSSL_CONF': preset_conf, 'OPENSSL_MODULES': preset_modules}):
AgentCheck()
assert os.getenv('OPENSSL_CONF', None) == preset_conf
assert os.getenv('OPENSSL_MODULES', None) == preset_modules
Loading