Skip to content

Commit

Permalink
update docs related to licence key changes (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmahanth authored Dec 4, 2024
1 parent f2d99ca commit a106c07
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
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

0 comments on commit a106c07

Please sign in to comment.