Skip to content

[snyk-cli] Add standalone binary installation method #236

Description

@brianpmccullough

Proposal

Add an installMethod option to the existing snyk-cli feature:

  • npm — current behavior and default for backward compatibility
  • standalone — download Snyk's published standalone executable

Example:

{
  "features": {
    "ghcr.io/devcontainers-extra/features/snyk-cli:1": {
      "installMethod": "standalone",
      "version": "latest"
    }
  }
}

Motivation

The current feature always installs Snyk through npm. This makes installation
dependent on Node/npm and on npm registry configuration visible to the root user
during the feature build.

For example, an existing private-registry or authentication configuration can
cause the feature build to fail with npm E401, even though Snyk itself is a
public package.

Snyk officially publishes standalone executables for:

  • Linux amd64
  • Linux arm64
  • Alpine amd64
  • Alpine arm64

It also publishes corresponding .sha256 files.

Proposed behavior

  • The standalone installation path would:
  • Select the appropriate Linux/Alpine and amd64/arm64 artifact.
  • Map version: latest to Snyk's stable release channel.
  • Support pinned versions with or without a leading v.
  • Download and verify the published SHA-256 checksum.
  • Install the executable at /usr/local/bin/snyk.
  • Avoid installing Node, npm, or Python.
  • Preserve npm as the default installation method.
  • Authentication would remain outside the feature installation.

Documentation

Standalone installation:
https://docs.snyk.io/developer-tools/snyk-cli/install-or-update-the-snyk-cli
Binary verification:
https://docs.snyk.io/developer-tools/snyk-cli/install-or-update-the-snyk-cli/verifying-cli-standalone-binaries

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions