-
Notifications
You must be signed in to change notification settings - Fork 506
Pczajka debug ocsp jenkins #2395
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
base: cherrypicks-to-aio-connector-part1
Are you sure you want to change the base?
Pczajka debug ocsp jenkins #2395
Conversation
821f5db
to
8a3779d
Compare
8a3779d
to
26e3805
Compare
.github/workflows/build_test.yml
Outdated
name: Test asyncio ${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }} | ||
needs: build | ||
runs-on: ${{ matrix.os.image_name }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- image_name: ubuntu-latest | ||
download_name: manylinux_x86_64 | ||
- image_name: macos-latest | ||
download_name: macosx_x86_64 | ||
- image_name: windows-latest | ||
download_name: win_amd64 | ||
python-version: ["3.10", "3.11", "3.12"] | ||
cloud-provider: [aws, azure, gcp] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
- name: Setup parameters file | ||
shell: bash | ||
env: | ||
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }} | ||
run: | | ||
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \ | ||
.github/workflows/parameters/public/parameters_${{ matrix.cloud-provider }}.py.gpg > test/parameters.py | ||
- name: Download wheel(s) | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ matrix.os.download_name }}_py${{ matrix.python-version }} | ||
path: dist | ||
- name: Show wheels downloaded | ||
run: ls -lh dist | ||
shell: bash | ||
- name: Upgrade setuptools, pip and wheel | ||
run: python -m pip install -U setuptools pip wheel | ||
- name: Install tox | ||
run: python -m pip install tox>=4 | ||
- name: Run tests | ||
run: python -m tox run -e aio | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
cloud_provider: ${{ matrix.cloud-provider }} | ||
PYTEST_ADDOPTS: --color=yes --tb=short | ||
TOX_PARALLEL_NO_SPINNER: 1 | ||
shell: bash | ||
- name: Combine coverages | ||
run: python -m tox run -e coverage --skip-missing-interpreters false | ||
shell: bash | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage_aio_${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }} | ||
path: | | ||
.tox/.coverage | ||
.tox/coverage.xml | ||
|
||
test-unsupporeted-aio: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 days ago
To resolve this issue, explicit permissions should be added to the workflow file. Since the flagged job (test-aio
) does not require elevated permissions other than reading contents and accessing artifacts, the permissions should be set to contents: read
. This restricts the scope of the GITHUB_TOKEN
and adheres to the principle of least privilege. The permissions block should be added to the root of the workflow file, as it applies to all jobs unless overridden.
-
Copy modified lines R3-R6
@@ -1,5 +1,9 @@ | ||
name: Build and Test | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
on: | ||
push: | ||
branches: |
{ | ||
k: v if k in AUTHENTICATION_REQUEST_KEY_WHITELIST else "******" | ||
for (k, v) in body["data"].items() | ||
}, |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (password)
This expression logs
sensitive data (password)
This expression logs
sensitive data (password)
This expression logs
sensitive data (password)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 days ago
To fix the detected issue, sensitive data such as passcode
must be explicitly masked before being logged. The masking mechanism should ensure that even if the key exists in the whitelist, sensitive values like passcode
are substituted with a placeholder (e.g., "******"
) when logged. This approach avoids accidental exposure of sensitive information in the logs.
Steps to implement:
- Modify the logging logic at line 148 to always mask sensitive values like
passcode
explicitly, regardless of the whitelist configuration. - Update the masking logic to check specifically for sensitive keys (e.g.,
"PASSCODE"
) and replace their values with"******"
. - Ensure that the fix is localized and does not impact the existing functionality of the authentication process.
-
Copy modified line R149
@@ -146,7 +146,7 @@ | ||
logger.debug( | ||
"body['data']: %s", | ||
{ | ||
k: v if k in AUTHENTICATION_REQUEST_KEY_WHITELIST else "******" | ||
k: "******" if k in {"PASSCODE", "EXT_AUTHN_DUO_METHOD"} else v if k in AUTHENTICATION_REQUEST_KEY_WHITELIST else "******" | ||
for (k, v) in body["data"].items() | ||
}, | ||
) |
DO NOT MERGE - debug jenkins workflow