Skip to content

Supply Chain Security & Compliance ​

Modern front-end engineering heavily relies on external open-source component distribution chains. From day one, BrutxUI was architected with anti-tampering and transparent compliance as first-class contracts, establishing an end-to-end defense model across canonical integrity hashes, Ed25519 digital signatures, strict verification gates, CycloneDX 1.5 SBOM generation, and local audit log tracking.


Threat Model & Security Goals ​

Unlike traditional precompiled npm packages, BrutxUI distributes component source code directly into user codebases. While this provides complete styling and architectural flexibility, it raises the bar for registry source purity:

Attack VectorRisk DescriptionBrutxUI Defense Mechanism
MITM / CDN TamperingNetwork hijack maliciously alters component source filesCanonical SHA-256 integrity recomputation and enforcement
Unauthorized ReleasesAttacker impersonates registry metadata to publish trojanized componentsAsymmetric Ed25519 digital signatures with trusted public key verification
Silent Dependency DriftInter-component dependencies maliciously redirectedStrict locking of registry dependency graph (registryDependencies)
Compliance Blind SpotsInability to audit underlying third-party licenses and vulnerabilitiesNative export of CycloneDX 1.5 Software Bill of Materials (SBOM)
Local Code DriftUnintended local modifications drifting away from component baselinedoctor --fail-on drift and integrity self-healing (restore-integrity)

Canonical Recomputation & Ed25519 Signatures ​

1. Canonical Content Hash Recomputation ​

When the CLI fetches registry-manifest.json from a remote registry, it immediately runs the first line of defense—canonical SHA-256 recomputation:

  • Extracts core entity fields (name, schemaVersion, registryVersion, items), performs canonical serialization, and computes the digest;
  • Matches the computed digest against the manifest's integrity field;
  • Dynamic timestamps (buildTimestamp), git commit hashes (gitCommit), and signature metadata itself are excluded from the digest calculation, guaranteeing build idempotency and anti-replay resilience.
  • Benefit: Even if an attacker modifies any component definition or code hash inside the manifest, the request is immediately rejected unless they can forge the entire digest.

2. Ed25519 Digital Signature Verification ​

The second line of defense is asymmetric cryptographic signature verification:

  • The release workflow signs the manifest's canonical digest with the publisher's private key using Ed25519;
  • The manifest attaches the resulting signature along with a key identifier keyId;
  • The CLI resolves the trusted public key matching keyId locally and verifies that the signature was generated by the legitimate maintainer.

3. Out-of-the-Box Official Trust Anchor ​

For standard developers, this entire verification chain works automatically with zero configuration:

  • The CLI embeds the official BrutxUI root public key;
  • When fetching from the official release registry, verification occurs quietly in the background;
  • Unsigned legacy manifests are skipped gracefully to ensure backward compatibility.

Strict Signature Mode ​

Default Warning Mechanism ​

In development environments, when encountering an unknown keyId or verification failure, the CLI emits a warning (warn) and proceeds, preventing unexpected blocks during key migrations or internal network configuration:

text
[Signature] Manifest signed with unknown keyId "v1". No matching trusted public key found.
  (use --require-signature to enforce)

Production & CI Strict Gate ​

For production deployments, automated CI/CD pipelines, or enterprise intranets, activating strict mode is strongly recommended. In strict mode, any signature failure or untrusted key throws REGISTRY_SIGNATURE_INVALID and immediately exits with code 1:

Activate strict mode via any of the following:

bash
# Option 1: CLI flag (highest priority)
npx brutx-vue@latest --require-signature add button

# Option 2: Environment variable
export BRUTX_REQUIRE_SIGNATURE=1
npx brutx-vue@latest add button

Or declare project-level enforcement in components.json:

json
{
  "$schema": "https://lidaixingchen.github.io/brutxui-vue3/schema.json",
  "$version": 1,
  "style": "brutalism",
  "requireSignature": true
}

Private Registries & Key Management ​

Enterprises deploying private registries or internal mirrors can establish their own key pairs and rotation lifecycle.

Public Key Resolution Order ​

The CLI resolves public keys in the following priority order, always appending the official root key as a fallback anchor:

  1. Project Configuration: trustedPublicKeys in components.json (highest priority, can override official keys by keyId)
  2. Environment Variable: BRUTX_REGISTRY_PUBLIC_KEYS (JSON array string)
  3. Built-in Root Key: Official BrutxUI public key (fallback trust anchor)

Public Key Configuration Example ​

Public keys must be single-line base64-encoded SPKI DER format for easy embedding in JSON or shell variables.

In components.json:

json
{
  "trustedPublicKeys": [
    {
      "keyId": "corp-registry-2026",
      "publicKey": "MCowBQYDK2VwAyEA9Yg1r5Q3t6e...",
      "status": "active",
      "note": "Enterprise internal registry 2026 signing key"
    }
  ]
}

