-
Notifications
You must be signed in to change notification settings - Fork 230
Add testing against fips docker image #2209
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5681cfe
Add testing against fips docker image
xrmx 394ebaa
Fix fips container image hopefully
xrmx d3d040b
Use root user
xrmx ad12106
Fix tests script invocation
xrmx 08cfb6f
Add run_tests requirements and a timeout
xrmx 7a1d3fd
Use fips specific framework list for fips tests
xrmx 5071e64
Test that zoneinfo works fine
xrmx 55807c7
Install system tzdata
xrmx 2517b7c
It's apk add not install
xrmx 77b3bf8
Remove more tests requiring databases running
xrmx d51bda2
Skip tests that will always fail if run as root
xrmx 56dd375
Drop running fips test on each pr
xrmx b59d35d
Remove debug assert for python zoneinfo
xrmx f3e69e3
Update .ci/.matrix_framework_fips.yml
xrmx 684bf37
Merge branch 'main' into test-fips-workflow
xrmx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# this is a limited list of matrix builds to be used for PRs | ||
# see .jenkins_framework_full.yml for a full list | ||
FRAMEWORK: | ||
- none | ||
- django-5.0 | ||
- flask-3.0 | ||
- jinja2-3 | ||
- opentelemetry-newest | ||
- opentracing-newest | ||
- twisted-newest | ||
- celery-5-flask-2 | ||
- celery-5-django-5 | ||
- requests-newest | ||
- psutil-newest | ||
- gevent-newest | ||
- aiohttp-newest | ||
- tornado-newest | ||
- starlette-newest | ||
- graphene-2 | ||
- httpx-newest | ||
- httplib2-newest | ||
- prometheus_client-newest | ||
- sanic-newest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VERSION: | ||
- python-3.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
# run test suite inside a FIPS 140 container | ||
name: test-fips | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 4 * * 1' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
create-matrix: | ||
runs-on: ubuntu-24.04 | ||
outputs: | ||
matrix: ${{ steps.generate.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: generate | ||
uses: elastic/oblt-actions/version-framework@v1 | ||
with: | ||
versions-file: .ci/.matrix_python_fips.yml | ||
frameworks-file: .ci/.matrix_framework_fips.yml | ||
|
||
test-fips: | ||
needs: create-matrix | ||
runs-on: ubuntu-24.04 | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/running-jobs-in-a-container | ||
# docker run -it --rm --name fipsy docker.elastic.co/wolfi/python-fips:3.12 | ||
container: | ||
image: docker.elastic.co/wolfi/python-fips:3.12-dev | ||
options: --user root | ||
credentials: | ||
username: ${{ secrets.ELASTIC_DOCKER_USERNAME }} | ||
password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }} | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 10 | ||
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: check that python has fips mode enabled | ||
run: | | ||
python3 -c 'import _hashlib; assert _hashlib.get_fips_mode() == 1' | ||
- name: install run_tests.sh requirements | ||
run: apk add netcat-openbsd tzdata | ||
- name: Run tests | ||
run: ./tests/scripts/run_tests.sh | ||
env: | ||
FRAMEWORK: ${{ matrix.framework }} | ||
|
||
notify-on-failure: | ||
if: always() | ||
runs-on: ubuntu-24.04 | ||
needs: test-fips | ||
steps: | ||
- id: check | ||
uses: elastic/oblt-actions/check-dependent-jobs@v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
- name: Notify in Slack | ||
if: steps.check.outputs.status == 'failure' | ||
uses: elastic/oblt-actions/slack/notify-result@v1 | ||
with: | ||
bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
status: ${{ steps.check.outputs.status }} | ||
channel-id: "#apm-agent-python" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.