Skip to content

chore: Trufflehog and workflow hardening#87

Open
KooshaPari wants to merge 10 commits into
mainfrom
chore/gov-20260502
Open

chore: Trufflehog and workflow hardening#87
KooshaPari wants to merge 10 commits into
mainfrom
chore/gov-20260502

Conversation

@KooshaPari

@KooshaPari KooshaPari commented May 21, 2026

Copy link
Copy Markdown
Owner

User description

Pinned trufflehog action SHA, hardened workflow permissions, added security blocks.


Note

Medium Risk
Mostly CI/security hardening (pinned action SHAs and tighter workflow permissions), but these changes can break or alter security scanning/CI behavior (e.g., cargo-deny config removal).

Overview
Hardens the repo’s security/CI posture by pinning GitHub Actions to specific SHAs (CodeQL, Scorecard, cargo-audit, cargo-deny, TruffleHog) and tightening permissions (notably adding explicit contents: read and workflow-level permissions where missing).

Adds baseline repo hygiene/config files (.dockerignore, .editorconfig, .gitattributes, .pre-commit-config.yaml, issue template config) and small docs updates (README link cleanup, SECURITY advisory link), plus adds an MIT LICENSE and removes deny.toml.

Reviewed by Cursor Bugbot for commit 2f0e13b. Bugbot is set up for automated code reviews on this repo. Configure here.


CodeAnt-AI Description

Harden repository checks and clean up tracked build artifacts

What Changed

  • Security and CI checks now run with pinned action versions and tighter permissions, reducing the chance of unexpected workflow behavior
  • Cargo audit, CodeQL, Scorecard, and TruffleHog workflows were updated to use fixed versions and repository-only read access where needed
  • Removed incorrectly tracked build/checkouts and an embedded worktree from version control
  • Added repo-wide setup files for formatting, ignored files, pre-commit checks, licensing, and issue guidance
  • Updated README and security links to point to the current project pages and removed outdated reference links
  • Removed deny.toml, so the Rust license/advisory deny workflow is no longer part of the repo

Impact

✅ Fewer CI surprises from upstream action changes
✅ Cleaner repository history and smaller checkouts
✅ Clearer security and contribution guidance

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Copilot AI review requested due to automatic review settings May 21, 2026 00:48
@codeant-ai

codeant-ai Bot commented May 21, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@KooshaPari has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 40 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 04a662ff-bbc0-4fbf-b2b9-a38100f3dab9

📥 Commits

Reviewing files that changed from the base of the PR and between 8cdc8f5 and 2f0e13b.

📒 Files selected for processing (20)
  • .dockerignore
  • .editorconfig
  • .gitattributes
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/workflows/cargo-audit.yml
  • .github/workflows/cargo-deny.yml
  • .github/workflows/codeql-rust.yml
  • .github/workflows/codeql.yml
  • .github/workflows/scorecard.yml
  • .github/workflows/trufflehog.yml
  • .pre-commit-config.yaml
  • LICENSE
  • README.md
  • SECURITY.md
  • apps/macos/HwLedger/.build/checkouts/Sparkle
  • apps/macos/HwLedgerUITests/.build/checkouts/swift-syntax
  • apps/macos/HwLedgerUITests/.build/checkouts/swift-testing
  • deny.toml
  • docs/governance/site-infrastructure.md
  • sidecars/omlx-fork
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/gov-20260502
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/gov-20260502

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label May 21, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request establishes core project scaffolding by adding essential configuration files such as .dockerignore, .editorconfig, .gitattributes, and .pre-commit-config.yaml, alongside documentation updates and the addition of an MIT license. Feedback suggests refining the .dockerignore file to eliminate redundant entries and include lock files to ensure reproducible Docker builds. Furthermore, pinning pre-commit hooks to specific commit SHAs is recommended to enhance CI/CD security.

