diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d70df52a..181c89ec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -115,7 +115,7 @@ jobs: - name: Set lowercase repository owner id: lowercase - run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" - name: Log in to GitHub Container Registry uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 diff --git a/.github/workflows/devcontainer-prebuild.yaml b/.github/workflows/devcontainer-prebuild.yaml index 8ef3bca4..3dc8edaf 100644 --- a/.github/workflows/devcontainer-prebuild.yaml +++ b/.github/workflows/devcontainer-prebuild.yaml @@ -65,7 +65,7 @@ jobs: - name: Set lowercase repository owner id: lowercase - run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" - name: Log in to GitHub Container Registry uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 @@ -202,7 +202,7 @@ jobs: - name: Set lowercase repository owner id: lowercase - run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" - name: Determine release context id: release diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..420382a1 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,47 @@ +--- +# Lint caller that repo-steward adds to public repos without one (rule +# baseline/required-file#lint, policy/baseline.toml [[files]]). It follows +# DevSecNinja/.github workflow-templates/lint.yml and +# docs/workflow-trigger-conventions.md. Private repos get lint-private.yml. +# Renovate keeps the pin and the mise version current. When steward opens the +# PR, main becomes the repo's default branch. +name: Lint + +on: + # gitleaks scans only the PR's own commits here. The full history is + # scanned by secret-scan.yml (DevSecNinja/.github#520); this workflow's + # push run scans it too, as the reusable workflow does on every non-PR event. + pull_request: + # Public repos upload SARIF to code scanning, which needs a default-branch + # analysis as the baseline for PR alerts. + push: + branches: + - main + +permissions: + contents: read + +# One run per PR (or branch). A newer push to a PR cancels its running run; a +# running push run is never cancelled, a queued one is superseded. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + lint: + uses: DevSecNinja/.github/.github/workflows/lint.yml@231c380d4f75486e159ed2e3d806bc76ff193a43 # v4.7.0 + permissions: + contents: read + security-events: write + with: + # renovate: datasource=github-releases depName=jdx/mise + mise-version: "2026.11.9" + # The linters run from the repo's own mise config (.mise.toml): pin the + # tools it needs there. Every linter is on by default; turning off + # gitleaks, trivy, zizmor or checkov needs a repo-steward exception + # (rule security/ci-scanners). See DevSecNinja/.github + # workflow-templates/lint.yml for the other inputs. + # Spec Kit output (vendored scripts) is not linted, as the central dprint + # and yamlfmt configs exclude .specify/**. The linters stay on for the rest. + lint-shellcheck-exclude: ".specify/*" + lint-shfmt-exclude: ".specify/*" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 602028bd..1873e683 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,6 +99,9 @@ jobs: # CHANGELOG slice as plain markdown. gh release view "${TAG}" --repo "${REPO}" --json body --jq '.body' >/tmp/release-notes.md # Append the log.sh consumption + provenance verification block. + # The single-quoted printf lines print a shell snippet whose $tmp and + # $HOME must stay literal, so SC2016 doesn't apply. + # shellcheck disable=SC2016 { printf '\n\n---\n\n' printf '## log.sh distribution\n\n' diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml new file mode 100644 index 00000000..d86355dc --- /dev/null +++ b/.github/workflows/secret-scan.yml @@ -0,0 +1,48 @@ +--- +# Secret-scan caller that repo-steward adds to every repo without one (rule +# baseline/required-file#secret-scan, policy/baseline.toml [[files]]). It +# follows DevSecNinja/.github's own secret-scan-caller.yml: lint-include.yml, +# the thin variant of the reusable lint workflow where every linter is off +# unless set to true, with only gitleaks on. gitleaks scans the full git +# history on every event that isn't a pull request (DevSecNinja/.github#520), +# so new gitleaks +# rules re-check old commits. Findings stay private: public repos upload them +# to code scanning (category gitleaks/history) and log a count only; private +# repos list them in the job summary, which only collaborators can read. +# Pull requests are scanned by the lint caller (their own commits only). +# Renovate keeps the pin and the mise version current. When steward opens the +# PR, main becomes the repo's default branch. +name: Secret scan + +on: + push: + branches: + - main + schedule: + - cron: "23 5 * * 1" + workflow_dispatch: + +permissions: + contents: read + +# A scan that already started finishes; the next one queues. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + gitleaks: + uses: DevSecNinja/.github/.github/workflows/lint-include.yml@231c380d4f75486e159ed2e3d806bc76ff193a43 # v4.7.0 + permissions: + contents: read + # Public repos: the history findings go to code scanning. + security-events: write + with: + # renovate: datasource=github-releases depName=jdx/mise + mise-version: "2026.11.9" + # History findings only report (warnings); this fails the run when the + # scan or the code scanning upload fails, so a silent gap can't look + # green. gitleaks must be pinned in the repo's .mise.toml. + lint-fail-on-error: true + # lint-include.yml runs no linter unless it is set to true. + lint-gitleaks: true diff --git a/.github/workflows/sign-powershell.yml b/.github/workflows/sign-powershell.yml index d34011fe..877824b2 100644 --- a/.github/workflows/sign-powershell.yml +++ b/.github/workflows/sign-powershell.yml @@ -86,18 +86,6 @@ jobs: Merging this PR replaces the direct push the workflow used to perform, which is blocked by branch protection on `main`. - - name: Comment on PR - if: steps.check_changes.outputs.changes == 'true' && github.event_name == 'pull_request' - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '✅ PowerShell scripts have been signed. Please pull the latest changes after merge.' - }) - # --- Page on main-branch script-signing failure (homelab IRM pager) --- notify-irm: name: Notify Grafana IRM diff --git a/.mise.toml b/.mise.toml index 3220e7d9..d6bcaed5 100644 --- a/.mise.toml +++ b/.mise.toml @@ -19,9 +19,20 @@ bats = "1.14.0" # Lefthook for managing git hooks lefthook = "latest" -# Shell linting and formatting (used by lefthook hooks) -shellcheck = "latest" -shfmt = "latest" +# Shell linting and formatting (used by lefthook hooks and +# .github/workflows/lint.yml, which needs exact versions; Renovate keeps them current) +shellcheck = "0.11.0" +shfmt = "3.14.1" + +# The other lint tools run by .github/workflows/lint.yml (Renovate keeps them current) +dprint = "0.64.3" +yamlfmt = "0.21.0" +actionlint = "1.7.12" +gitleaks = "8.30.1" +trivy = "0.76.1" +zizmor = "1.31.1" +"pipx:yamllint" = "1.38.0" +"pipx:checkov" = "3.4.0" # Release tooling: cocogitto drives `cog bump`, git-cliff renders CHANGELOG.md # and release notes. See cog.toml, cliff.toml, .github/workflows/release.yml. diff --git a/docs/yubikey.md b/docs/yubikey.md index ee2c7cf7..17db8381 100644 --- a/docs/yubikey.md +++ b/docs/yubikey.md @@ -169,11 +169,10 @@ re-prompt for the FIDO2 PIN, so the second `ssh` call fails with: sign_and_send_pubkey: signing failed for ED25519-SK "..." from agent: agent refused operation ``` -Letting OpenSSH talk to the YubiKey directly each time keeps the touch - -- PIN dance interactive and reliable. If you ever land in the broken - state (e.g. you ran an older config that did `AddKeysToAgent yes`), - clear the agent and you're back in business: +Letting OpenSSH talk to the YubiKey directly each time keeps the +touch + PIN dance interactive and reliable. If you ever land in the broken +state (e.g. you ran an older config that did `AddKeysToAgent yes`), +clear the agent and you're back in business: ```bash ssh-add -D # drop all cached keys