Skip to content

vadimpiven/node-addon-slsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GitHub repo npm version API docs Ask DeepWiki CI status Test coverage

Open in GitHub Codespaces

node-addon-slsa

You npm install a package with a prebuilt .node binary. The package is signed — but how do you know the binary was built from the same source? You don't, unless both artifacts are verified against the same CI run.

node-addon-slsa cross-checks sigstore npm provenance with GitHub Attestations to confirm the package and its binary were produced by the same GitHub Actions workflow run. If they were not, installation aborts with a SECURITY error.

npm install node-addon-slsa

Usage

{
  "addon": {
    "path": "./dist/my_addon.node",
    "url": "https://github.com/owner/repo/releases/download/v{version}/my_addon-v{version}-{platform}-{arch}.node.gz"
  },
  "scripts": {
    "postinstall": "slsa wget",
    "pack-addon": "slsa pack"
  }
}

Programmatic API:

import {
  verifyPackageProvenance,
  semVerString,
  githubRepo,
} from "node-addon-slsa";

const provenance = await verifyPackageProvenance({
  packageName: "my-native-addon",
  version: semVerString("1.0.0"),
  repo: githubRepo("owner/repo"),
});

await provenance.verifyAddon({ sha256: sha256Hex(hexHash) });

Setup guide, threat model, and full API reference: package/README.md

The publishable npm package lives in the package/ directory. Source code, tests, and full documentation are there.

Contributing

See CONTRIBUTING.md.

License

Apache-2.0 OR MIT — see LICENSE-APACHE.txt and LICENSE-MIT.txt.

About

Provenance verification for prebuilt native addons with GitHub attestations

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors

Languages