Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs related to licence key changes #81

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,30 @@ Every [release](https://github.com/deepfence/package-scanner/releases) of packag

## Usage

Run this command to generate a license key. Work/official email id has to be used.
```shell
curl https://license.deepfence.io/threatmapper/generate-license?first_name=<FIRST_NAME>&last_name=<LAST_NAME>&email=<EMAIL>&company=<ORGANIZATION_NAME>&resend_email=true
```

### Image scan
Set product and licence key to download the vulnerability database needed for the scan

```shell
docker pull longhornio/csi-snapshotter:v6.2.1
export DEEPFENCE_PRODUCT=<ThreatMapper or ThreatStryker>
export DEEPFENCE_LICENSE=<ThreatMapper or ThreatStryker license key>
./package-scanner -source longhornio/csi-snapshotter:v6.2.1 -container-runtime docker

docker pull nginx:latest
export DEEPFENCE_PRODUCT=<ThreatMapper or ThreatStryker>
export DEEPFENCE_LICENSE=<ThreatMapper or ThreatStryker license key>
./package-scanner -source nginx:latest -severity critical
```

### Directory scan
```shell
export DEEPFENCE_PRODUCT=<ThreatMapper or ThreatStryker>
export DEEPFENCE_LICENSE=<ThreatMapper or ThreatStryker license key>
./package-scanner --source dir:<directory full path>
```

Expand All @@ -46,5 +59,5 @@ nginx latest 1403e55ab369 8 d
## Docker image standalone usage example
```
docker pull nginx:latest
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock --name package-scanner quay.io/deepfenceio/deepfence_package_scanner_cli:2.5.0 -source nginx:latest
docker run -it --rm -e DEEPFENCE_PRODUCT=<ThreatMapper or ThreatStryker> -e DEEPFENCE_LICENSE=<ThreatMapper or ThreatStryker license key> -v /var/run/docker.sock:/var/run/docker.sock --name package-scanner quay.io/deepfenceio/deepfence_package_scanner_cli:2.5.0 -source nginx:latest
```
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ var (
severities = []string{utils.CRITICAL, utils.HIGH, utils.MEDIUM, utils.LOW}
productENV = utils.GetEnvOrDefault("DEEPFENCE_PRODUCT", "ThreatMapper")
licenseENV = utils.GetEnvOrDefault("DEEPFENCE_LICENSE", "")
dfConsoleURL = utils.GetEnvOrDefault("DEEPFENCE_MGMT_CONSOLE_URL", "")
dfKey = utils.GetEnvOrDefault("DEEPFENCE_KEY", "")
version string
userCacheDir string
)
Expand All @@ -50,10 +52,10 @@ var (
port = flag.String("port", "", "Port for grpc server")
output = flag.String("output", utils.TableOutput, "Output format: json or table")
quiet = flag.Bool("quiet", false, "Don't display any output in stdout")
consoleURL = flag.String("console-url", "", "Deepfence Management Console URL")
consoleURL = flag.String("console-url", dfConsoleURL, "Deepfence Management Console URL")
consolePort = flag.Int("console-port", 443, "Deepfence Management Console Port")
vulnerabilityScan = flag.Bool("vulnerability-scan", false, "Publish SBOM to Deepfence Management Console and run Vulnerability Scan")
deepfenceKey = flag.String("deepfence-key", "", "Deepfence key for auth")
deepfenceKey = flag.String("deepfence-key", dfKey, "Deepfence key for auth")
source = flag.String("source", "", "Image name (nginx:latest) or directory (dir:/)")
scanType = flag.String("scan-type", "base,java,python,ruby,php,javascript,rust,rust-binary,golang,golang-binary,dotnet", "base,java,python,ruby,php,javascript,rust,rust-binary,golang,golang-binary,dotnet")
scanID = flag.String("scan-id", "", "(Optional) Scan id")
Expand Down
Loading