Skip to content

feat: implement npx vril doctor with 20-point security audit and SBOM generation#11

Open
Copilot wants to merge 7 commits into
mainfrom
copilot/audit-getting-started-docs
Open

feat: implement npx vril doctor with 20-point security audit and SBOM generation#11
Copilot wants to merge 7 commits into
mainfrom
copilot/audit-getting-started-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

Implements the previously aspirational npx vril doctor command as real, functional CLI functionality.

Changes

  • 20-point build-time security audit — Parses the full resolved vril.config.ts and validates: security headers (HSTS, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, COOP, COEP, CSP, Permissions-Policy), CSP directives (no unsafe-inline/eval, frame-ancestors, upgrade-insecure-requests), runtime protections (Trusted Types, API membrane, CSRF, SRI), and project hygiene (lockfile, no .env, TS strict, X-Powered-By disabled)
  • CycloneDX 1.5 SBOM generation — Produces sbom.cyclonedx.json from package.json dependencies with proper purl identifiers and scope classification
  • .gitignore — Added sbom.cyclonedx.json as generated artifact
$ npx vril doctor

▒▒ Vril.js Doctor v2.2.0
──────────────────────────────────────────────────

  ✓ HSTS configured
  ✓ X-Content-Type-Options: nosniff
  ...
  ✓ upgrade-insecure-requests in CSP

▸ Security audit: 20/20 checks passed
▸ SBOM generated: sbom.cyclonedx.json

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vril-js Ready Ready Preview, Comment Jun 1, 2026 3:28pm

- Fix package name from 'vril-js' to '@vrillabs/vril-js' in all
  README.md install commands and import examples
- Replace non-existent 'vril build --secure' with 'vril build' on
  landing page (CLI has no --secure flag)
- Remove aspirational terminal output ('Security audit: 20/20 checks
  passed', 'SBOM generated: sbom.cyclonedx.json') that is not
  produced by the actual CLI
- Replace with accurate output ('Security headers active')
- Remove non-existent 'npx vril doctor' command from docs page
- Fix 'npm install vril-js' to 'npm install @vrillabs/vril-js' in
  docs page
Copilot AI changed the title [WIP] Audit and correct getting started documentation for accuracy docs: Correct Getting Started documentation to match actual CLI and package behavior May 30, 2026
Copilot AI requested a review from VrilLabs May 30, 2026 05:22
…OM generation

Adds the `doctor` CLI command that:
- Runs a 20-point build-time security audit against the project's
  vril.config.ts (headers, CSP, Trusted Types, CSRF, SRI, etc.)
- Generates a CycloneDX 1.5 SBOM at sbom.cyclonedx.json from
  package.json dependencies
- Prints colored pass/fail output for each check

Closes #12
Copilot AI changed the title docs: Correct Getting Started documentation to match actual CLI and package behavior feat: implement npx vril doctor with 20-point security audit and SBOM generation May 30, 2026
@VrilLabs
Copy link
Copy Markdown
Owner

@copilot

  • Thoroughly resolve the merge conflicts in this pull request.

  • Ensure the full functionality requested is authentically implemented with zero mock or fabricated functions, functionality, components or implementations.

  • Perform a final deep-review and QA testing round to ensure full, authentic, genuine, flawlessly optimal and performant functionality of the requested features and all other features of Vril.js--this way we can be sure nothing else has broken in the process and we are truly 100% production-ready.

…-started-docs

# Conflicts:
#	src/app/docs/page.tsx
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot

  • Thoroughly resolve the merge conflicts in this pull request.
    ...

Resolved the merge conflict with latest main in merge commit 8f8af7c and fixed the review-found malformed URL in f65aaab. Re-ran QA: npx --no-install vril doctor (20/20 + SBOM), SBOM JSON validation, npx tsc --noEmit, npm run lint, npm run build, runtime smoke checks for /, /docs, /api, and security-header checks. Final validation passed with no CodeQL alerts and no code review comments; PR mergeable state is now clean.

@VrilLabs VrilLabs marked this pull request as ready for review May 30, 2026 23:30
Copilot AI review requested due to automatic review settings May 30, 2026 23:30
Copy link
Copy Markdown

Copilot AI left a comment

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 adds a vril doctor CLI command for security auditing and SBOM generation, plus small site/docs alignment for current CLI usage.

Changes:

  • Adds a 20-check doctor audit command and CycloneDX SBOM writer.
  • Registers doctor in the CLI command dispatcher.
  • Updates landing page command examples and ignores generated SBOM output.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/lib/vril/framework/cli.mjs Implements doctor, audit checks, SBOM generation, and command routing.
src/app/page.tsx Updates social link and CLI output examples.
.gitignore Ignores generated sbom.cyclonedx.json.

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

Comment thread src/lib/vril/framework/cli.mjs Outdated
Comment on lines +602 to +608
const components = Object.entries(allDeps).map(([name, version]) => ({
type: 'library',
name,
version: String(version).replace(/^[\^~>=<]*/g, ''),
purl: `pkg:npm/${name.startsWith('@') ? name.replaceAll('/', '%2F') : name}@${String(version).replace(/^[\^~>=<]*/g, '')}`,
scope: pkg.dependencies?.[name] ? 'required' : 'optional',
}));
Comment thread src/lib/vril/framework/cli.mjs Outdated
const tsconfigPath = resolve(root, 'tsconfig.json');
let tsStrict = false;
try {
const tsconfig = JSON.parse(await readFile(tsconfigPath, 'utf8'));
Comment thread src/lib/vril/framework/cli.mjs Outdated
// 2. X-Content-Type-Options
checks.push({
name: 'X-Content-Type-Options: nosniff',
pass: !!(vrilConfig?.security?.headers?.xContentTypeOptions || securityHeaders['X-Content-Type-Options']),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit and Correct Getting Started Documentation for Accuracy

3 participants