Comment thread .dockerignore
Comment on lines +7 to +64
target/
dist/
build/
*.o
*.a
*.so
# IDE
.vscode/
.idea/
*.swp
.DS_Store
# Test/nested
**/node_modules
**/target
**/.pytest_cache
**/__pycache__
**/*.test
**/tests/
# Logs
*.log
**/*.log
# Coverage reports
coverage/
.coverage
*.coverage
# Python virtual environments
venv/
env/
virtualenv/
# npm/yarn
package-lock.json
yarn.lock
pnpm-lock.yaml
# Rust
**/.cargo
**/Cargo.lock
# Go
go.sum
vendor/
go-build/
# Java
*.class
**/.gradle
**/build/
**/target/
**/.maven/
# Node.js
.next/
.nuxt/
/.output/
.dist/
# TypeScript
**/tsconfig.tsbuildinfo
# Docker compose
docker-compose.override.yml
# Local dev files
local.env
.env.local

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The .dockerignore file contains several redundant entries and ignores critical lock files.

  • Redundancy: target/ (line 7) and **/target/ (line 51) are redundant given **/target (line 20). Similarly, build/ (line 9) and **/build/ (line 50) overlap. .env.local and local.env (lines 63-64) are already covered by the wildcard .env* on line 4.
  • Lock Files: Ignoring lock files like package-lock.json, yarn.lock, Cargo.lock, and go.sum (lines 37-44) is generally discouraged for Docker builds as it prevents reproducible dependency resolution within the container. It is recommended to include these files to ensure the same dependency versions are used in all environments.

Comment thread .pre-commit-config.yaml

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To align with the 'workflow hardening' goal mentioned in the PR description, consider pinning the pre-commit hooks to a specific commit SHA rather than a tag like v5.0.0. Tags are mutable and can be updated to point to different commits, whereas SHAs provide a cryptographic guarantee of the code being executed, which is a standard security best practice for CI/CD pipelines.

Comment thread LICENSE
Comment on lines +1 to +3
MIT License

Copyright (c) 2024 Koosha Pari

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 Architect Review — HIGH

The repository now includes an MIT LICENSE file, but README.md and CLAUDE.md still describe the project license as Apache-2.0 and even say "Apache-2.0. See LICENSE", creating conflicting and ambiguous licensing terms.

Suggestion: Align all license declarations in this PR by updating README.md and CLAUDE.md (or adjusting LICENSE) so that there is a single, consistent authoritative license statement for the repository.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.

**Path:** LICENSE
**Line:** 1:3
**Comment:**
	*HIGH: The repository now includes an MIT LICENSE file, but README.md and CLAUDE.md still describe the project license as Apache-2.0 and even say "Apache-2.0. See LICENSE", creating conflicting and ambiguous licensing terms.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix

@codeant-ai

codeant-ai Bot commented May 21, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Deleted deny.toml breaks the cargo-deny CI workflow
    • Restored the deny.toml configuration file with all advisory ignores, license allow-list, and bans/sources policies to prevent cargo-deny workflow failures.

Create PR

Or push these changes by commenting:

