@absolutejs/vulnerabilities-ubuntu 0.1.0
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 +91 -0
- package/README.md +25 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +86 -0
- package/dist/manifest.d.ts +1 -0
- package/dist/manifest.js +30 -0
- package/dist/manifest.json +38 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
**Licensor:** Alex Kahn
|
|
4
|
+
|
|
5
|
+
**Licensed Work:** @absolutejs/vulnerabilities-ubuntu (https://github.com/absolutejs/vulnerabilities-ubuntu)
|
|
6
|
+
|
|
7
|
+
**Change Date:** July 18, 2030
|
|
8
|
+
|
|
9
|
+
**Change License:** Apache License, Version 2.0
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Terms
|
|
14
|
+
|
|
15
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
16
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
17
|
+
Licensor may make an Additional Use Grant, permitting limited production use.
|
|
18
|
+
|
|
19
|
+
### Additional Use Grant
|
|
20
|
+
|
|
21
|
+
You may use the Licensed Work in production, provided your use does not include
|
|
22
|
+
any of the following:
|
|
23
|
+
|
|
24
|
+
1. **Offering a Competing Service.** You may not offer the Licensed Work, or
|
|
25
|
+
any derivative or substantial portion of it, to third parties as a hosted or
|
|
26
|
+
managed vulnerability-management, exposure-management, container-security,
|
|
27
|
+
cloud-security-posture-management, or attack-surface-management service.
|
|
28
|
+
This includes any product whose primary value to its users is the
|
|
29
|
+
functionality the Licensed Work provides.
|
|
30
|
+
|
|
31
|
+
2. **Resale or Redistribution as a Standalone Product.** You may not sell,
|
|
32
|
+
license, or distribute the Licensed Work, or any derivative or fork of it,
|
|
33
|
+
as a standalone commercial product.
|
|
34
|
+
|
|
35
|
+
3. **Removal of Attribution.** Any derivative work, fork, or redistribution of
|
|
36
|
+
the Licensed Work must prominently credit AbsoluteJS and include a link to
|
|
37
|
+
the original project repository
|
|
38
|
+
(https://github.com/absolutejs/vulnerabilities-ubuntu).
|
|
39
|
+
|
|
40
|
+
For clarity, the following uses are expressly permitted:
|
|
41
|
+
|
|
42
|
+
- Using the Licensed Work to scan, inventory, gate, remediate, or report on
|
|
43
|
+
vulnerabilities in your own applications, websites, internal tools, or SaaS
|
|
44
|
+
products, so long as vulnerability management itself is not the primary
|
|
45
|
+
product you are selling.
|
|
46
|
+
- Using the Licensed Work as a dependency in commercial software you build and
|
|
47
|
+
sell, as long as that software is not a competing hosted security service of
|
|
48
|
+
the kind described in clause 1.
|
|
49
|
+
- Providing consulting, development, or professional services to clients using
|
|
50
|
+
the Licensed Work.
|
|
51
|
+
- Forking and modifying the Licensed Work for your own internal use, provided
|
|
52
|
+
attribution is maintained.
|
|
53
|
+
|
|
54
|
+
### Change Date and Change License
|
|
55
|
+
|
|
56
|
+
On the Change Date specified above, or on such other date as the Licensor may
|
|
57
|
+
specify by written notice, the Licensed Work will be made available under the
|
|
58
|
+
Change License (Apache License, Version 2.0). Until the Change Date, the terms
|
|
59
|
+
of this Business Source License 1.1 apply.
|
|
60
|
+
|
|
61
|
+
### Trademark
|
|
62
|
+
|
|
63
|
+
This license does not grant you any rights to use the "AbsoluteJS" or
|
|
64
|
+
"@absolutejs" name, logo, or any related trademarks. Forks and derivative works
|
|
65
|
+
must not be named or branded in a manner that suggests endorsement by or
|
|
66
|
+
affiliation with AbsoluteJS or the Licensor.
|
|
67
|
+
|
|
68
|
+
### Notices
|
|
69
|
+
|
|
70
|
+
You must not remove or obscure any licensing, copyright, or other notices
|
|
71
|
+
included in the Licensed Work.
|
|
72
|
+
|
|
73
|
+
### No Warranty
|
|
74
|
+
|
|
75
|
+
THE LICENSED WORK IS PROVIDED "AS IS". THE LICENSOR HEREBY DISCLAIMS ALL
|
|
76
|
+
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
|
|
77
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO
|
|
78
|
+
EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY,
|
|
79
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR
|
|
80
|
+
IN CONNECTION WITH THE LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE
|
|
81
|
+
LICENSED WORK.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Contact
|
|
86
|
+
|
|
87
|
+
For commercial licensing inquiries or additional permissions, contact:
|
|
88
|
+
|
|
89
|
+
- **Alex Kahn**
|
|
90
|
+
- alexkahndev@gmail.com
|
|
91
|
+
- alexkahndev.github.io
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @absolutejs/vulnerabilities-ubuntu
|
|
2
|
+
|
|
3
|
+
Canonical Ubuntu OSV intelligence for `@absolutejs/vulnerabilities`. The
|
|
4
|
+
adapter queries exact Ubuntu ecosystems, source package names, and full Debian
|
|
5
|
+
package versions through the official central OSV API. It preserves Canonical
|
|
6
|
+
vendor severity, upstream CVE aliases, distro revisions, affected ranges, and
|
|
7
|
+
links each normalized record back to Canonical's official OSV repository.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { createUbuntuAdapter } from "@absolutejs/vulnerabilities-ubuntu";
|
|
11
|
+
|
|
12
|
+
const adapter = createUbuntuAdapter({
|
|
13
|
+
components: [
|
|
14
|
+
{
|
|
15
|
+
ecosystem: "Ubuntu:24.04:LTS",
|
|
16
|
+
name: "nginx",
|
|
17
|
+
version: "1.24.0-2ubuntu7.5",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The ecosystem and full distribution version are never reduced to generic
|
|
24
|
+
SemVer. That prevents upstream-only comparisons from incorrectly flagging
|
|
25
|
+
Canonical security backports as vulnerable.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { FeedAdapter, VulnerabilityAdvisory } from "@absolutejs/vulnerabilities";
|
|
2
|
+
import { type OsvFetch } from "@absolutejs/vulnerabilities-osv";
|
|
3
|
+
export declare const UBUNTU_OSV_URL = "https://security-metadata.canonical.com/osv/";
|
|
4
|
+
export declare const UBUNTU_OSV_REPOSITORY = "https://github.com/canonical/ubuntu-security-notices";
|
|
5
|
+
export type UbuntuComponent = {
|
|
6
|
+
ecosystem: `Ubuntu:${string}`;
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const canonicalUbuntuOsvUrl: (id: string) => string;
|
|
11
|
+
export declare const normalizeUbuntuOsvAdvisory: (input: unknown, fetchedAt: string) => {
|
|
12
|
+
affected?: {
|
|
13
|
+
package: {
|
|
14
|
+
ecosystem: string;
|
|
15
|
+
name: string;
|
|
16
|
+
purl: string | null;
|
|
17
|
+
};
|
|
18
|
+
ranges: {
|
|
19
|
+
events: {
|
|
20
|
+
fixed?: string | undefined;
|
|
21
|
+
introduced?: string | undefined;
|
|
22
|
+
lastAffected?: string | undefined;
|
|
23
|
+
limit?: string | undefined;
|
|
24
|
+
}[];
|
|
25
|
+
repository: string | null;
|
|
26
|
+
type: "ecosystem" | "git" | "semver";
|
|
27
|
+
}[];
|
|
28
|
+
versions: string[];
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
aliases: string[];
|
|
31
|
+
contract: 1;
|
|
32
|
+
details: string | null;
|
|
33
|
+
id: string;
|
|
34
|
+
modifiedAt: string;
|
|
35
|
+
publishedAt: string | null;
|
|
36
|
+
severity: {
|
|
37
|
+
score: number | null;
|
|
38
|
+
system: "cvss-v2" | "cvss-v3" | "cvss-v4" | "vendor" | "unknown";
|
|
39
|
+
value: "unknown" | "critical" | "high" | "medium" | "low" | "negligible";
|
|
40
|
+
vector: string | null;
|
|
41
|
+
}[];
|
|
42
|
+
source: {
|
|
43
|
+
name: string;
|
|
44
|
+
fetchedAt: string;
|
|
45
|
+
revision: string | null;
|
|
46
|
+
url: string | null;
|
|
47
|
+
};
|
|
48
|
+
summary: string;
|
|
49
|
+
withdrawnAt: string | null;
|
|
50
|
+
};
|
|
51
|
+
export declare const createUbuntuAdapter: (options: {
|
|
52
|
+
components: readonly UbuntuComponent[];
|
|
53
|
+
fetch?: OsvFetch;
|
|
54
|
+
}) => FeedAdapter<VulnerabilityAdvisory>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/index.ts
|
|
3
|
+
import {
|
|
4
|
+
OSV_API_URL,
|
|
5
|
+
createOsvAdapter,
|
|
6
|
+
normalizeOsvAdvisory
|
|
7
|
+
} from "@absolutejs/vulnerabilities-osv";
|
|
8
|
+
var UBUNTU_OSV_URL = "https://security-metadata.canonical.com/osv/";
|
|
9
|
+
var UBUNTU_OSV_REPOSITORY = "https://github.com/canonical/ubuntu-security-notices";
|
|
10
|
+
var requireText = (value, label) => {
|
|
11
|
+
const normalized = value.trim();
|
|
12
|
+
if (normalized.length === 0)
|
|
13
|
+
throw new Error(`${label} is required`);
|
|
14
|
+
return normalized;
|
|
15
|
+
};
|
|
16
|
+
var canonicalUbuntuOsvUrl = (id) => {
|
|
17
|
+
const normalized = requireText(id, "Ubuntu advisory id");
|
|
18
|
+
const encoded = encodeURIComponent(normalized);
|
|
19
|
+
const cve = /^UBUNTU-CVE-(\d{4})-/.exec(normalized);
|
|
20
|
+
if (cve?.[1])
|
|
21
|
+
return `https://raw.githubusercontent.com/canonical/ubuntu-security-notices/main/osv/cve/${cve[1]}/${encoded}.json`;
|
|
22
|
+
if (/^USN-/.test(normalized))
|
|
23
|
+
return `https://raw.githubusercontent.com/canonical/ubuntu-security-notices/main/osv/usn/${encoded}.json`;
|
|
24
|
+
if (/^LSN-/.test(normalized))
|
|
25
|
+
return `https://raw.githubusercontent.com/canonical/ubuntu-security-notices/main/osv/lsn/${encoded}.json`;
|
|
26
|
+
return `${OSV_API_URL}/vulns/${encoded}`;
|
|
27
|
+
};
|
|
28
|
+
var normalizeUbuntuOsvAdvisory = (input, fetchedAt) => normalizeOsvAdvisory(input, {
|
|
29
|
+
fetchedAt,
|
|
30
|
+
sourceName: "ubuntu",
|
|
31
|
+
sourceUrl: canonicalUbuntuOsvUrl
|
|
32
|
+
});
|
|
33
|
+
var createUbuntuAdapter = (options) => {
|
|
34
|
+
if (options.components.length === 0)
|
|
35
|
+
throw new Error("At least one Ubuntu component is required");
|
|
36
|
+
const components = options.components.map((component) => {
|
|
37
|
+
const ecosystem = requireText(component.ecosystem, "Ubuntu ecosystem");
|
|
38
|
+
if (!ecosystem.startsWith("Ubuntu:"))
|
|
39
|
+
throw new Error("Ubuntu ecosystem must start with Ubuntu:");
|
|
40
|
+
return {
|
|
41
|
+
ecosystem,
|
|
42
|
+
name: requireText(component.name, "Ubuntu package name"),
|
|
43
|
+
version: requireText(component.version, "Ubuntu package version")
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const osv = createOsvAdapter({
|
|
47
|
+
...options.fetch ? { fetch: options.fetch } : {},
|
|
48
|
+
queries: components.map(({ ecosystem, name, version }) => ({
|
|
49
|
+
package: { ecosystem, name },
|
|
50
|
+
version
|
|
51
|
+
}))
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
descriptor: {
|
|
55
|
+
id: "ubuntu",
|
|
56
|
+
name: "Canonical Ubuntu OSV",
|
|
57
|
+
url: UBUNTU_OSV_URL
|
|
58
|
+
},
|
|
59
|
+
fetch: async (request) => {
|
|
60
|
+
const result = await osv.fetch(request);
|
|
61
|
+
if (result.status === "not_modified")
|
|
62
|
+
return result;
|
|
63
|
+
return {
|
|
64
|
+
...result,
|
|
65
|
+
records: result.records.map((record) => ({
|
|
66
|
+
...record,
|
|
67
|
+
value: {
|
|
68
|
+
...record.value,
|
|
69
|
+
source: {
|
|
70
|
+
...record.value.source,
|
|
71
|
+
name: "ubuntu",
|
|
72
|
+
url: canonicalUbuntuOsvUrl(record.id)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}))
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
normalizeUbuntuOsvAdvisory,
|
|
82
|
+
createUbuntuAdapter,
|
|
83
|
+
canonicalUbuntuOsvUrl,
|
|
84
|
+
UBUNTU_OSV_URL,
|
|
85
|
+
UBUNTU_OSV_REPOSITORY
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifest: import("@absolutejs/manifest").PackageManifest<Record<string, never>, never>;
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/manifest.ts
|
|
3
|
+
import { defineManifest } from "@absolutejs/manifest";
|
|
4
|
+
import { Type } from "@sinclair/typebox";
|
|
5
|
+
var manifest = defineManifest()({
|
|
6
|
+
contract: 2,
|
|
7
|
+
discovery: {
|
|
8
|
+
audiences: ["platform-operators", "security-teams"],
|
|
9
|
+
intents: [
|
|
10
|
+
"query official Ubuntu vulnerability data",
|
|
11
|
+
"correlate Ubuntu package versions with Canonical advisories",
|
|
12
|
+
"preserve Ubuntu vendor security status"
|
|
13
|
+
],
|
|
14
|
+
keywords: ["Ubuntu", "Canonical", "CVE", "USN", "OSV"],
|
|
15
|
+
protocols: ["Ubuntu OSV", "OSV API v1"]
|
|
16
|
+
},
|
|
17
|
+
identity: {
|
|
18
|
+
accent: "#e95420",
|
|
19
|
+
category: "operations",
|
|
20
|
+
description: "Canonical Ubuntu OSV ingestion with distribution-version fidelity and official record provenance.",
|
|
21
|
+
docsUrl: "https://github.com/absolutejs/vulnerabilities-ubuntu",
|
|
22
|
+
name: "@absolutejs/vulnerabilities-ubuntu",
|
|
23
|
+
tagline: "Evaluate Ubuntu packages against Canonical's own intelligence."
|
|
24
|
+
},
|
|
25
|
+
settings: Type.Object({}),
|
|
26
|
+
wiring: []
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
manifest
|
|
30
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": 2,
|
|
3
|
+
"discovery": {
|
|
4
|
+
"audiences": [
|
|
5
|
+
"platform-operators",
|
|
6
|
+
"security-teams"
|
|
7
|
+
],
|
|
8
|
+
"intents": [
|
|
9
|
+
"query official Ubuntu vulnerability data",
|
|
10
|
+
"correlate Ubuntu package versions with Canonical advisories",
|
|
11
|
+
"preserve Ubuntu vendor security status"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"Ubuntu",
|
|
15
|
+
"Canonical",
|
|
16
|
+
"CVE",
|
|
17
|
+
"USN",
|
|
18
|
+
"OSV"
|
|
19
|
+
],
|
|
20
|
+
"protocols": [
|
|
21
|
+
"Ubuntu OSV",
|
|
22
|
+
"OSV API v1"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"identity": {
|
|
26
|
+
"accent": "#e95420",
|
|
27
|
+
"category": "operations",
|
|
28
|
+
"description": "Canonical Ubuntu OSV ingestion with distribution-version fidelity and official record provenance.",
|
|
29
|
+
"docsUrl": "https://github.com/absolutejs/vulnerabilities-ubuntu",
|
|
30
|
+
"name": "@absolutejs/vulnerabilities-ubuntu",
|
|
31
|
+
"tagline": "Evaluate Ubuntu packages against Canonical's own intelligence."
|
|
32
|
+
},
|
|
33
|
+
"settings": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {}
|
|
36
|
+
},
|
|
37
|
+
"wiring": []
|
|
38
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@absolutejs/vulnerabilities-ubuntu",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Canonical Ubuntu OSV advisory ingestion for AbsoluteJS vulnerability management.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "BSL-1.1",
|
|
7
|
+
"author": "Alex Kahn",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/absolutejs/vulnerabilities-ubuntu.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/absolutejs/vulnerabilities-ubuntu",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/absolutejs/vulnerabilities-ubuntu/issues"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"absolutejs": {
|
|
22
|
+
"manifestContract": 2
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./manifest": {
|
|
30
|
+
"types": "./dist/manifest.d.ts",
|
|
31
|
+
"import": "./dist/manifest.js"
|
|
32
|
+
},
|
|
33
|
+
"./manifest.json": "./dist/manifest.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"format": "prettier --write \"./**/*.{ts,json,md}\"",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"test": "bun test",
|
|
44
|
+
"build": "rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=bun --external @absolutejs/manifest --external @absolutejs/vulnerabilities --external @absolutejs/vulnerabilities-osv --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit",
|
|
45
|
+
"check:package": "bun run format && bun run typecheck && bun run test && bun run build"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"absolutejs",
|
|
49
|
+
"canonical",
|
|
50
|
+
"cve",
|
|
51
|
+
"ubuntu",
|
|
52
|
+
"usn"
|
|
53
|
+
],
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@absolutejs/manifest": "0.3.0",
|
|
56
|
+
"@absolutejs/vulnerabilities": "0.4.0",
|
|
57
|
+
"@absolutejs/vulnerabilities-osv": "0.1.2",
|
|
58
|
+
"@sinclair/typebox": "0.34.52"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@types/bun": "1.3.14",
|
|
62
|
+
"prettier": "3.8.1",
|
|
63
|
+
"typescript": "5.9.3"
|
|
64
|
+
}
|
|
65
|
+
}
|