Skip to content

Commit a106c07

Browse files
authored
update docs related to licence key changes (#81)
1 parent f2d99ca commit a106c07

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,30 @@ Every [release](https://github.com/deepfence/package-scanner/releases) of packag
1414

1515
## Usage
1616

17+
Run this command to generate a license key. Work/official email id has to be used.
18+
```shell
19+
curl https://license.deepfence.io/threatmapper/generate-license?first_name=<FIRST_NAME>&last_name=<LAST_NAME>&email=<EMAIL>&company=<ORGANIZATION_NAME>&resend_email=true
20+
```
21+
1722
### Image scan
23+
Set product and licence key to download the vulnerability database needed for the scan
24+
1825
```shell
1926
docker pull longhornio/csi-snapshotter:v6.2.1
27+
export DEEPFENCE_PRODUCT=<ThreatMapper or ThreatStryker>
28+
export DEEPFENCE_LICENSE=<ThreatMapper or ThreatStryker license key>
2029
./package-scanner -source longhornio/csi-snapshotter:v6.2.1 -container-runtime docker
2130
2231
docker pull nginx:latest
32+
export DEEPFENCE_PRODUCT=<ThreatMapper or ThreatStryker>
33+
export DEEPFENCE_LICENSE=<ThreatMapper or ThreatStryker license key>
2334
./package-scanner -source nginx:latest -severity critical
2435
```
2536

2637
### Directory scan
2738
```shell
39+
export DEEPFENCE_PRODUCT=<ThreatMapper or ThreatStryker>
40+
export DEEPFENCE_LICENSE=<ThreatMapper or ThreatStryker license key>
2841
./package-scanner --source dir:<directory full path>
2942
```
3043

@@ -46,5 +59,5 @@ nginx latest 1403e55ab369 8 d
4659
## Docker image standalone usage example
4760
```
4861
docker pull nginx:latest
49-
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
62+
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
5063
```

main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var (
3535
severities = []string{utils.CRITICAL, utils.HIGH, utils.MEDIUM, utils.LOW}
3636
productENV = utils.GetEnvOrDefault("DEEPFENCE_PRODUCT", "ThreatMapper")
3737
licenseENV = utils.GetEnvOrDefault("DEEPFENCE_LICENSE", "")
38+
dfConsoleURL = utils.GetEnvOrDefault("DEEPFENCE_MGMT_CONSOLE_URL", "")
39+
dfKey = utils.GetEnvOrDefault("DEEPFENCE_KEY", "")
3840
version string
3941
userCacheDir string
4042
)
@@ -50,10 +52,10 @@ var (
5052
port = flag.String("port", "", "Port for grpc server")
5153
output = flag.String("output", utils.TableOutput, "Output format: json or table")
5254
quiet = flag.Bool("quiet", false, "Don't display any output in stdout")
53-
consoleURL = flag.String("console-url", "", "Deepfence Management Console URL")
55+
consoleURL = flag.String("console-url", dfConsoleURL, "Deepfence Management Console URL")
5456
consolePort = flag.Int("console-port", 443, "Deepfence Management Console Port")
5557
vulnerabilityScan = flag.Bool("vulnerability-scan", false, "Publish SBOM to Deepfence Management Console and run Vulnerability Scan")
56-
deepfenceKey = flag.String("deepfence-key", "", "Deepfence key for auth")
58+
deepfenceKey = flag.String("deepfence-key", dfKey, "Deepfence key for auth")
5759
source = flag.String("source", "", "Image name (nginx:latest) or directory (dir:/)")
5860
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")
5961
scanID = flag.String("scan-id", "", "(Optional) Scan id")

0 commit comments

Comments
 (0)