snyk-docker-plugin
- Version 6.13.18
- Published
- 712 kB
- 26 dependencies
- Apache-2.0 license
Install
npm i snyk-docker-plugin
yarn add snyk-docker-plugin
pnpm add snyk-docker-plugin
Overview
Snyk CLI docker plugin
Index
Functions
Interfaces
Enums
Type Aliases
Namespaces
facts
- AutoDetectedUserInstructionsFact
- DepGraphFact
- DockerfileAnalysisFact
- ImageCreationTimeFact
- ImageIdFact
- ImageLabels
- ImageLayersFact
- ImageManifestFilesFact
- ImageNamesFact
- ImageOsReleasePrettyNameFact
- ImageSizeBytesFact
- JarFingerprintsFact
- KeyBinariesHashesFact
- LoadedPackagesFact
- OCIDistributionMetadataFact
- RootFsFact
- TestedFilesFact
Functions
function analyseDockerfile
analyseDockerfile: (contents: string) => Promise<DockerFileAnalysis>;
function display
display: ( scanResults: ScanResult[], testResults: TestResult[], errors: string[], options?: Options) => Promise<string>;
function parseDockerfile
parseDockerfile: (content: string) => Dockerfile;
function scan
scan: (options?: Partial<PluginOptions>) => Promise<PluginResponse>;
function updateDockerfileBaseImageName
updateDockerfileBaseImageName: ( contents: string, newBaseImageName: string) => UpdateDockerfileBaseImageNameResult;
Updates the image name of the last from stage, after resolving all aliases
Parameter contents
Contents of the Dockerfile to update
Parameter newBaseImageName
New base image name Dockerfile contents should be updated to
Interfaces
interface AutoDetectedUserInstructions
interface AutoDetectedUserInstructions {}
property dockerfileLayers
dockerfileLayers: DockerFileLayers;
property dockerfilePackages
dockerfilePackages: DockerFilePackages;
interface ContainerTarget
interface ContainerTarget {}
property image
image: string;
interface DockerFileAnalysis
interface DockerFileAnalysis {}
property baseImage
baseImage?: string;
property dockerfileLayers
dockerfileLayers: DockerFileLayers;
property dockerfilePackages
dockerfilePackages: DockerFilePackages;
property error
error?: { code: DockerFileAnalysisErrorCode;};
interface Fact
interface Fact {}
A collection of things that were found as part of a scan. As the developer and owner, you are responsible for defining and maintaining your own Facts. Examples of facts: a dependency graph, a list of file content hashes, Dockerfile analysis. See FactType.
interface Identity
interface Identity {}
The identity of a scan result allows to uniquely locate "what" you found. Any differences in the identity influences how a Project is created in Snyk and can result in a completely different Project (for example, if "args.targetFramework" differs).
property args
args?: { [key: string]: string };
property targetFile
targetFile?: string;
property type
type: string;
This used to be represented as "packageManager" but now can contain any sensible ecosystem type. Examples: dockerfile, cpp, terraform-module, deb, npm, and so on.
interface ManifestFile
interface ManifestFile {}
interface PluginResponse
interface PluginResponse {}
property scanResults
scanResults: ScanResult[];
The first result is guaranteed to be the OS dependencies scan result.
interface ScanResult
interface ScanResult {}
property facts
facts: Fact[];
Facts are the collection of things you found.
property identity
identity: Identity;
Identity defines "what" you found.
property name
name?: string;
User-friendly name to use as the name of the Project that Snyk creates.
property policy
policy?: string;
Contains the Snyk policy file content.
property target
target: ContainerTarget;
The target defines "where" you found this scan result.
Enums
enum DockerFileAnalysisErrorCode
enum DockerFileAnalysisErrorCode { BASE_IMAGE_NAME_NOT_FOUND = 'BASE_IMAGE_NAME_NOT_FOUND', BASE_IMAGE_NON_RESOLVABLE = 'BASE_IMAGE_NON_RESOLVABLE',}
member BASE_IMAGE_NAME_NOT_FOUND
BASE_IMAGE_NAME_NOT_FOUND = 'BASE_IMAGE_NAME_NOT_FOUND'
member BASE_IMAGE_NON_RESOLVABLE
BASE_IMAGE_NON_RESOLVABLE = 'BASE_IMAGE_NON_RESOLVABLE'
enum UpdateDockerfileBaseImageNameErrorCode
enum UpdateDockerfileBaseImageNameErrorCode { BASE_IMAGE_NAME_FRAGMENTED = 'BASE_IMAGE_NAME_FRAGMENTED', BASE_IMAGE_NAME_NOT_FOUND = 'BASE_IMAGE_NAME_NOT_FOUND', DOCKERFILE_GENERATION_FAILED = 'DOCKERFILE_GENERATION_FAILED',}
member BASE_IMAGE_NAME_FRAGMENTED
BASE_IMAGE_NAME_FRAGMENTED = 'BASE_IMAGE_NAME_FRAGMENTED'
member BASE_IMAGE_NAME_NOT_FOUND
BASE_IMAGE_NAME_NOT_FOUND = 'BASE_IMAGE_NAME_NOT_FOUND'
member DOCKERFILE_GENERATION_FAILED
DOCKERFILE_GENERATION_FAILED = 'DOCKERFILE_GENERATION_FAILED'
Type Aliases
type FactType
type FactType = | 'autoDetectedUserInstructions' | 'depGraph' | 'dockerfileAnalysis' | 'imageCreationTime' | 'imageId' | 'imageLabels' // Collects the file names of the individual .tar layers found in the scanned image. | 'imageLayers' // Package manager manifests (e.g. requirements.txt, Gemfile.lock) collected as part of an application scan. | 'imageManifestFiles' | 'imageNames' | 'imageOsReleasePrettyName' | 'imageSizeBytes' // Hashes of extracted *.jar binaries, hashed with sha1 algorithm | 'jarFingerprints' // Hashes of executables not installed by a package manager (e.g. if they were copied straight onto the image). | 'keyBinariesHashes' | 'loadedPackages' | 'ociDistributionMetadata' | 'rootFs' // Used for application dependencies scanning; shows which files were used in the analysis of the dependencies. | 'testedFiles';
Namespaces
namespace dockerFile
module 'lib/dockerfile/index.ts' {}
function analyseDockerfile
analyseDockerfile: (contents: string) => Promise<DockerFileAnalysis>;
function getDockerfileBaseImageName
getDockerfileBaseImageName: ( dockerfile: Dockerfile) => GetDockerfileBaseImageNameResult;
Return the image name of the last from stage, after resolving all aliases
Parameter dockerfile
Dockerfile to use for retrieving the last stage image name
function getPackagesFromDockerfile
getPackagesFromDockerfile: (dockerfile: Dockerfile) => DockerFilePackages;
function instructionDigest
instructionDigest: (instruction: any) => string;
function parseDockerfile
parseDockerfile: (content: string) => Dockerfile;
function readDockerfileAndAnalyse
readDockerfileAndAnalyse: ( dockerfilePath?: string) => Promise<DockerFileAnalysis | undefined>;
function updateDockerfileBaseImageName
updateDockerfileBaseImageName: ( contents: string, newBaseImageName: string) => UpdateDockerfileBaseImageNameResult;
Updates the image name of the last from stage, after resolving all aliases
Parameter contents
Contents of the Dockerfile to update
Parameter newBaseImageName
New base image name Dockerfile contents should be updated to
interface DockerFileAnalysis
interface DockerFileAnalysis {}
property baseImage
baseImage?: string;
property dockerfileLayers
dockerfileLayers: DockerFileLayers;
property dockerfilePackages
dockerfilePackages: DockerFilePackages;
property error
error?: { code: DockerFileAnalysisErrorCode;};
namespace facts
module 'lib/facts.ts' {}
interface AutoDetectedUserInstructionsFact
interface AutoDetectedUserInstructionsFact {}
interface DepGraphFact
interface DepGraphFact {}
interface DockerfileAnalysisFact
interface DockerfileAnalysisFact {}
interface ImageCreationTimeFact
interface ImageCreationTimeFact {}
interface ImageIdFact
interface ImageIdFact {}
interface ImageLabels
interface ImageLabels {}
interface ImageLayersFact
interface ImageLayersFact {}
interface ImageManifestFilesFact
interface ImageManifestFilesFact {}
interface ImageNamesFact
interface ImageNamesFact {}
interface ImageOsReleasePrettyNameFact
interface ImageOsReleasePrettyNameFact {}
interface ImageSizeBytesFact
interface ImageSizeBytesFact {}
interface JarFingerprintsFact
interface JarFingerprintsFact {}
interface KeyBinariesHashesFact
interface KeyBinariesHashesFact {}
interface LoadedPackagesFact
interface LoadedPackagesFact {}
interface OCIDistributionMetadataFact
interface OCIDistributionMetadataFact {}
interface RootFsFact
interface RootFsFact {}
interface TestedFilesFact
interface TestedFilesFact {}
Package Files (10)
Dependencies (26)
- @snyk/composer-lockfile-parser
- @snyk/dep-graph
- @snyk/docker-registry-v2-client
- @snyk/rpm-parser
- @snyk/snyk-docker-pull
- @swimlane/docker-reference
- adm-zip
- chalk
- debug
- docker-modem
- dockerfile-ast
- elfy
- event-loop-spinner
- gunzip-maybe
- mkdirp
- packageurl-js
- semver
- shescape
- snyk-nodejs-lockfile-parser
- snyk-poetry-lockfile-parser
- snyk-resolve-deps
- tar-stream
- tmp
- tslib
- uuid
- varint
Dev Dependencies (17)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/snyk-docker-plugin
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/snyk-docker-plugin)
- HTML<a href="https://www.jsdocs.io/package/snyk-docker-plugin"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 6346 ms. - Missing or incorrect documentation? Open an issue for this package.