Security Gates workflow, which integrates Rust-native auditing tools, Node.js vulnerability scanning with a custom dev-allowlist mechanism, and automated policy enforcement for third-party patches.
Security Workflow Orchestration
The security posture is enforced by.github/workflows/security.yml, which runs on every workflow_dispatch and as part of the release process. It aggregates results from multiple scanners into a unified set of security artifacts.
Data Flow: Security Scanning Pipeline
The following diagram illustrates how various security tools interact with the codebase and produce the final audit report. Security Gate Execution Flow Sources: .github/workflows/security.yml#11-156, .github/workflows/codeql.yml#19-48Dependency Governance Tools
Rust Dependency Auditing
Palyra uses three distinct tools to manage the Rust supply chain:- cargo-audit: Scans
Cargo.lockagainst the Advisory Database for crates with known vulnerabilities .github/workflows/security.yml#95-96. - cargo-deny: Enforces license compliance and bans specific crates or multiple versions. The configuration in
deny.tomlallows specific licenses likeApache-2.0,MIT, and the customLicenseRef-Palyra-Community-Source-1.1deny.toml#10-20. - osv-scanner: Uses Google’s OSV database to provide an additional layer of vulnerability detection, outputting results to
security-artifacts/osv-results.json.github/workflows/security.yml#101-104.
Node.js Dev-Allowlist Mechanism
To manage vulnerabilities in development-only dependencies (which do not affect the production bundle), Palyra implements a “dev-allowlist” strategy.- Execution:
npm auditis run with--omit=devto check production risks first .github/workflows/security.yml#30-31. - Validation: The script
scripts/validate-npm-audit-dev-allowlist.mjscompares a full audit against a runtime-only audit. If a high-severity vulnerability exists only indevDependencies, it must be documented innpm-audit-dev-allowlist.jsonwith an expiration date .github/workflows/security.yml#56-64, npm-audit-dev-allowlist.json#1-6. - Enforcement: The validator fails if an entry is expired or if a vulnerability is found in the runtime graph that isn’t allowlisted scripts/validate-npm-audit-dev-allowlist.test.mjs#71-106.
Downstream Patch Governance
In cases where an upstream vulnerability (e.g.,GHSA-wrw7-89jp-8q8g in glib) cannot be resolved due to transitive dependency constraints in the Tauri/GTK stack, Palyra employs a “Downstream Patch” policy.
Implementation: The glib Patch
- Vendoring: The patched crate is stored in
apps/desktop/src-tauri/third_party/glib-0.18.5-patchedapps/desktop/src-tauri/docs/security/advisories/GHSA-wrw7-89jp-8q8g.md#27-29. - Override: The workspace
Cargo.tomluses[patch.crates-io]to force the resolution to the local patched version apps/desktop/src-tauri/docs/security/advisories/GHSA-wrw7-89jp-8q8g.md#33-33. - Governance Check: A dedicated script,
scripts/check-desktop-glib-patch.sh, verifies the file checksums and governance metadata (PALYRA_PATCH_GOVERNANCE.env) to ensure the patch hasn’t been tampered with or become stale apps/desktop/src-tauri/docs/security/advisories/GHSA-wrw7-89jp-8q8g.md#47-53.
Secret Scanning & Static Analysis
Gitleaks
The pipeline installs and runsgitleaks to detect hardcoded secrets, tokens, or private keys across the entire repository history. It generates a SARIF report for integration with GitHub’s security dashboard .github/workflows/security.yml#106-124.
CodeQL
Palyra uses GitHub CodeQL for semantic code analysis across three languages:rust, javascript-typescript, and actions. The analysis is configured via .github/codeql/codeql-config.yml and runs on a weekly schedule or on PRs .github/workflows/codeql.yml#1-48.
SBOM Generation
Software Bill of Materials (SBOM) are generated usingcargo-cyclonedx. This produces machine-readable JSON files (sbom.json) that document every component and version used in the Rust workspace, facilitating transparency and downstream compliance .github/workflows/security.yml#131-146.
Sources: .github/workflows/security.yml#106-146, .github/workflows/codeql.yml#1-48
Dependency Review Workflow
For every Pull Request, thedependency-review.yml workflow triggers the actions/dependency-review-action. This tool analyzes the Cargo.lock and package-lock.json changes to identify:
- New vulnerabilities introduced by the PR.
- Incompatible license changes.
- Significant dependency version jumps.
main branch .github/workflows/dependency-review.yml#1-35.
Sources: .github/workflows/dependency-review.yml#1-35