Skip to content

Commit b115a35

Browse files
committed
change command names
1 parent fb32a92 commit b115a35

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

lunatrace/bsl/ingest-worker/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,43 @@
1313
-->
1414
# LunaTrace Go Services
1515

16+
## Vulnerabilities
17+
18+
### ML
19+
20+
#### Scrape
21+
Go through every vulnerability reference, scrape it, and store it to the db (vulns.db in the example command). The formatted content will end up in `normalized_content`.
22+
```shell
23+
go run cmd/ingestworker/main.go vulnerability process --db vulns.db scrape
24+
```
25+
26+
For scraping a specific vulnerability
27+
```shell
28+
go run cmd/ingestworker/main.go vulnerability process --db vulns.db scrape --vuln GHSA-9j49-mfvp-vmhm
29+
```
30+
31+
#### Embeddings
32+
33+
Make sure `.lunatrace.yaml` contains the following:
34+
```yaml
35+
openai:
36+
api_key: xxx
37+
pinecone:
38+
api_key: xxx
39+
environment: xxx
40+
index: xxx
41+
```
42+
43+
Generate embeddings for scraped references
44+
```shell
45+
go run cmd/ingestworker/main.go vulnerability process --db test.db embedding
46+
```
47+
48+
a specific vulnerability can be embedded
49+
```shell
50+
go run cmd/ingestworker/main.go vulnerability process --db test.db embedding --vuln GHSA-9j49-mfvp-vmhm
51+
```
52+
1653
## Setup analysiscli
1754
```shell
1855
go build -o bin/analysiscli cmd/analysiscli/main.go

lunatrace/bsl/ingest-worker/cmd/ingestworker/vulnerability/vulnerability.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ func NewCommand(p Params) clifx.CommandResult {
4747
},
4848
Subcommands: []*cli.Command{
4949
{
50-
Name: "cache",
50+
Name: "scrape",
5151
Flags: []cli.Flag{
5252
&cli.StringFlag{
5353
Name: "vuln",
54-
Usage: "Cache specific vulnerability.",
54+
Usage: "Scrape specific vulnerability.",
5555
Required: false,
5656
},
5757
},

lunatrace/bsl/ingest-worker/pkg/pineconefx/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
)
1717

1818
type Config struct {
19-
Enabled bool `yaml:"enabled"`
2019
APIKey string `yaml:"api_key"`
2120
Environment string `yaml:"environment"`
2221
Index string `yaml:"index"`

0 commit comments

Comments
 (0)