Skip to content
Open
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
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ The default strategy is **NONE** which mean no strategy at all (we execute nothi
- [GitHub Advisory](./docs/github_advisory.md)
- [Sonatype OSS Index](./docs/sonatype.md)
- [OSV](./docs/osv.md)
- Snyk

Those strategies are described as "string" **type** with the following TypeScript definition:
```ts
type Kind = "github-advisory" | "snyk" | "sonatype" | "osv" | "none";
type Kind = "github-advisory" | "sonatype" | "osv" | "none";
```

To add a strategy or better understand how the code works, please consult [the following guide](./docs/adding_new_strategy.md).
Expand All @@ -71,7 +70,6 @@ function getStrategy(): AnyStrategy;

const strategies: Object.freeze({
GITHUB_ADVISORY: "github-advisory",
SNYK: "snyk",
SONATYPE: "sonatype",
OSV: "osv",
NONE: "none"
Expand Down Expand Up @@ -133,7 +131,6 @@ Where `dependencies` is the dependencies **Map()** object of the NodeSecure Scan
### Databases
- [OSV](./docs/database/osv.md)
- [NVD](./docs/database/nvd.md)
- [Snyk](./docs/database/snyk.md)
- [Sonatype](./docs/database/sonatype.md)

## Contributors ✨
Expand Down
1 change: 0 additions & 1 deletion docs/adding_new_strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ You must add a new constant in variable `VULN_MODE`
```js
export const VULN_MODE = Object.freeze({
GITHUB_ADVISORY: "github-advisory",
SNYK: "snyk",
SONATYPE: "sonatype",
NONE: "none",
MY_NEW_STRATEGY: "foobar" // <-- here
Expand Down
95 changes: 0 additions & 95 deletions docs/database/snyk.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/formats/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We provide a high-level format that works for all available strategies. It can b
export interface StandardVulnerability {
/** Unique identifier for the vulnerability **/
id?: string;
/** Vulnerability origin, either Snyk, Sonatype, GitHub or NodeSWG **/
/** Vulnerability origin, either Sonatype, GitHub or OSV **/
origin: Origin;
/** Package associated with the vulnerability **/
package: string;
Expand Down
1 change: 0 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export const NPM_TOKEN = typeof process.env.NODE_SECURE_TOKEN === "string" ?

export const VULN_MODE = Object.freeze({
GITHUB_ADVISORY: "github-advisory",
SNYK: "snyk",
SONATYPE: "sonatype",
OSV: "osv",
NONE: "none"
Expand Down
6 changes: 0 additions & 6 deletions src/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ export type {
OSVQueryBatchResponse
} from "./osv.ts";

export { Snyk } from "./snyk.ts";
export type {
SnykOptions,
SnykFindOneParameters
} from "./snyk.ts";

export { Sonatype } from "./sonatype.ts";
export type {
SonatypeOptions,
Expand Down
50 changes: 0 additions & 50 deletions src/database/snyk.ts

This file was deleted.

56 changes: 0 additions & 56 deletions src/formats/osv/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
} from "./index.ts";
import type {
SonatypeVulnerability,
SnykVulnerability,
NpmAuditAdvisory,
PnpmAuditAdvisory
} from "../../index.ts";
Expand Down Expand Up @@ -144,60 +143,6 @@ function mapFromPnpm(
};
}

function mapFromSnyk(
vuln: SnykVulnerability
): OSV {
return {
id: vuln.id,
modified: vuln.publicationTime,
published: vuln.disclosureTime ?? vuln.publicationTime,
aliases: vuln.identifiers.CVE ?? [],
upstream: [],
summary: vuln.title,
details: vuln.description,
severity: [
{ type: "CVSS_V3", score: vuln.CVSSv3 }
],
affected: [
{
package: {
ecosystem: "npm",
name: vuln.package,
purl: toPurl(vuln.package)
},
severity: [],
ranges: vuln.semver.vulnerable.map((range) => {
return {
type: "SEMVER",
events: semverRangeToOsvEvents(range),
database_specific: {}
};
}),
versions: vuln.functions.flatMap((f) => f.version),
ecosystem_specific: {},
database_specific: {}
}
],
references: [
{
type: "WEB",
url: vuln.url
}
],
credits: vuln.credit.map((name) => {
return {
name,
contact: [],
type: "FINDER" as const
};
}),
database_specific: {
severity: vuln.severity,
cvssScore: vuln.cvssScore
}
};
}

function mapFromSonatype(
vuln: SonatypeVulnerability
): OSV {
Expand Down Expand Up @@ -249,6 +194,5 @@ function mapFromSonatype(
export const OSV_VULN_MAPPERS = Object.freeze({
[VULN_MODE.GITHUB_ADVISORY]: mapFromNPM,
"github-advisory_pnpm": mapFromPnpm,
[VULN_MODE.SNYK]: mapFromSnyk,
[VULN_MODE.SONATYPE]: mapFromSonatype
});
95 changes: 0 additions & 95 deletions src/formats/snyk/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/formats/standard/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface StandardPatch {
export interface StandardVulnerability {
/** Unique identifier for the vulnerability **/
id?: string;
/** Vulnerability origin, either Snyk, Sonatype, GitHub or NodeSWG **/
/** Vulnerability origin, either Sonatype, GitHub or OSV **/
origin: Exclude<Kind, "none">;
/** Package associated with the vulnerability **/
package: string;
Expand Down
Loading
Loading