PackageIsInsecure is a fun little nix eval that maybe works.
(path string)
| 18 | |
| 19 | // PackageIsInsecure is a fun little nix eval that maybe works. |
| 20 | func PackageIsInsecure(path string) bool { |
| 21 | cmd := Command("eval", path+".meta.insecure") |
| 22 | out, err := cmd.Output(context.TODO()) |
| 23 | if err != nil { |
| 24 | // We can't know for sure, but probably not. |
| 25 | return false |
| 26 | } |
| 27 | var insecure bool |
| 28 | if err := json.Unmarshal(out, &insecure); err != nil { |
| 29 | // We can't know for sure, but probably not. |
| 30 | return false |
| 31 | } |
| 32 | return insecure |
| 33 | } |
| 34 | |
| 35 | func PackageKnownVulnerabilities(path string) []string { |
| 36 | cmd := Command("eval", path+".meta.knownVulnerabilities") |