Home
Softono
s

sigstore

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
6

Software by sigstore

rekor
Open Source

rekor

[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sigstore/rekor/badge)](https://api.securityscorecards.dev/projects/github.com/sigstore/rekor) <p align="center"> <img style="max-width: 100%;width: 300px;" src="https://raw.githubusercontent.com/sigstore/community/main/artwork/rekor/horizontal/color/sigstore_rekor-horizontal-color.svg" alt="Rekor logo"/> </p> # Rekor Rekór - Greek for “Record” Rekor's goals are to provide an immutable tamper resistant ledger of metadata generated within a software projects supply chain. Rekor will enable software maintainers and build systems to record signed metadata to an immutable record. Other parties can then query said metadata to enable them to make informed decisions on trust and non-repudiation of an object's lifecycle. For more details visit the [sigstore website](https://sigstore.dev). The Rekor project provides a restful API based server for validation and a transparency log for storage. A CLI application is available to make and verify entries, query the transparency log for inclusion proof, integrity verification of the transparency log or retrieval of entries by either public key or artifact. Rekor fulfils the signature transparency role of sigstore's software signing infrastructure. However, Rekor can be run on its own and is designed to be extensible to working with different manifest schemas and PKI tooling. [Official Documentation](https://docs.sigstore.dev/rekor/overview). ## Current State of Rekor v1 Rekor v1 is in maintenance mode. We are actively developing a new version of Rekor designed to be easy to maintain and cheaper to operate. Building on the active development in the Certificate Transparency ecosystem, Rekor v2 will be backed by a [tile-based log](https://transparency.dev/articles/tile-based-logs/) and will use a modernized version of Trillian, [Trillian-Tessera](https://github.com/transparency-dev/trillian-tessera). Follow its progress on the [rekor-tiles](https://github.com/sigstore/rekor-tiles/) repo, and learn more about Rekor v2 on the [proposal](https://docs.google.com/document/d/1Mi9OhzrucIyt-UCLk_FxO2_xSQZW9ow9U3Lv0ZB_PpM/edit?resourcekey=0-4rPbZPyCS7QDj26Hk0UyvA&tab=t.0#heading=h.bjitqo6lwsmn) and [design doc](https://docs.google.com/document/d/1qZ-lkpbQkBzV45rtemWYmT6ReqCwjTt5TbMDFLdaPyM/edit?resourcekey=0-bMAyN9EKPDvB0H3edYi_Cw&tab=t.0#heading=h.xzptrog8pyxf). As we near a V2 release, we plan to merge the rekor-tiles codebase into this repository. ## Public Instance Rekor is officially Generally Available with a 1.0.0 release, and follows [semver rules](https://semver.org/) for API stability. This means production workloads can rely on the Rekor public instance, which has a 24/7 oncall rotation supporting it and offers a 99.5% availability SLO for the following API endpoints: * `/api/v1/log` * `/api/v1/log/publicKey` * `/api/v1/log/proof` * `/api/v1/log/entries` * `/api/v1/log/entries/retrieve` For uptime data on the Rekor public instance, see [https://status.sigstore.dev](https://status.sigstore.dev). More details on the public instance can be found at [docs.sigstore.dev](https://docs.sigstore.dev/rekor/public-instance). The attestation size limit for uploads to the public instance is [100KB](https://github.com/sigstore/rekor/blob/18c81d9f4def67c72f630c5406e26d5e568bc83b/cmd/rekor-server/app/root.go#L104). If you need to upload larger files, please run your own instance of Rekor. You can find instructions for doing so in the [installation](https://docs.sigstore.dev/rekor/overview#usage-and-installation) documentation. ### Installation Please see the [installation](https://docs.sigstore.dev/rekor/overview#usage-and-installation) page for details on how to install the rekor CLI and set up / run the rekor server ### Usage For examples of uploading signatures for all the supported types to rekor, see [the types documentation](types.md). ## Extensibility ### Custom schemas / manifests (rekor type) Rekor allows customized manifests (which term them as types), [type customization is outlined here](https://github.com/sigstore/rekor/tree/main/pkg/types). ### API If you're interested in integration with Rekor, we have an [OpenAPI swagger editor](https://sigstore.dev/swagger/) ## Security Should you discover any security issues, please refer to sigstore's [security process](https://github.com/sigstore/.github/blob/main/SECURITY.md) ## Contributions We welcome contributions from anyone and are especially interested to hear from users of Rekor. ## Additional Documentation In addition to this README file, this folder contains the additional documentation: - **oid-info.md**. Rekor OID values. - **types.md**. Information about how to sign and upload data in different pluggable types.

SIEM & Threat Detection Compliance & Governance
1.2K Github Stars
sigstore
Open Source

sigstore

# sigstore framework [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/sigstore.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:sigstore) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5716/badge)](https://bestpractices.coreinfrastructure.org/projects/5716) sigstore/sigstore contains common [Sigstore](https://www.sigstore.dev/) code: that is, code shared by infrastructure (e.g., [Fulcio](https://github.com/sigstore/fulcio) and [Rekor](https://github.com/sigstore/rekor)) and Go language clients (e.g., [Cosign](https://github.com/sigstore/cosign) and [Gitsign](https://github.com/sigstore/gitsign)). This library currently provides: * A signing interface (support for ecdsa, ed25519, rsa, DSSE (in-toto)) * OpenID Connect fulcio client code The following KMS systems are available: * AWS Key Management Service * Azure Key Vault * HashiCorp Vault * Google Cloud Platform Key Management Service * OpenBao For example code, look at the relevant test code for each main code file. ## Fuzzing The fuzzing tests are within https://github.com/sigstore/sigstore/tree/main/test/fuzz ## Security Should you discover any security issues, please refer to sigstores [security process](https://github.com/sigstore/.github/blob/main/SECURITY.md) For container signing, you want [cosign](https://github.com/sigstore/cosign)

Security Backend as a Service
523 Github Stars
sigstore-python
Open Source

sigstore-python

sigstore-python =============== <!--- @begin-badges@ ---> [![CI](https://github.com/sigstore/sigstore-python/workflows/CI/badge.svg)](https://github.com/sigstore/sigstore-python/actions/workflows/ci.yml) [![PyPI version](https://badge.fury.io/py/sigstore.svg)](https://pypi.org/project/sigstore) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sigstore/sigstore-python/badge)](https://securityscorecards.dev/viewer/?uri=github.com/sigstore/sigstore-python) [![SLSA](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev/) ![Conformance Tests](https://github.com/sigstore/sigstore-python/workflows/Conformance%20Tests/badge.svg) [![Documentation](https://github.com/sigstore/sigstore-python/actions/workflows/docs.yml/badge.svg)](https://sigstore.github.io/sigstore-python) <!--- @end-badges@ ---> `sigstore` is a Python tool for generating and verifying Sigstore signatures. You can use it to sign and verify Python package distributions, or anything else! ## Index * [Features](#features) * [Installation](#installation) * [Usage](#usage) * [Signing](#signing) * [Verifying](#verifying) * [Generic identities](#generic-identities) * [Signatures from GitHub Actions](#signatures-from-github-actions) * [Advanced usage](#advanced-usage) * [Troubleshooting](#troubleshooting) * [Documentation](#documentation) * [Licensing](#licensing) * [Community](#community) * [Contributing](#contributing) * [Code of Conduct](#code-of-conduct) * [Security](#security) * [SLSA Provenance](#slsa-provenance) ## Features * Support for keyless signature generation and verification with [Sigstore](https://www.sigstore.dev/) * Support for signing with ["ambient" OpenID Connect identities](https://github.com/sigstore/sigstore-python#signing-with-ambient-credentials) * A comprehensive [CLI](https://github.com/sigstore/sigstore-python#usage) and corresponding [importable Python API](https://sigstore.github.io/sigstore-python) ## Installation `sigstore` requires Python 3.10 or newer, and can be installed directly via `pip`: ```console python -m pip install sigstore ``` See the [installation](https://sigstore.github.io/sigstore-python/installation) page in the documentation for more installation options. ## Usage For Python API usage, see our [API](https://sigstore.github.io/sigstore-python/api/). You can run `sigstore` as a standalone program: ```console sigstore --help ``` Top-level: <!-- @begin-sigstore-help@ --> ``` usage: sigstore [-h] [-v] [-V] [--staging | --instance URL | --trust-config FILE] COMMAND ... a tool for signing and verifying Python package distributions positional arguments: COMMAND the operation to perform attest sign one or more inputs using DSSE sign sign one or more inputs verify verify one or more inputs get-identity-token retrieve and return a Sigstore-compatible OpenID Connect token trust-instance Initialize trust for a Sigstore instance plumbing developer-only plumbing operations options: -h, --help show this help message and exit -v, --verbose run with additional debug logging; supply multiple times to increase verbosity (default: 0) -V, --version show program's version number and exit --staging Use sigstore's staging instance, instead of the default production instance. Mutually exclusive with other instance configuration arguments. (default: False) --instance URL Use a given Sigstore instance URL, instead of the default production instance. Mutually exclusive with other instance configuration arguments. (default: None) --trust-config FILE Use given client trust configuration instead of using the default production instance. Mutually exclusive with other instance configuration arguments. (default: None) ``` <!-- @end-sigstore-help@ --> ### Signing <!-- @begin-sigstore-sign-help@ --> ``` usage: sigstore sign [-h] [-v] [--rekor-version VERSION] [--identity-token TOKEN] [--oidc-client-id ID] [--oidc-client-secret SECRET] [--oidc-disable-ambient-providers] [--oidc-issuer URL] [--oauth-force-oob] [--no-default-files] [--signature FILE] [--certificate FILE] [--bundle FILE] [--output-directory DIR] [--overwrite] FILE [FILE ...] positional arguments: FILE The file to sign options: -h, --help show this help message and exit -v, --verbose run with additional debug logging; supply multiple times to increase verbosity (default: 0) --rekor-version VERSION Force the rekor transparency log version. Valid values are [1, 2]. By default the highest available version is used OpenID Connect options: --identity-token TOKEN the OIDC identity token to use (default: None) --oidc-client-id ID The custom OpenID Connect client ID to use during OAuth2 (default: sigstore) --oidc-client-secret SECRET The custom OpenID Connect client secret to use during OAuth2 (default: None) --oidc-disable-ambient-providers Disable ambient OpenID Connect credential detection (e.g. on GitHub Actions) (default: False) --oidc-issuer URL The OpenID Connect issuer to use (default: None) --oauth-force-oob Force an out-of-band OAuth flow and do not automatically start the default web browser (default: False) Output options: --no-default-files Don't emit the default output files ({input}.sigstore.json) (default: False) --signature FILE, --output-signature FILE Write a single signature to the given file; does not work with multiple input files (default: None) --certificate FILE, --output-certificate FILE Write a single certificate to the given file; does not work with multiple input files (default: None) --bundle FILE Write a single Sigstore bundle to the given file; does not work with multiple input files (default: None) --output-directory DIR Write default outputs to the given directory (conflicts with --signature, --certificate, --bundle) (default: None) --overwrite Overwrite preexisting signature and certificate outputs, if present (default: False) ``` <!-- @end-sigstore-sign-help@ --> ### Signing with DSSE envelopes <!-- @begin-sigstore-attest-help@ --> ``` usage: sigstore attest [-h] [-v] [--rekor-version VERSION] --predicate FILE --predicate-type TYPE [--identity-token TOKEN] [--oidc-client-id ID] [--oidc-client-secret SECRET] [--oidc-disable-ambient-providers] [--oidc-issuer URL] [--oauth-force-oob] [--bundle FILE] [--overwrite] FILE [FILE ...] positional arguments: FILE The file to sign options: -h, --help show this help message and exit -v, --verbose run with additional debug logging; supply multiple times to increase verbosity (default: 0) --rekor-version VERSION Force the rekor transparency log version. Valid values are [1, 2]. By default the highest available version is used DSSE options: --predicate FILE Path to the predicate file (default: None) --predicate-type TYPE Specify a predicate type (https://slsa.dev/provenance/v0.2, https://slsa.dev/provenance/v1) (default: None) OpenID Connect options: --identity-token TOKEN the OIDC identity token to use (default: None) --oidc-client-id ID The custom OpenID Connect client ID to use during OAuth2 (default: sigstore) --oidc-client-secret SECRET The custom OpenID Connect client secret to use during OAuth2 (default: None) --oidc-disable-ambient-providers Disable ambient OpenID Connect credential detection (e.g. on GitHub Actions) (default: False) --oidc-issuer URL The OpenID Connect issuer to use (default: None) --oauth-force-oob Force an out-of-band OAuth flow and do not automatically start the default web browser (default: False) Output options: --bundle FILE Write a single Sigstore bundle to the given file; does not work with multiple input files (default: None) --overwrite Overwrite preexisting bundle outputs, if present (default: False) ``` <!-- @end-sigstore-attest-help@ --> ### Verifying #### Identities <!-- @begin-sigstore-verify-identity-help@ --> ``` usage: sigstore verify identity [-h] [-v] [--certificate FILE] [--signature FILE] [--bundle FILE] [--offline] --cert-identity IDENTITY --cert-oidc-issuer URL FILE_OR_DIGEST [FILE_OR_DIGEST ...] options: -h, --help show this help message and exit -v, --verbose run with additional debug logging; supply multiple times to increase verbosity (default: 0) Verification inputs: --certificate FILE, --cert FILE The PEM-encoded certificate to verify against; not used with multiple inputs (default: None) --signature FILE The signature to verify against; not used with multiple inputs (default: None) --bundle FILE The Sigstore bundle to verify with; not used with multiple inputs (default: None) FILE_OR_DIGEST The file path or the digest to verify. The digest should start with the 'sha256:' prefix. Verification options: --offline Perform offline verification; requires a Sigstore bundle (default: False) --cert-identity IDENTITY The identity to check for in the certificate's Subject Alternative Name (default: None) --cert-oidc-issuer URL The OIDC issuer URL to check for in the certificate's OIDC issuer extension (default: None) ``` <!-- @end-sigstore-verify-identity-help@ --> #### Signatures from GitHub Actions <!-- @begin-sigstore-verify-github-help@ --> ``` usage: sigstore verify github [-h] [-v] [--certificate FILE] [--signature FILE] [--bundle FILE] [--offline] [--cert-identity IDENTITY] [--trigger EVENT] [--sha SHA] [--name NAME] [--repository REPO] [--ref REF] FILE_OR_DIGEST [FILE_OR_DIGEST ...] options: -h, --help show this help message and exit -v, --verbose run with additional debug logging; supply multiple times to increase verbosity (default: 0) Verification inputs: --certificate FILE, --cert FILE The PEM-encoded certificate to verify against; not used with multiple inputs (default: None) --signature FILE The signature to verify against; not used with multiple inputs (default: None) --bundle FILE The Sigstore bundle to verify with; not used with multiple inputs (default: None) FILE_OR_DIGEST The file path or the digest to verify. The digest should start with the 'sha256:' prefix. Verification options: --offline Perform offline verification; requires a Sigstore bundle (default: False) --cert-identity IDENTITY The identity to check for in the certificate's Subject Alternative Name (default: None) --trigger EVENT The GitHub Actions event name that triggered the workflow (default: None) --sha SHA The `git` commit SHA that the workflow run was invoked with (default: None) --name NAME The name of the workflow that was triggered (default: None) --repository REPO The repository slug that the workflow was triggered under (default: None) --ref REF The `git` ref that the workflow was invoked with (default: None) ``` <!-- @end-sigstore-verify-github-help@ --> ## Troubleshooting First, please make sure you are using a recent and supported release: sigstore-python project provides support for the latest release and best effort critical bug fixes for the latest 3.6.x release. ### Common issues 1. "_bundle contains a transparency log entry that is incompatible with this version of sigstore-python_" (as well as "_not enough sources of verified time_") means an upgrade is necessary to verify this signature bundle: Signature bundles with Rekor v2 transparency log entries can only be verified with sigstore-python 4 and above 1. verifying without a network connection results in HTTP errors: By default sigstore-python checks for updates to the trusted key material on every startup. This can be avoided temporarily with `--offline` but please read the [documentation](https://sigstore.github.io/sigstore-python/advanced/offline/) for caveats 1. Signing results in HTTP errors: Signing with sigstore-python depends on multiple Sigstore services. Retrying on failure may be a useful workaround if any of these services fail but filing issues for specific failures is appreciated ### My problem is something else Please [open an issue](https://github.com/sigstore/sigstore-python/issues/new?template=bug.md) or ask in the [slack channel](#community). ## Documentation `sigstore` documentation is available on [https://sigstore.github.io/sigstore-python](https://sigstore.github.io/sigstore-python) ## Licensing `sigstore` is licensed under the Apache 2.0 License. ## Community `sigstore-python` is developed as part of the [Sigstore](https://sigstore.dev) project. We also use a [Slack channel](https://sigstore.slack.com)! Click [here](https://join.slack.com/t/sigstore/shared_invite/zt-mhs55zh0-XmY3bcfWn4XEyMqUUutbUQ) for the invite link. ## Contributing See [the contributing docs](https://github.com/sigstore/.github/blob/main/CONTRIBUTING.md) for details. ## Code of Conduct Everyone interacting with this project is expected to follow the [sigstore Code of Conduct](https://github.com/sigstore/.github/blob/main/CODE_OF_CONDUCT.md). ## Security Should you discover any security issues, please refer to sigstore's [security process](https://github.com/sigstore/.github/blob/main/SECURITY.md).

Security Backend as a Service
320 Github Stars
model-transparency
Open Source

model-transparency

# Model Transparency <!-- markdown-toc --bullets="-" -i README.md --> <!-- toc --> - [Overview](#overview) - [Model Signing](#model-signing) - [Model Signing CLI](#model-signing-cli) - [Model Signing API](#model-signing-api) - [Model Signing Format](#model-signing-format) - [Status](#status) - [Contributing](#contributing) <!-- tocstop --> ## Overview There is currently significant growth in the number of ML-powered applications. This brings benefits, but it also provides grounds for attackers to exploit unsuspecting ML users. Building on the work with [Open Source Security Foundation][openssf], we are creating this collection of projects to strengthen the ML supply chain in _the same way_ as the traditional software supply chain. The focus is on providing *verifiable* claims about the integrity and provenance of the resulting models, meaning users can check for themselves that these claims are true rather than having to just trust the model trainer. ## Model Signing This project demonstrates how to protect the integrity of a model by signing it. We support generating signatures via [Sigstore](https://www.sigstore.dev/), a tool for making code signatures transparent without requiring management of cryptographic key material. But we also support traditional signing methods, so models can be signed with public keys or signing certificates as well as PKCS #11 enabled devices *(install with `pip install model-signing[pkcs11]` to enable this functionality)*. The signing part creates a [sigstore bundle](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) protobuf that is stored as in JSON format. The bundle contains the verification material necessary to check the payload and a payload as a [DSSE envelope](https://github.com/sigstore/protobuf-specs/blob/main/protos/envelope.proto). Further the DSSE envelope contains an in-toto statment and the signature over that statement. The signature format and how the the signature is computed can be seen [here](https://github.com/secure-systems-lab/dsse/blob/v1.0.0/protocol.md). Finally, the statement itself contains subjects which are a list of (file path, digest) pairs a predicate type set to `https://model_signing/signature/v1.0` and a dictionary of predicates. The idea is to use the predicates to store (and therefor sign) model card information in the future. The verification part reads the sigstore bundle file and firstly verifies that the signature is valid and secondly compute the model's file hashes again to compare against the signed ones. When users download a given version of a signed model they can check that the signature comes from a known or trusted identity and thus that the model hasn't been tampered with after training. When using Sigstore, signing events are recorded to Sigstore's append-only transparency log. Transparency logs make signing events discoverable: Model verifiers can validate that the models they are looking at exist in the transparency log by checking a proof of inclusion (which is handled by the model signing library). Furthermore, model signers that monitor the log can check for any unexpected signing events. Model signers should monitor for occurences of their signing identity in the log. Sigstore is actively developing a [log monitor](https://github.com/sigstore/rekor-monitor) that runs on GitHub Actions. ![Signing models with Sigstore](https://raw.githubusercontent.com/sigstore/model-transparency/main/docs/images/sigstore-model-diagram.png) ### Model Signing CLI After installing the package, the CLI can be used via either `python -m model_signing <args>` or by calling the binary directly, `model_signing <args>`. Users that don't want to install the package, but want to test this using the repository can do the same using [Hatch](https://hatch.pypa.io/latest/) via `hatch run python -m model_signing <args>`. For the remainder of the section, we would use `model_signing <args>` method. The CLI has two subcommands: `sign` for signing and `verify` for verification. Each subcommand has another level of subcommands to select the signing method (`sigstore` -- the default, can be skipped --, `key`, `certificate`). Then, each of these subcommands has several flags to configure parameters for signing/verification. For the demo, we will use the `bert-base-uncased` model, which can be obtained via: ```bash [...]$ git clone --depth=1 "https://huggingface.co/bert-base-uncased" ``` We remove the `.git` directory since that should not be included in the signature: ```bash [...]$ rm -rf bert-base-uncased/.git ``` By default, the code also ignores git related paths. The simplest example of the CLI is to sign a model using Sigstore: ```bash [...]$ model_signing sign bert-base-uncased ``` This will open an OIDC flow to obtain a short lived token for the certificate. The identity used during signing and the provider must be reused during verification. To only compute and output the digest of the model, you can use the `digest` subcommand, pointing it to the model directory: ```bash [...]$ model_signing digest bert-base-uncased ``` The digest subcommand follows the same ignore rules used when signing. ## Using Private Sigstore Instances To use a private Sigstore setup (e.g. custom Rekor/Fulcio), use the `--trust-config` flag: ```bash [...]$ model_signing sign bert-base-uncased --trust-config client_trust_config.json ``` For verification: ```bash [...]$ model_signing verify bert-base-uncased \ --signature model.sig \ --trust-config client_trust_config.json --identity "$identity" --identity-provider "$oidc_provider" ``` The `client_trust_config.json` file should include: - A signed target trust root - A `signingConfig` section with your private Rekor, Fulcio, and CT log endpoints - Public keys for verification (if applicable) You can find an example `client_trust_config.json` that references the public Sigstore production services in the Sigstore Python repository [here](https://github.com/sigstore/sigstore-python/blob/main/test/assets/trust_config/config.v1.json). As another example, here is how we can sign with private keys. First, we generate the key pair: ```bash [...]$ openssl ecparam -name prime256v1 -genkey -noout -out key.priv [...]$ openssl ec -in key.priv -pubout > key.pub ``` And then we use the private key to sign. ```bash [...]$ model_signing sign key bert-base-uncased --private-key key.priv ``` All signing methods support changing the signature name and location via the `--signature` flag: ```bash [...]$ model_signing sign bert-base-uncased --signature model.sig ``` Consult the help for a list of all flags (`model_signing --help`, or directly `model_signing` with no arguments) On verification we use the `verify` subcommand. To verify a Sigstore signed model we use ```bash [...]$ model_signing verify bert-base-uncased \ --signature model.sig \ --identity "$identity" \ --identity-provider "$oidc_provider" ``` Where `$identity` and `$oidc_provider` are those set up during the signing flow and `--signature` must point to the signature to verify. For developers signing models with Sigstore, there are three identity providers that can be used at the moment: * Google's provider is `https://accounts.google.com`. * GitHub's provider is `https://github.com/login/oauth`. * GitHub Actions uses `https://token.actions.githubusercontent.com` * Microsoft's provider is `https://login.microsoftonline.com`. For automated signing using a workload identity, the following platforms are currently supported, shown with their expected identities: * GitHub Actions (`https://github.com/octo-org/octo-automation/.github/workflows/oidc.yml@refs/heads/main`) * GitLab CI (`https://gitlab.com/my-group/my-project//path/to/.gitlab-ci.yml@refs/heads/main`) * Google Cloud Platform (`SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com`) * Buildkite CI (`https://buildkite.com/ORGANIZATION_SLUG/PIPELINE_SLUG`) Similarly, for key verification, we can use ```bash [...]$ model_signing verify key bert-base-uncased \ --signature resnet.sig --public-key key.pub ``` #### Signing with PKCS #11 URIs Signing with PKCS #11 enabled crypto devices is supported through RFC 7512 compliant PKCS #11 URIs. The URI can be used in place of the private key when siging with a private key or certificate. The following features are supported/required: - The PKCS #11 URI must either provide the module through the query parameter 'module-path', or the query parameter 'module-name' must describe the name of a module that can be found in well-known directories of Linux distributions. - A token can be selected based on a provided 'slot-id' path parameter. The first token that matches the given slot-id will be used. If a 'token' path parameter is also provided, then it will be used for selecting the appropriate token by its label. - When no 'slot-id' is given then all slots are searched for by the name of the given 'token'. - A PIN may be provided as 'pin-value' query parameter or may be read from a file described by the 'pin-source' query parameter. - An 'id' path parameter and/or key label (path parameter 'object') must be provided to select the signing key. - The public key on the PKCS #11 device will also be accessed during signing. - The signing key must be of type NIST P256/384/521 (secp256/384/512r1). With a PKCS #11 URI describing the private key, we can use the following for signing: ```bash [...]$ model_signing sign pkcs11-key --signature model.sig \ --pkcs11_uri "pkcs11:..." /path/to/your/model ``` For signature verification it is necessary to retrieve the public key from the PKCS #11 device and store it in a file in PEM format. With can then use: ```bash [...]$ model_signing verify key --signature model.sig\ --public-key key.pub /path/to/your/model ``` #### OpenTelemetry Support Model signing supports optional distributed tracing and observability through OpenTelemetry. This allows you to monitor signing operations, track performance, and integrate with observability platforms. To enable OpenTelemetry support, install the optional dependencies: ```bash pip install model-signing[otel] ``` Once installed, OpenTelemetry will automatically instrument the signing operations. You can configure the telemetry collection using standard OpenTelemetry environment variables: ```bash # Configure OTLP endpoint (e.g., Jaeger, Zipkin) export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 # Set service name for traces export OTEL_SERVICE_NAME=model-signing # Configure exporters (default: otlp) export OTEL_TRACES_EXPORTER=otlp export OTEL_METRICS_EXPORTER=none ``` Example with tracing enabled: ```bash # Start Jaeger (example using Docker) docker run -d --name jaeger \ -p 16686:16686 \ -p 4317:4317 \ jaegertracing/all-in-one:latest # Sign with tracing OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 \ OTEL_SERVICE_NAME=model-signing \ OTEL_TRACES_EXPORTER=otlp \ OTEL_METRICS_EXPORTER=none \ model_signing sign bert-base-uncased ``` #### Logging Configuration The `model-signing` CLI supports configurable logging levels to help with debugging and monitoring: ```bash # Enable debug logging on the command line model_signing --log-level debug sign bert-base-uncased # Or using environment variable MODEL_SIGNING_LOG_LEVEL=debug model_signing sign bert-base-uncased ``` Available log levels: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` ### Model Signing API We offer an API which can be used in integrations with ML frameworks, ML pipelins and ML model hubs libraries. The CLI wraps around the API. The API is split into 3 main components: - `model_signing.hashing`: responsible with generating a list of hashes for every component of the model. A component could be a file, a file shard, a tensor, etc., depending on the method used. We currently support only files and file shards. The result of hashing is a manifest, a listing of hashes for every object in the model. - `model_signing.signing`: responsible with taking the manifest and generating a signature, based on a signing configuration. The signing configuration can select the method used to sign as well as the parameters. - `model_signing.verifying`: responsible with taking a signature and verifying it. If the cryptographic parts of the signature can be validated, the verification layer would return an expanded manifest which can then be compared agains a manifest obtained from hashing the existing model. If the two manifest don't match then the model integrity was compromised and the `model_signing` package detected that. The first two of these components allows configurability but can also be used directly, with a default configuration. The only difference is for the verification component where we need to configure the verification method since there are no sensible defaults that can be used. The simplest way to generate a signature using Sigstore is: ```python import model_signing model_signing.signing.sign("bert-base-uncased", "model.sig") ``` This will run the same OIDC flow as when signing with Sigstore from the CLI. We can use explicit configurations to configure more about the signing: ```python import model_signing model_signing.signing.Config().use_elliptic_key_signer( private_key="key.priv" ).sign( "finbert", "finbert.sig" ) ``` The same signing configuration can be used to sign multiple models: ```python import model_signing signing_config = model_signing.signing.Config().use_elliptic_key_signer( private_key="key.priv" ) for model in all_models: signing_config.sign(model, f"{model}_sharded.sig") ``` Verification needs a configuration. To verify using Sigstore: ```python import model_signing model_signing.verifying.Config().use_sigstore_verifier( identity=identity, oidc_issuer=oidc_provider ).verify("finbert", "finbert.sig") ``` The same verification configuration can be used to verify multiple models: ```python import model_signing verifying_config = model_signing.signing.Config().use_elliptic_key_verifier( public_key="key.pub" ) for model in all_models: verifying_config.verify(model, f"{model}_sharded.sig") ``` Consult the [official documentation](https://sigstore.github.io/model-transparency/model_signing.html) for more details. ### Model Signing Format For a diagram showing the model signing format as well as an explanation of the layers, see the [model signing format](docs/model_signing_format.md) document. ## Contributing Please see the [Contributor Guide](CONTRIBUTING.md) for more information. [openssf]: https://openssf.org/

ML Frameworks Compliance & Governance
234 Github Stars
gh-action-sigstore-python
Open Source

gh-action-sigstore-python

gh-action-sigstore-python ========================= [![CI](https://github.com/sigstore/gh-action-sigstore-python/actions/workflows/ci.yml/badge.svg)](https://github.com/sigstore/gh-action-sigstore-python/actions/workflows/ci.yml) [![Self-test](https://github.com/sigstore/gh-action-sigstore-python/actions/workflows/selftest.yml/badge.svg)](https://github.com/sigstore/gh-action-sigstore-python/actions/workflows/selftest.yml) This GitHub Action uses [`sigstore-python`](https://github.com/sigstore/sigstore-python) to generate Sigstore signatures. `gh-action-sigstore-python` is the easiest way to [integrate Sigstore into your CI system](https://docs.sigstore.dev/quickstart/quickstart-ci/) and can be used for not only Python projects, but projects in other languages as well. > [!IMPORTANT] > Are you publishing a package to PyPI? If so, you **do not need this action**: > [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) > will handle signing for you! ## Index * [Usage](#usage) * [Configuration](#configuration) * [⚠️ Internal options ⚠️](#internal-options) * [Licensing](#licensing) * [Code of Conduct](#code-of-conduct) ## Usage Simply add `sigstore/gh-action-sigstore-python` to one of your workflows: ```yaml jobs: selftest: runs-on: ubuntu-latest permissions: id-token: write steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Build step run: echo "build result example" > file.txt - uses: sigstore/[email protected] with: inputs: file.txt ``` Note: Your workflow **must** have permission to request the OIDC token to authenticate with. This can be done by setting `id-token: write` on your job (as above) or workflow. More information about permission settings can be found [here](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings). ## Configuration `gh-action-sigstore-python` takes a variety of configuration inputs, most of which are optional. ### `inputs` The `inputs` setting controls what files `sigstore-python` signs. At least one input must be provided unless [release-signing-artifacts](#release-signing-artifacts) is set to `true` on release events. To sign one or more files: ```yaml - uses: sigstore/[email protected] with: inputs: file0.txt file1.txt file2.txt ``` The `inputs` argument also supports file globbing: ```yaml - uses: sigstore/[email protected] with: inputs: ./path/to/inputs/*.txt ``` Multiple lines are fine, and whitespace in filenames can also be escaped using POSIX shell lexing rules: ```yaml - uses: sigstore/[email protected] with: inputs: | ./path/to/inputs/*.txt ./another/path/foo\ bar.txt ./a/third/path/"easier to quote than to escape".txt ``` > [!NOTE]\ > In versions of this action before 2.0.0, the `inputs` setting allowed for shell expansion. > This was unintentional, and was removed with 2.0.0. ### `identity-token` **Default**: Empty (the GitHub Actions credential will be used) The `identity-token` setting controls the OpenID Connect token provided to Fulcio. By default, the workflow will use the credentials found in the GitHub Actions environment. ```yaml - uses: sigstore/[email protected] with: inputs: file.txt identity-token: ${{ IDENTITY_TOKEN }} # assigned elsewhere ``` ### `oidc-client-id` **Default**: `sigstore` The `oidc-client-id` setting controls the OpenID Connect client ID to provide to the OpenID Connect Server during OAuth2. Example: ```yaml - uses: sigstore/[email protected] with: inputs: file.txt oidc-client-id: alternative-sigstore-id ``` ### `oidc-client-secret` **Default**: Empty (no OpenID Connect client secret provided by default) The `oidc-client-secret` setting controls the OpenID Connect client secret to provide to the OpenID Connect Server during OAuth2. Example: ```yaml - uses: sigstore/[email protected] with: inputs: file.txt oidc-client-secret: alternative-sigstore-secret ``` ### `staging` **Default**: `false` The `staging` setting controls whether or not `sigstore-python` uses sigstore's staging instances, instead of the default production instances. Example: ```yaml - uses: sigstore/[email protected] with: inputs: file.txt staging: true ``` ### `verify` **Default**: `false` The `verify` setting controls whether or not the generated signatures and certificates are verified with the `sigstore verify` subcommand after all files have been signed. This is **not strictly necessary** but can act as a smoke test to ensure that all signing artifacts were generated properly and the signature was properly submitted to Rekor. If `verify` is enabled, then you **must** also pass the `verify-cert-identity` and `verify-oidc-issuer` settings. Failing to pass these will produce an error. Example: ```yaml - uses: sigstore/[email protected] with: inputs: file.txt verify: true verify-oidc-issuer: https://some-oidc-issuer.example.com verify-cert-identity: some-identity ``` ### `verify-cert-identity` **Default**: Empty The `verify-cert-identity` setting controls whether to verify the Subject Alternative Name (SAN) of the signing certificate after signing has taken place. If it is set, `sigstore-python` will compare the certificate's SAN against the provided value. This setting only applies if `verify` is set to `true`. Supplying it without `verify: true` will produce an error. This setting may only be used in conjunction with `verify-oidc-issuer`. Supplying it without `verify-oidc-issuer` will produce an error. ```yaml - uses: sigstore/[email protected] with: inputs: file.txt verify: true verify-cert-identity: [email protected] verify-oidc-issuer: https://oauth2.sigstage.dev/auth ``` ### `verify-oidc-issuer` **Default**: `https://oauth2.sigstore.dev/auth` The `verify-oidc-issuer` setting controls whether to verify the issuer extension of the signing certificate after signing has taken place. If it is set, `sigstore-python` will compare the certificate's issuer extension against the provided value. This setting only applies if `verify` is set to `true`. Supplying it without `verify: true` will produce an error. This setting may only be used in conjunction with `verify-cert-identity`. Supplying it without `verify-cert-identity` will produce an error. Example: ```yaml - uses: sigstore/[email protected] with: inputs: file.txt verify: true verify-cert-identity: [email protected] verify-oidc-issuer: https://oauth2.sigstage.dev/auth ``` ### `upload-signing-artifacts` **Default**: `false` The `upload-signing-artifacts` setting controls whether or not `sigstore-python` creates [workflow artifacts](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts) for the outputs produced by signing operations. By default, no workflow artifacts are uploaded. When enabled, the default workflow artifact retention period is used. Example: ```yaml - uses: sigstore/[email protected] with: inputs: file.txt upload-signing-artifacts: true ``` ### `release-signing-artifacts` **Default**: `true` The `release-signing-artifacts` setting controls whether or not `sigstore-python` uploads signing artifacts to the release publishing event that triggered this run. This setting has no effect on non-`release` events. If enabled, this setting also re-uploads and signs GitHub's default source code artifacts, as they are not guaranteed to be stable. Requires the [`contents: write` permission](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token). Example: ```yaml permissions: contents: write # ... - uses: sigstore/[email protected] with: inputs: file.txt release-signing-artifacts: true ``` On release events, it is also valid to have no explicit inputs. When used on release events, this action will sign any pre-existing release artifacts: ```yaml permissions: contents: write # ... # no explicit settings needed, signs all pre-existing release artifacts - uses: sigstore/[email protected] ``` ### Internal options <details> <summary>⚠️ Internal options ⚠️</summary> Everything below is considered "internal," which means that it isn't part of the stable public settings and may be removed or changed at any points. **You probably do not need these settings.** All internal options are prefixed with `internal-be-careful-`. #### `internal-be-careful-debug` **Default**: `false` The `internal-be-careful-debug` setting enables additional debug logs, both within `sigstore-python` itself and the action's harness code. You can use it to debug troublesome configurations. Example: ```yaml - uses: sigstore/[email protected] with: inputs: file.txt internal-be-careful-debug: true ``` </details> ## Licensing `gh-action-sigstore-python` is licensed under the Apache 2.0 License. ## Code of Conduct Everyone interacting with this project is expected to follow the [sigstore Code of Conduct](https://github.com/sigstore/.github/blob/main/CODE_OF_CONDUCT.md) ## Security Should you discover any security issues, please refer to sigstore's [security process](https://github.com/sigstore/.github/blob/main/SECURITY.md). ## Info `gh-action-sigstore-python` is developed as part of the [`sigstore`](https://sigstore.dev) project. We also use a [slack channel](https://sigstore.slack.com)! Click [here](https://join.slack.com/t/sigstore/shared_invite/zt-mhs55zh0-XmY3bcfWn4XEyMqUUutbUQ) for the invite link.

CI / CD SSO & Authentication
70 Github Stars
rekor-tiles
Open Source

rekor-tiles

# Rekor v2 Rekor v2, aka rekor-tiles or Rekor on Tiles, is a redesigned and modernized [Rekor](https://github.com/sigstore/rekor), Sigstore's signature transparency log, transitioning its backend to a modern, [tile-backed transparency log](https://transparency.dev/articles/tile-based-logs/) implementation to simplify maintenance and lower operational costs. More information (**documents are shared with [sigstore-dev](https://groups.google.com/g/sigstore-dev), join the group to get access, please don't request access**): * [Proposal](https://docs.google.com/document/d/1Mi9OhzrucIyt-UCLk_FxO2_xSQZW9ow9U3Lv0ZB_PpM/edit?resourcekey=0-4rPbZPyCS7QDj26Hk0UyvA&tab=t.0#heading=h.bjitqo6lwsmn) * [Design doc](https://docs.google.com/document/d/1ZYlt_VFB-lxbZCcTZHN-6KVDox3h7-ePp85pNpOUF1U/edit?resourcekey=0-V3WqDB22nOJfI4lTs59RVQ&tab=t.0#heading=h.xzptrog8pyxf) ## Storage Backends Rekor v2 supports multiple storage backends. Separate binaries for each backend are provided: * `rekor-server-gcp`: GCP-specific binary (includes only Google Cloud dependencies) * `rekor-server-aws`: AWS-specific binary (includes only AWS dependencies) * `rekor-server-posix`: POSIX-based storage (lightweight, no cloud dependencies) * `rekor-server-gcpcloudsql`: Alternative to GCP binary that uses CloudSQL instead of Spanner ### Google Cloud Platform (GCP) * Binary: `rekor-server-gcp` * Container `rekor-tiles/gcp` * Sequencing entries: Cloud Spanner * Tile storage: Google Cloud Storage (GCS) * Use case: Preferred deployment architecture for GCP, highly scalable ### Amazon Web Services (AWS) * Binary: `rekor-server-aws` * Container `rekor-tiles/aws` * Sequencing: Aurora MySQL or RDS MySQL * Tile storage: Amazon S3 * Use case: Deployment architecture for AWS ### POSIX * Binary: `rekor-server-posix` * Container `rekor-tiles/posix` * Sequencing: Atomic POSIX operations * Tile storage: POSIX-compliant filesystem * Use case: Lower cost, easy to serve ### GCP CloudSQL + Cloud Storage * Binary: `rekor-server-gcpcloudsql` * Container `rekor-tiles/gcpcloudsql` * Sequencing: CloudSQL * Tile storage: Google Cloud Storage (GCS) * Use case: Alternative to Spanner sequencing, would only recommend if Spanner cannot be used To authenticate to GCS, you must create [HMAC access keys](https://docs.cloud.google.com/storage/docs/authentication/hmackeys) and set the following environment variables: * `GCS_HMAC_ACCESS_KEY_ID` * `GCS_HMAC_SECRET` * `GCS_REGION`, the region of the bucket * `GCS_ENDPOINT_URL`, which should equal `https://storage.googleapis.com` ## Public-good instance The Sigstore community hosts a productionized instance of Rekor v2 with a 99.5% availability SLO. See the [status page](https://status.sigstore.dev/) for uptime metrics. Use the public-good instance's TUF repository to determine the URL of the active instance. Note that the community instance's URL will change approximately every 6 months when we "shard" the log, creating a new log instance to keep the size of the log maintainable. Sigstore clients will pull the latest log shard URL from the TUF-distributed [SigningConfig](https://github.com/sigstore/root-signing/blob/main/targets/signing_config.v0.2.json), and will fetch both active and inactive shard public keys from the [TrustedRoot](https://github.com/sigstore/root-signing/blob/main/targets/trusted_root.json). As of October 2025, we have not yet distributed the current Rekor v2 URL in the SigningConfig, to give users adequate time to update their clients to support verifying entries from Rekor v2. We are planning to distribute the latest Rekor v2 URL by end of 2025/early 2026. If you want to start using Rekor v2, construct a signing config, using the [TUF-distributed signing config](https://github.com/sigstore/root-signing/blob/main/targets/signing_config.v0.2.json) as a base, and adding the following instance as the first entry in the `rekorTlogUrls` list: ```shell { "url": "https://log2025-1.rekor.sigstore.dev", "majorApiVersion": 2, "validFor": { "start": "2025-10-06T00:00:00Z" }, "operator": "sigstore.dev" }, ``` **Note**: We will eventually turn down the 2025 Rekor v2 instance when we deploy a 2026 instance. We strongly advise against hardcoding this URL into any pipelines that cannot be easily updated. ## Installation We provide prebuilt binaries and containers for private deployments. * Download the latest binary from [Releases](https://github.com/sigstore/rekor-tiles/releases) * Pull the latest container from [GHCR](https://github.com/sigstore/rekor-tiles/pkgs/container/rekor-tiles) * Install Rekor v2 via [Helm](https://github.com/sigstore/helm-charts/tree/main/charts/rekor-tiles) ## Security Reports If you find any issues, follow Sigstore's [security policy](https://github.com/sigstore/rekor-tiles/security/policy) to report them. ## Local Development ### Deployment Run `docker compose up --build --wait` to start the service along with emulated Google Cloud Storage and Spanner instances. Run `docker compose down` to turn down the service, or `docker compose down --volumes` to turn down the service and delete persisted tiles. ### Making a request Follow the [client documentation](https://github.com/sigstore/rekor-tiles/blob/main/CLIENTS.md#rekor-v2-the-bash-way) for constructing a request and parsing a response. ### Testing Run unit tests with `go test ./...`. Follow the [end-to-end test documentation](https://github.com/sigstore/rekor-tiles/blob/main/tests/README.md) for how to run integration tests against a local instance. ## Adding a storage backend Tessera supports multiple [storage backends](https://github.com/transparency-dev/tessera/tree/main/storage) for different cloud providers and infrastructure. We will add support in Rekor for different storage backends with user demand. Rekor will produce different binaries and containers for each storage backend. Binaries will be named `rekor-server-<backend>` and containers `github.com/sigstore/rekor-tiles/pkgs/container/rekor-tiles/<backend>`. To add support for a new backend, with the example below for the `gcp` backend from [PR #630](https://github.com/sigstore/rekor-tiles/pull/630): * Create a [backend-specific driver](https://github.com/sigstore/rekor-tiles/blob/d596e236da3ce44024986f24c34005714430dda5/internal/tessera/gcp/gcp.go) * If needed, create a [backend-specific signer/verifier](https://github.com/sigstore/rekor-tiles/blob/682236adf5e63118853b00c5bfa33ba36a381fce/internal/tessera/gcp/signerverifier/signerverifier.go). At a minimum, you should support the file-based signer/verifier. To support a KMS-backed key, import the cloud provider-specific driver ([example](https://github.com/sigstore/rekor-tiles/blob/682236adf5e63118853b00c5bfa33ba36a381fce/internal/tessera/gcp/signerverifier/signerverifier.go#L33)). * Create a [backend-specific main package](https://github.com/sigstore/rekor-tiles/tree/d596e236da3ce44024986f24c34005714430dda5/cmd/rekor-server/gcp) * Create a Docker compose file, and set the [`STORAGE_BACKEND`](https://github.com/sigstore/rekor-tiles/blob/d596e236da3ce44024986f24c34005714430dda5/compose.yml#L52-L53) arg for building the containerized binary * Add an [end-to-end test configuration](https://github.com/sigstore/rekor-tiles/blob/d596e236da3ce44024986f24c34005714430dda5/tests/e2e_test.go#L77-L93) * Add the binary to [goreleaser](https://github.com/sigstore/rekor-tiles/blob/d596e236da3ce44024986f24c34005714430dda5/.goreleaser.yaml#L30-L46) * Add the storage backend to the [matrix for container building](https://github.com/sigstore/rekor-tiles/blob/d596e236da3ce44024986f24c34005714430dda5/.github/workflows/build_container.yml#L51) * Update the [build test matrix](https://github.com/sigstore/rekor-tiles/blob/69bc24a7269a3a0b6d8df3f4938f6eb77c2194b9/.github/workflows/test.yml#L50) * Update the [end-to-end test matrix](https://github.com/sigstore/rekor-tiles/blob/69bc24a7269a3a0b6d8df3f4938f6eb77c2194b9/.github/workflows/test.yml#L115) * Add a [Makefile target](https://github.com/sigstore/rekor-tiles/blob/d596e236da3ce44024986f24c34005714430dda5/Makefile#L76-L77) and update [`make all`](https://github.com/sigstore/rekor-tiles/blob/d596e236da3ce44024986f24c34005714430dda5/Makefile#L18) * Once merged, update the list of [required tests](https://github.com/sigstore/community/blob/ff0761c37ab63c55f50609ed32c27e2bc9497572/github-sync/github-data/sigstore/repositories.yaml#L1513)

Security CI / CD
41 Github Stars