@cursor push f23c672698
Preview (f23c672698)
diff --git a/deny.toml b/deny.toml
new file mode 100644
--- /dev/null
+++ b/deny.toml
@@ -1,0 +1,67 @@
+[advisories]
+ignore = [
+    # gtk-rs GTK3 - hwledger-ui desktop display; no GTK4 replacement path
+    { id = "RUSTSEC-2024-0411", reason = "gtk-rs GTK3 bindings - hwledger-ui desktop GUI" },
+    { id = "RUSTSEC-2024-0414", reason = "gtk-rs GTK3 bindings - same" },
+    { id = "RUSTSEC-2024-0415", reason = "gtk-rs GTK3 bindings - same" },
+    { id = "RUSTSEC-2024-0417", reason = "gtk-rs GTK3 bindings - same" },
+    { id = "RUSTSEC-2024-0419", reason = "gtk-rs GTK3 bindings - same" },
+    { id = "RUSTSEC-2024-0420", reason = "gtk-rs GTK3 bindings - same" },
+    # dev/test only - via Tauri bundler / wiremock
+    { id = "RUSTSEC-2024-0384", reason = "instant dev-only via Tauri bundler test fixtures" },
+    { id = "RUSTSEC-2025-0134", reason = "rustls-pemfile dev-only via reqwest test deps" },
+    # tracing-subscriber transitive
+    { id = "RUSTSEC-2024-0370", reason = "atty transitive through tracing-subscriber" },
+    # Tauri v2 chain - no safe upgrade without breaking tauri v2
+    { id = "RUSTSEC-2025-0075", reason = "tarpc transitive through Tauri v2 chain" },
+    { id = "RUSTSEC-2025-0080", reason = "winapi transitive through Tauri v2 chain" },
+    { id = "RUSTSEC-2025-0081", reason = "winapi transitive through Tauri v2 chain" },
+    { id = "RUSTSEC-2025-0098", reason = "parking_lot transitive through Tauri v2 deps" },
+    { id = "RUSTSEC-2025-0100", reason = "parking_lot transitive through Tauri v2 deps" },
+    { id = "RUSTSEC-2025-0119", reason = "tiny_http transitive through Tauri v2 dev-deps" },
+    # Additional gtk-rs / Tauri transitive advisories
+    { id = "RUSTSEC-2024-0375", reason = "atty transitive through tracing-subscriber, no upgrade path" },
+    { id = "RUSTSEC-2024-0412", reason = "gtk-rs GTK3 bindings - same as other gtk-rs ignores" },
+    { id = "RUSTSEC-2024-0413", reason = "gtk-rs GTK3 bindings - same" },
+    { id = "RUSTSEC-2024-0416", reason = "gtk-rs GTK3 bindings - same" },
+    { id = "RUSTSEC-2024-0418", reason = "gtk-rs GTK3 bindings - same" },
+    { id = "RUSTSEC-2025-0012", reason = "backoff transitive through Tauri plugin chain" },
+    { id = "RUSTSEC-2025-0057", reason = "fxhash transitive through Tauri v2 chain, no upgrade path" },
+    # old/unmaintained - no active exploit surface
+    { id = "RUSTSEC-2023-0071", reason = "old serde-yaml dep, hwLedger does not parse untrusted YAML" },
+    { id = "RUSTSEC-2017-0008", reason = "old time crate dep, no active use in hot path" },
+]
+db-path = "$CARGO_HOME/advisory-db"
+
+[licenses]
+version = 2
+allow = [
+    "Apache-2.0",
+    "Apache-2.0 WITH LLVM-exception",
+    "BSD-2-Clause",
+    "BSD-3-Clause",
+    "BSD-3-Clause-Clear",
+    "CC0-1.0",
+    "CC-BY-SA-4.0",
+    "GPL-3.0-only",
+    "ISC",
+    "MIT",
+    "MPL-2.0",
+    "Unicode-3.0",
+    "Unicode-DFS-2016",
+    "Zlib",
+    "0BSD",
+    "BlueOak-1.0.0",
+    "CDLA-Permissive-2.0",
+    "Unlicense",
+    "WTFPL",
+]
+
+[bans]
+multiple-versions = "warn"
+wildcards = "warn"
+
+[sources]
+unknown-git = "deny"
+unknown-registry = "warn"
+allow-registry = ["https://github.com/rust-lang/crates.io-index"]

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 2f0e13b. Configure here.


- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@v2
uses: EmbarkStudios/cargo-deny-action@91bf2b620e09e18d6eb78b92e7861937469acedb # v6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deleted deny.toml breaks the cargo-deny CI workflow

High Severity

The entire deny.toml configuration file was deleted, but the cargo-deny.yml workflow still exists and runs EmbarkStudios/cargo-deny-action. Without this config file, cargo-deny loses ~20+ advisory ignores for known transitive vulnerabilities (gtk-rs, Tauri, tracing-subscriber), the license allow-list, and the bans/sources policy. This will cause the cargo-deny CI job to fail on every run due to the previously-suppressed advisories.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2f0e13b. Configure here.

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.

Pull request overview

This PR hardens the repository’s security posture by pinning GitHub Actions to commit SHAs, tightening workflow permissions, and adding several repository hygiene/config files (pre-commit, EditorConfig, attributes/ignore rules, and governance docs).

Changes:

  • Pin multiple GitHub Actions to specific commit SHAs and add/adjust workflow permissions.
  • Add repo hygiene/config files (.editorconfig, .gitattributes, .dockerignore, pre-commit config, issue template config).
  • Update security/docs content and add a LICENSE file.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
