Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig configuration for flakehub-cache-types

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# Rust
[*.rs]
indent_style = space
indent_size = 4

# Misc
[*.{yaml,yml,md,nix,toml}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
pull_request:
merge_group:
push:
branches: [main]

permissions:
contents: read

jobs:
checks:
name: Nix checks (${{ matrix.os }})
permissions:
contents: read
# For flakehub-cache-action
id-token: write
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- uses: DeterminateSystems/flakehub-cache-action@main
Comment on lines +26 to +30

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/ci.yml
printf '%s\n' '--- action references and permission settings ---'
rg -n 'uses:|permissions:|id-token:|contents:' .github/workflows/ci.yml

Repository: DeterminateSystems/flakehub-cache-types

Length of output: 2272


🏁 Script executed:

#!/bin/bash
set -eu
cat -n .github/workflows/ci.yml
rg -n 'uses:|permissions:|id-token:|contents:' .github/workflows/ci.yml

Repository: DeterminateSystems/flakehub-cache-types

Length of output: 2205


Security Misconfiguration (CWE-829): Inclusion of Functionality from Untrusted Control Sphere

Reachability: External · Exploitability: Difficult

Pin all GitHub Actions to immutable commit SHAs.

This workflow grants id-token: write at lines 9–11. Pin every uses: reference, including actions/checkout, the DeterminateSystems actions, and flake-checker-action, to a reviewed full commit SHA. Document each action version in a comment.

🧰 Tools
🪛 zizmor (1.28.0)

[warning] 23-23: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 23 - 27, Replace all action references
in the workflow (actions/checkout, DeterminateSystems/nix-installer-action,
DeterminateSystems/flakehub-cache-action, and flake-checker-action) with their
full immutable commit SHAs instead of version tags or branch names like v4 or
main. Add a comment above each uses statement documenting the action name and
version being pinned, since this workflow has elevated permissions (id-token:
write) and requires security-reviewed immutable references.

- name: Build, test, clippy, rustfmt
run: nix flake check -L
- name: Check editorconfig conformance
run: nix develop --command editorconfig-checker

cargo-deny:
name: Advisories, licenses, sources
runs-on: ubuntu-latest
permissions:
contents: read
# For flakehub-cache-action
id-token: write
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- uses: DeterminateSystems/flakehub-cache-action@main
- run: nix develop --command cargo deny check

flake-checker:
name: Check flake.lock health
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/flake-checker-action@main
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.direnv

/target
result
result-*
Loading
Loading