Download and install the correct version of the CLI according to these instructions.
Configure the access token to the artifact server. If you don't have a token see these instructions.
export SEAL_TOKEN=<token># the access token for the server
Code examples
Here are some simple usage examples of the Seal CLI in the context of various package managers. Please note that the CLI replaces the vulnerable packages with their sealed versions. So the process is always:
Download the packages normally
Run the CLI
For relevant ecosystems - build the project
npm project
# Initialize an npm projectnpminit-y# Install example dependencynpminstallejs@2.7.4# Scan the manifest file for vulnerable packages and create a local configuration# file telling the CLI to fix the example dependencysealscan--generate-local-config# Note that a .seal-actions.yml file was created# Fix the example dependencies by replacing them with their sealed versionssealfix
pip project
# Create and activate Python virtual environmentpython3-mvenv.venvsource.venv/bin/activate# Install example dependencypipinstallpyjwt==1.7.1# Create the manifest filepipfreeze>requirements.txt# Scan the manifest file for vulnerable packages and create a local configuration# file telling the CLI to fix the example dependencysealscan--generate-local-config# Note that a .seal-actions.yml file was created# Fix the example dependencies by replacing them with their sealed versionssealfix
Maven project
# Create a new project using a Maven templatemvn archetype:generate -DgroupId=com.example.app -DartifactId=example-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
cdexample-app# Add example dependencysed -i '' -r "s/<dependencies>/<dependencies>\n <dependency>\n <groupId>com.fasterxml.jackson.core<\/groupId>\n <artifactId>jackson-databind<\/artifactId>\n <version>2.10.5.1<\/version>\n <\/dependency>/" pom.xml
# Resolve the project's dependenciesmvndependency:resolve# Scan the manifest file for vulnerable packages and create a local configuration# file telling the CLI to fix the example dependencysealscan--generate-local-config# Note that a .seal-actions.yml file was created# Fix the example dependencies by replacing them with their sealed versionssealfix# Build your project using the sealed versionsmvninstall
Composer project
# Initialize a Composer projectcomposerinit--nametest/project--type=project-n# Install example dependencycomposerrequirephpseclib/phpseclib=3.0.23# Scan the manifest file for vulnerable packages and create a local configuration# file telling the CLI to fix the example dependencysealscan--generate-local-config# Note that a .seal-actions.yml file was created# Fix the example dependencies by replacing them with their sealed versionssealfix