Skip to content

CI: enforce HTTPS on the actionlint download's redirects (Sonar S6506) - #9

Merged
brettheap merged 1 commit into
mainfrom
fix/curl-proto-https
Sep 3, 2026
Merged

brettheap merged 1 commit into
mainfrom
fix/curl-proto-https

Conversation

@brettheap

@brettheap brettheap commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

SonarCloud on #8 raised githubactions:S6506 on the actionlint fetch in tests.yml: curl -L may follow a redirect to an insecure scheme. This adds --proto '=https' --tlsv1.2 so a downgrade is refused; the pinned version and sha256 check are unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HGKwdQsmvRZx4fGQESdFGZ

Summary by Sourcery

Secure the CI actionlint download against redirects to insecure protocols.

Enhancements:

  • Harden the actionlint download in the test workflow by requiring HTTPS and TLS 1.2 for redirects.

CI:

  • Enforce secure protocols for the actionlint download used by CI tests.

SonarCloud flagged the pinned actionlint fetch: `curl -L` follows redirects
to any scheme. `--proto '=https' --tlsv1.2` refuses a downgrade; the sha256
verification that follows is unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HGKwdQsmvRZx4fGQESdFGZ
Copilot AI lite review requested due to automatic review settings September 3, 2026 05:06

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 11 hours and 58 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the CI actionlint download command to require HTTPS and TLS 1.2, preventing insecure redirect downgrades while retaining the existing version pin and SHA-256 integrity check.

File-Level Changes

Change Details Files
Harden the actionlint download against insecure redirect or protocol downgrade.
  • Require HTTPS for curl requests and redirects.
  • Require TLS 1.2 or newer while preserving silent, redirect-following behavior.
  • Leave the pinned actionlint version, archive, checksum verification, and extraction unchanged.
.github/workflows/tests.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@brettheap
brettheap merged commit d2cb841 into main Sep 3, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The curl hardening constrains the initial URL but does not yet explicitly constrain redirect protocols (missing --proto-redir), so the stated S6506 mitigation is incomplete.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR hardens the CI workflow’s actionlint binary download to prevent protocol downgrade via redirects, addressing SonarCloud rule githubactions:S6506 while keeping the pinned version and SHA256 verification intact.

Changes:

  • Add curl protocol/TLS constraints to the actionlint download step in the CI test workflow.
File summaries
File Description
.github/workflows/tests.yml Tightens curl options used to download the pinned actionlint release artifact during CI.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

archive="actionlint_${version}_linux_amd64.tar.gz"
sha256=8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
curl -sSL -o "$archive" \
curl --proto '=https' --tlsv1.2 -sSL -o "$archive" \
brettheap pushed a commit that referenced this pull request Sep 3, 2026
Main gained the `secrets`-in-a-step-`if:` fix (#8) and the actionlint download
hardening (#9) while this branch was written. The only conflict is the README
line cap in tests/test_repo_hygiene.py, where both changes move it: 265 -> 267
for the SHAPE_LEGS_TOKEN paragraph's `env:` note, then 267 -> 324 for
"Keeping a project's shape current". Both rationales are kept, because a cap
whose reasons are dropped as it moves is not a cap.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HGKwdQsmvRZx4fGQESdFGZ
@brettheap
brettheap deleted the fix/curl-proto-https branch September 11, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants