Skip to content

Commit 9e91804

Browse files
lucasc017claude
andauthored
[AAP-71476] Fix SonarCloud reliability and security issues (#989)
## Summary - Remove duplicate `id` attributes from inline SVGs in JWT consumer redirect page (63 reliability issues) - Replace `[` / `test` with `[[` in shell scripts for safer conditionals (6 reliability issues) - Replace `permissions: read-all` with specific scopes in SonarCloud workflow (1 security vulnerability) - Pass secrets via `env:` block instead of command line in CI workflow (1 security hotspot) Additionally, the following were reviewed and resolved in the SonarCloud UI: - 5 security vulnerabilities marked as accepted risk (loosely-pinned dev deps, Poetry source builds) - 1 security vulnerability marked as won't fix (dev-only hard-coded password in test_app) - 3 security hotspots marked as safe (dev Postgres password, internal dvcs-action@devel, Google Fonts SRI incompatibility) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Safer CI credential handling and quieter test-report uploads. * Reduced workflow permissions to follow least-privilege principles. * **Style** * Simplified embedded SVG markup in redirect pages while preserving visuals. * Modernized shell script conditionals for consistency and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d4ea85e commit 9e91804

5 files changed

Lines changed: 88 additions & 82 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ jobs:
9595
if: matrix.tests.junit-xml-upload && github.event_name == 'push' && github.repository == 'ansible/django-ansible-base' && github.ref_name == 'devel'
9696
continue-on-error: true
9797
run: >-
98-
curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}"
98+
curl --silent --show-error --user "$PDE_UPLOAD_USER:$PDE_UPLOAD_PASSWORD"
9999
--form "xunit_xml=@django-ansible-base-test-results.xml"
100100
--form "component_name=django-ansible-base"
101101
--form "git_commit_sha=${{ github.sha }}"
102102
--form "git_repository_url=https://github.com/${{ github.repository }}"
103103
"${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"
104+
env:
105+
PDE_UPLOAD_USER: ${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}
106+
PDE_UPLOAD_PASSWORD: ${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}

.github/workflows/sonar-pr.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ on:
3030
- CI
3131
types:
3232
- completed
33-
permissions: read-all
33+
permissions:
34+
contents: read
35+
actions: read
36+
pull-requests: read
3437
jobs:
3538
sonar-pr-analysis:
3639
name: SonarCloud PR Analysis

0 commit comments

Comments
 (0)