In CI/CD pipelines:

bash
export BRUTX_REGISTRY_PUBLIC_KEYS='[{"keyId":"corp-registry-2026","publicKey":"MCowBQYDK2VwAyEA9Yg1r5Q3t6e..."}]'

Smooth Key Rotation ​

When rotating keys due to scheduled expiration or personnel changes:

  1. Signing Phase: Sign the new manifest with the new private key (e.g., keyId: "corp-2027");
  2. Transition Phase: Retain both keys (corp-2026 and corp-2027) in the trusted list so both legacy and modern manifests verify cleanly;
  3. Revocation Phase: Once historical dependencies are upgraded, remove the old key to permanently invalidate assets signed by the retired private key.

CycloneDX 1.5 Software Bill of Materials (SBOM) ​

A Software Bill of Materials (SBOM) is a cornerstone of modern cybersecurity compliance (SOC 2, ISO 27001, Executive Order 14028). BrutxUI adheres strictly to the OWASP CycloneDX 1.5 industry standard.

1. Project-Level SBOM Generation (doctor --sbom) ​

Export the BrutxUI components recorded in the project's .brutx/manifest.json:

bash
# Outputs to ./brutx-sbom.json by default
npx brutx-vue@latest doctor --sbom

# Specify custom output path
npx brutx-vue@latest doctor --sbom --sbom-output ./reports/brutx-sbom.json

# Preview the destination without writing a file
npx brutx-vue@latest doctor --sbom --dry-run

metadata.component identifies the project by name and any version available in package.json. metadata.tools.components identifies the CLI that generated the document. Top-level components lists registered BrutxUI components and the direct npm dependencies found in their installation targets. npm versions come from installed package metadata, and package scopes appear in group. The export skips npm targets that are still pending and includes a component version's content digest in hashes when available. The inventory covers BrutxUI components and their direct dependencies.

The CLI resolves dependencies from the workspace and member recorded at installation. It supports node_modules and pnpm PnP layouts with packages on disk. Dependencies installed through a local path or an alias appear under their installed package name and version.

The top-level dependencies array links entries through ref and dependsOn. In this example, project:storefront@1.0.0 is the bom-ref of metadata.component, and the other references identify entries in components:

json
{
  "dependencies": [
    { "ref": "brutx:dialog", "dependsOn": ["npm:reka-ui@2.3.0"] },
    { "ref": "project:storefront@1.0.0", "dependsOn": ["brutx:dialog"] }
  ]
}

2. Registry-Level SBOM (Release Asset) ​

Registry builds produce registry-sbom.json using the CycloneDX 1.5 JSON Schema. It lists registry components, declared npm dependencies, and their relationships. The top-level properties entry with name set to brutx:registry:manifestIntegrity gives the digest of the corresponding registry-manifest.json. The value of brutx:registry:sbomIntegrity holds the SBOM digest. Release verification checks both properties.

3. Enterprise Pipeline Integration ​

The resulting CycloneDX 1.5 SBOM integrates directly into enterprise vulnerability and governance platforms:

  • Dependency-Track: Continuously track component vulnerabilities and CVEs;
  • Snyk / Trivy: Ingest SBOMs for automated license compliance and CI security gate checks;
  • GitHub Dependency Submission API: Submit installed component manifests directly to your repository's Dependency Graph and Dependabot alerts.

Local Audit Log ​

After every modifying command (add, update, remove, diff), the CLI automatically appends a JSONL audit record to .brutx/audit.log in the project root.

Audit Log Record Format ​

Each record captures full operational context for compliance auditing and incident forensics:

json
{
  "timestamp": "2026-09-12T14:30:00.000Z",
  "command": "add",
  "components": ["button", "card"],
  "registrySource": "https://github.com/lidaixingchen/brutxui-vue3/releases/latest/download",
  "success": true,
  "dryRun": false
}

Diagnostic Retrospection ​

Running npx brutx-vue@latest doctor automatically inspects recent failed records in .brutx/audit.log:

  • If recent network timeouts, unreachable registries, or write errors occurred, doctor surfaces timestamps and error details directly in the terminal to accelerate troubleshooting.

Team Best Practices Checklist ​

To achieve the highest security posture in production:

  1. Enforce strict verification: Add "requireSignature": true to components.json to reject untrusted code execution;
  2. Implement drift detection in CI: Run npx brutx-vue@latest doctor --ci --fail-on drift on pull requests to prevent unreviewed manual edits;
  3. Archive SBOM artifacts: Incorporate npx brutx-vue@latest doctor --sbom into release pipelines and archive the SBOM alongside build artifacts;
  4. Configure Git tracking: Commit the .brutx/ metadata directory to Git, while ignoring .brutx/cache/ in .gitignore.

Brute force builds.