Skip to main content
This page documents the automated security infrastructure used to validate the Palyra supply chain, scan for secrets, and generate Software Bill of Materials (SBOM) artifacts. These gates are primarily orchestrated via GitHub Actions and custom validation scripts to ensure that both Rust and Node.js dependencies meet security standards before release.

Automated Security Pipeline

The primary entry point for security validation is the security.yml workflow. This workflow runs a battery of scanners targeting different layers of the stack, from crate dependencies to hardcoded secrets.

Workflow Orchestration

The security-gates job performs the following sequence:
  1. Node.js Audit: Executes npm audit with specific logic to differentiate between runtime and development vulnerabilities .github/workflows/security.yml#30-64.
  2. Rust Audit: Uses cargo audit to check Cargo.lock against the Advisory Database .github/workflows/security.yml#95-96.
  3. Policy Enforcement: Uses cargo deny to enforce license compliance and ban specific crates .github/workflows/security.yml#98-99.
  4. Vulnerability Scanning: Runs osv-scanner (Google’s Open Source Vulnerability scanner) for cross-ecosystem coverage .github/workflows/security.yml#101-104.
  5. Secret Scanning: Executes gitleaks to detect committed secrets or high-risk patterns .github/workflows/security.yml#120-124.
  6. SBOM Generation: Produces CycloneDX-formatted SBOMs for all workspace crates .github/workflows/security.yml#131-132.

Data Flow: Security Scanning

The following diagram illustrates how security artifacts are generated and validated during the CI process. Security Gate Data Flow Sources: .github/workflows/security.yml#30-130, scripts/validate-npm-audit-dev-allowlist.mjs#198-250

Node.js Dependency Governance

Palyra employs a strict “No High/Critical vulnerabilities in production” policy for the web dashboard and desktop UI. However, development-only tools (like build-time bundlers) often have transient vulnerabilities that do not impact the shipped runtime.

npm Audit Allowlist Mechanism

The project uses a custom script, scripts/validate-npm-audit-dev-allowlist.mjs, to manage this distinction.
  1. Dual Auditing: The CI runs npm audit twice: once for the full tree and once with --omit=dev .github/workflows/security.yml#53-54.
  2. Allowlist Filtering: Any vulnerability found in the “Full” report but not in the “Runtime” report is checked against npm-audit-dev-allowlist.json .github/workflows/npm-audit-dev-allowlist.json#1-5.
  3. Expiry Enforcement: Allowlist entries must have an expires_on date. If an entry is expired, the CI fails even if the vulnerability is still present .scripts/validate-npm-audit-dev-allowlist.mjs#220-222.
Allowlist Schema
FieldDescription
idThe GHSA or NPM advisory ID.
expires_onISO date (YYYY-MM-DD) when the exception expires.
ownerThe maintainer responsible for the exception.
reasonTechnical justification for why this is safe in dev-only.
Sources: scripts/validate-npm-audit-dev-allowlist.mjs#1-250, npm-audit-dev-allowlist.json#1-5

Rust Security and SBOM

Cargo Audit and Deny

Rust dependencies are managed via two primary tools:

SBOM Generation

For every release-ready build, the system generates a Software Bill of Materials using cargo-cyclonedx.

Specialized Governance

Desktop glib Patch Governance

Palyra maintains a specific security policy for upstream vulnerabilities that cannot be immediately resolved due to transitive constraints. A notable example is GHSA-wrw7-89jp-8q8g in the glib crate, used by the desktop Linux runtime.
  • Implementation: The project maintains a patched version in apps/desktop/src-tauri/third_party/glib-0.18.5-patched SECURITY.md#62-65.
  • CI Enforcement: The script scripts/check-desktop-glib-patch.sh is executed in the security gate to ensure the patch remains applied and hasn’t been accidentally regressed .github/workflows/security.yml#70-71.

Static Analysis and CodeQL

In addition to dependency scanning, the repository uses GitHub CodeQL for deep semantic analysis of the source code. Code Security Entity Mapping Sources: .github/workflows/security.yml#58-64, scripts/validate-npm-audit-dev-allowlist.mjs#198-210, SECURITY.md#51-65

Summary of Security Tools

ToolTargetPurpose
cargo auditCargo.lockRust vulnerability scanning .github/workflows/security.yml#95-96.
cargo denyRust WorkspaceLicense and crate policy enforcement .github/workflows/security.yml#98-99.
osv-scannerMulti-ecosystemGoogle OSV database check .github/workflows/security.yml#101-104.
npm auditpackage-lock.jsonNode.js vulnerability scanning .github/workflows/security.yml#30-31.
gitleaksGit HistorySecret and credential detection .github/workflows/security.yml#120-124.
cargo cyclonedxWorkspaceSBOM generation .github/workflows/security.yml#131-132.
CodeQLSource CodeSemantic vulnerability analysis .github/workflows/codeql.yml#1-48.
Sources: .github/workflows/security.yml#1-156, .github/workflows/codeql.yml#1-48