@adversarylabs/sdk 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +28 -19
- package/dist/index.d.ts +48 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +222 -132
- package/dist/index.js.map +1 -1
- package/package.json +18 -5
- package/schemas/adversary.run.v1.schema.json +275 -0
- package/templates/basic/.dockerignore +5 -0
- package/templates/basic/Dockerfile +11 -4
- package/templates/basic/README.md +3 -1
- package/templates/basic/adversary.yaml +1 -1
- package/templates/basic/npm-shrinkwrap.json +1309 -0
- package/templates/basic/package.json +4 -4
- package/templates/basic/src/index.ts +8 -1
- package/templates/basic/test/index.test.ts +0 -4
- package/schemas/adversary.findings.v1.schema.json +0 -80
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"test": "vitest run"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@adversarylabs/sdk": "^0.1.
|
|
12
|
+
"@adversarylabs/sdk": "^0.1.3"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/node": "^22.
|
|
16
|
-
"typescript": "^5.
|
|
17
|
-
"vitest": "^
|
|
15
|
+
"@types/node": "^22.20.1",
|
|
16
|
+
"typescript": "^5.9.3",
|
|
17
|
+
"vitest": "^4.1.10"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -3,6 +3,7 @@ import { Adversary, Severity } from "@adversarylabs/sdk";
|
|
|
3
3
|
|
|
4
4
|
const adversary = new Adversary({
|
|
5
5
|
name: "adversarylabs/basic",
|
|
6
|
+
review: { includeInformational: true },
|
|
6
7
|
});
|
|
7
8
|
|
|
8
9
|
adversary.rule("basic.ran", (ctx) => {
|
|
@@ -21,5 +22,11 @@ adversary.rule("basic.ran", (ctx) => {
|
|
|
21
22
|
export default adversary;
|
|
22
23
|
|
|
23
24
|
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
24
|
-
|
|
25
|
+
// Keep the published starter runnable with the bootstrap SDK pinned in its shrinkwrap.
|
|
26
|
+
// New projects use the explicit runtime adapter; older 0.x SDKs retain run() as that adapter.
|
|
27
|
+
if ("runFromEnvironment" in adversary) {
|
|
28
|
+
await adversary.runFromEnvironment();
|
|
29
|
+
} else {
|
|
30
|
+
await (adversary.run as unknown as () => Promise<unknown>)();
|
|
31
|
+
}
|
|
25
32
|
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://schemas.adversarylabs.com/adversary.findings.v1.schema.json",
|
|
4
|
-
"title": "Adversary Findings",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"additionalProperties": false,
|
|
7
|
-
"required": ["schema_version", "adversary", "summary", "findings"],
|
|
8
|
-
"properties": {
|
|
9
|
-
"schema_version": {
|
|
10
|
-
"const": "adversary.findings.v1"
|
|
11
|
-
},
|
|
12
|
-
"adversary": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"minLength": 1
|
|
15
|
-
},
|
|
16
|
-
"summary": {
|
|
17
|
-
"type": "object",
|
|
18
|
-
"additionalProperties": {
|
|
19
|
-
"type": ["number", "string", "boolean", "null"]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"findings": {
|
|
23
|
-
"type": "array",
|
|
24
|
-
"items": {
|
|
25
|
-
"$ref": "#/$defs/finding"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"$defs": {
|
|
30
|
-
"finding": {
|
|
31
|
-
"type": "object",
|
|
32
|
-
"additionalProperties": false,
|
|
33
|
-
"required": ["rule_id", "id", "severity", "title"],
|
|
34
|
-
"properties": {
|
|
35
|
-
"rule_id": {
|
|
36
|
-
"type": "string",
|
|
37
|
-
"minLength": 1
|
|
38
|
-
},
|
|
39
|
-
"id": {
|
|
40
|
-
"type": "string",
|
|
41
|
-
"minLength": 1
|
|
42
|
-
},
|
|
43
|
-
"severity": {
|
|
44
|
-
"enum": ["info", "low", "medium", "high", "critical"]
|
|
45
|
-
},
|
|
46
|
-
"title": {
|
|
47
|
-
"type": "string",
|
|
48
|
-
"minLength": 1
|
|
49
|
-
},
|
|
50
|
-
"message": {
|
|
51
|
-
"type": "string"
|
|
52
|
-
},
|
|
53
|
-
"path": {
|
|
54
|
-
"type": "string"
|
|
55
|
-
},
|
|
56
|
-
"file": {
|
|
57
|
-
"type": "string"
|
|
58
|
-
},
|
|
59
|
-
"line": {
|
|
60
|
-
"type": "integer",
|
|
61
|
-
"minimum": 1
|
|
62
|
-
},
|
|
63
|
-
"column": {
|
|
64
|
-
"type": "integer",
|
|
65
|
-
"minimum": 1
|
|
66
|
-
},
|
|
67
|
-
"evidence": {
|
|
68
|
-
"type": "string"
|
|
69
|
-
},
|
|
70
|
-
"recommendation": {
|
|
71
|
-
"type": "string"
|
|
72
|
-
},
|
|
73
|
-
"metadata": {
|
|
74
|
-
"type": "object",
|
|
75
|
-
"additionalProperties": true
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|