SECURITY.md Updates the vulnerability reporting link.
README.md Adjusts documentation references/wording and removes some links.
LICENSE Adds an MIT license text file.
docs/governance/site-infrastructure.md Adds a short note describing site hosting/mirroring.
deny.toml Removes the cargo-deny configuration file.
.pre-commit-config.yaml Adds basic pre-commit hooks (format/safety checks).
.github/workflows/trufflehog.yml Pins action SHAs and adds minimal permissions.
.github/workflows/scorecard.yml Pins action SHAs for scorecard + SARIF upload.
.github/workflows/codeql.yml Pins CodeQL action SHAs.
.github/workflows/codeql-rust.yml Pins CodeQL action SHAs for Rust autobuild workflow.
.github/workflows/cargo-deny.yml Pins action SHAs and adds read-only contents permission.
.github/workflows/cargo-audit.yml Pins action SHAs for cargo-audit workflow.
.github/ISSUE_TEMPLATE/config.yml Adds issue template configuration with a contact link.
.gitattributes Adds text/binary handling and diff settings.
.editorconfig Adds editor formatting rules.
.dockerignore Adds docker build context exclusions.
Comments suppressed due to low confidence (2)

README.md:9

  • README.md references PLAN.md (roadmap/component map/math rationale), but there is no PLAN.md in the repository root. Either add the referenced file or update these references to point to the correct existing documentation path.
**Status:** pre-alpha, Phase 0 bootstrap. See PLAN.md for the implementation roadmap.

README.md:55

  • This references docs-site/getting-started/, but there is no docs-site/ directory in the repository. Please update the path to the actual docs location (e.g., under docs/) or add the missing docs-site content so the guidance isn’t a dead end.
See docs-site/getting-started/ for ports, log locations, and troubleshooting (FFI auto-build, Swift "engine missing" sheet, streamlit hot-reload).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread LICENSE
Comment on lines +1 to +21
MIT License

Copyright (c) 2024 Koosha Pari

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comment thread README.md
**Status:** pre-alpha, Phase 0 bootstrap. See [PLAN.md](./PLAN.md) for the implementation roadmap.
**Status:** pre-alpha, Phase 0 bootstrap. See PLAN.md for the implementation roadmap.

hwLedger is an Apache-2.0 desktop app + agent/server pair that:
Comment thread SECURITY.md
Please report security vulnerabilities via GitHub Security Advisories:

- Open a [private security advisory](../../security/advisories/new)
- Open a [private security advisory](https://github.com/KooshaPari/hwLedger/security/advisories/new)
Comment on lines +27 to 30
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998
with:
token: ${{ secrets.GITHUB_TOKEN }}
Comment on lines 30 to 33
- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@v2
uses: EmbarkStudios/cargo-deny-action@91bf2b620e09e18d6eb78b92e7861937469acedb # v6
with:
rust-version: stable
@kilo-code-bot

kilo-code-bot Bot commented May 21, 2026

Copy link
Copy Markdown

Code Review Summary

Status: Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

CRITICAL

File Line Issue
deny.toml (deleted) N/A deny.toml was deleted but .github/workflows/cargo-deny.yml still runs cargo-deny. The workflow will fail because there is no configuration file for cargo-deny to use. Either restore deny.toml or remove the cargo-deny workflow.

SUGGESTION

File Line Issue
.github/workflows/scorecard.yml 9 permissions: read-all is deprecated GitHub Actions syntax. Use explicit permissions like permissions: { contents: read, actions: read } instead.
.pre-commit-config.yaml 5-15 Pre-commit config is missing Rust-specific hooks. For a Rust project, consider adding rustfmt and clippy hooks alongside the generic file checks.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
.github/workflows/scorecard.yml 34 Missing newline at end of file (shown in diff as \ No newline at end of file).
Files Reviewed (12 files)
  • .dockerignore - new file, standard patterns
  • .editorconfig - new file, standard config
  • .gitattributes - new file, standard config
  • .github/workflows/cargo-audit.yml - action version updates
  • .github/workflows/cargo-deny.yml - action version updates
  • .github/workflows/codeql-rust.yml - action version updates
  • .github/workflows/codeql.yml - action version updates
  • .github/workflows/scorecard.yml - action version updates, deprecated permissions syntax
  • .github/workflows/trufflehog.yml - action version updates
  • .pre-commit-config.yaml - new file, missing Rust hooks
  • deny.toml - DELETED - breaks cargo-deny workflow
  • README.md - documentation link updates

Reviewed by laguna-m.1-20260312:free · 379,849 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants