@intentius/chant-lexicon-docker 0.13.1 → 0.15.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/dist/generated/index.d.ts +6 -6
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/lint/audit-catalog.d.ts +7 -0
- package/dist/lint/audit-catalog.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/lint/audit-catalog.ts +16 -0
- package/src/plugin.ts +9 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const Service: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src
|
|
2
|
-
export declare const Volume: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src
|
|
3
|
-
export declare const Network: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src
|
|
4
|
-
export declare const DockerConfig: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src
|
|
5
|
-
export declare const DockerSecret: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src
|
|
6
|
-
export declare const Dockerfile: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src
|
|
1
|
+
export declare const Service: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
2
|
+
export declare const Volume: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
3
|
+
export declare const Network: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
4
|
+
export declare const DockerConfig: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
5
|
+
export declare const DockerSecret: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
6
|
+
export declare const Dockerfile: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,+IAA2D,CAAC;AAChF,eAAO,MAAM,MAAM,+IAA0D,CAAC;AAC9E,eAAO,MAAM,OAAO,+IAA2D,CAAC;AAChF,eAAO,MAAM,YAAY,+IAA0D,CAAC;AACpF,eAAO,MAAM,YAAY,+IAA0D,CAAC;AAEpF,eAAO,MAAM,UAAU,+IAAqD,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "d243db7d067d83ee66cd393ed8156b223d6c0038091edc1c1c30064f2b431ece",
|
|
5
5
|
"meta.json": "ae27dc809e705d37a645ee83b9789c50051282f7891d21d6b9e6ce8d111624ff",
|
|
6
6
|
"types/index.d.ts": "758f989ff86af54284d7f841a2db2259038d51ce1f3ed839a5d8e83fa20d95b8",
|
|
7
7
|
"rules/no-latest-tag.ts": "efd060453d8ca3d5b85c3972906c6650b6f63eb5f67cb6cdb0f16a41cad91228",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"skills/chant-docker.md": "3ff0708e3c76e245f202948949c768464563af2b60cc9aa2ca52f494ef8357f1",
|
|
16
16
|
"skills/chant-docker-patterns.md": "ad1b0196d8150b2df579a699ff107f604340c799c04f3460ebf65003e287b12a"
|
|
17
17
|
},
|
|
18
|
-
"composite": "
|
|
18
|
+
"composite": "d4d2a9bb431ffe9f26d52701bf0f3dc6bfb057bca2a9d7787297a6c1098f3836"
|
|
19
19
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The docker lexicon's `chant audit` catalog — metadata for the DKRD*
|
|
3
|
+
* Dockerfile/Compose post-synth rules. Contributed via `dockerPlugin.auditCatalog()` (#687).
|
|
4
|
+
*/
|
|
5
|
+
import { type RuleMeta } from "@intentius/chant/audit/catalog";
|
|
6
|
+
export declare const dockerAuditCatalog: Record<string, RuleMeta>;
|
|
7
|
+
//# sourceMappingURL=audit-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA+B,KAAK,QAAQ,EAAkB,MAAM,gCAAgC,CAAC;AAI5G,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAOvD,CAAC"}
|
package/dist/manifest.json
CHANGED
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAc7F,eAAO,MAAM,YAAY,EAAE,aA0O1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-docker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Docker lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -67,6 +67,6 @@
|
|
|
67
67
|
"typescript": "^5.9.3"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@intentius/chant": "^0.
|
|
70
|
+
"@intentius/chant": "^0.15.0"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The docker lexicon's `chant audit` catalog — metadata for the DKRD*
|
|
3
|
+
* Dockerfile/Compose post-synth rules. Contributed via `dockerPlugin.auditCatalog()` (#687).
|
|
4
|
+
*/
|
|
5
|
+
import { auditRule, SCORECARD_PINNED, type RuleMeta, type Authority } from "@intentius/chant/audit/catalog";
|
|
6
|
+
|
|
7
|
+
const DOCKER_SEC: Authority = { name: "Docker — Security best practices", url: "https://docs.docker.com/develop/security-best-practices/" };
|
|
8
|
+
|
|
9
|
+
export const dockerAuditCatalog: Record<string, RuleMeta> = {
|
|
10
|
+
DKRD001: auditRule("DKRD001", "merge-worthy", "guidance", "Service uses :latest or untagged image", "Pin the image to an explicit version tag (ideally a digest).", { authority: [SCORECARD_PINNED] }),
|
|
11
|
+
DKRD002: auditRule("DKRD002", "report-only", "guidance", "Named volume declared but unused", "Remove the unused volume or mount it in a service.", { category: "best-practice" }),
|
|
12
|
+
DKRD003: auditRule("DKRD003", "merge-worthy", "guidance", "Service exposes SSH (port 22)", "Don't expose SSH from a container; use exec/ephemeral access instead.", { authority: [DOCKER_SEC] }),
|
|
13
|
+
DKRD010: auditRule("DKRD010", "report-only", "guidance", "apt-get install without --no-install-recommends", "Add --no-install-recommends to keep images small.", { category: "best-practice" }),
|
|
14
|
+
DKRD011: auditRule("DKRD011", "report-only", "guidance", "ADD used where COPY would do", "Prefer COPY unless fetching a URL or extracting an archive.", { category: "best-practice" }),
|
|
15
|
+
DKRD012: auditRule("DKRD012", "merge-worthy", "guidance", "No USER instruction — container runs as root", "Add a non-root USER instruction.", { authority: [DOCKER_SEC] }),
|
|
16
|
+
};
|
package/src/plugin.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { LexiconPlugin, IntrinsicDef, InitTemplateSet } from "@intentius/ch
|
|
|
9
9
|
import { detectTemplate } from "./detect";
|
|
10
10
|
import type { LintRule } from "@intentius/chant/lint/rule";
|
|
11
11
|
import { postSynthChecks as postSynthCheckList } from "./lint/post-synth";
|
|
12
|
+
import { dockerAuditCatalog } from "./lint/audit-catalog";
|
|
12
13
|
import { createSkillsLoader, createDiffTool, createCatalogResource } from "@intentius/chant/lexicon-plugin-helpers";
|
|
13
14
|
import { join, dirname } from "path";
|
|
14
15
|
import { fileURLToPath } from "url";
|
|
@@ -20,6 +21,14 @@ import { DockerTemplateParser, DockerTemplateGenerator } from "./import/adapter"
|
|
|
20
21
|
|
|
21
22
|
export const dockerPlugin: LexiconPlugin = {
|
|
22
23
|
name: "docker",
|
|
24
|
+
auditCatalog: () => dockerAuditCatalog,
|
|
25
|
+
// Self-upgrade: the moby/moby tag embedded in the Engine API spec URL + its upstream (#685).
|
|
26
|
+
upstreamPin: {
|
|
27
|
+
file: "src/codegen/versions.ts",
|
|
28
|
+
pattern: /moby\/moby\/([^/]+)\/api\/swagger\.yaml/,
|
|
29
|
+
replace: (v, line) => line.replace(/moby\/moby\/[^/]+\/api\/swagger\.yaml/, `moby/moby/${v}/api/swagger.yaml`),
|
|
30
|
+
upstream: { owner: "moby", repo: "moby", kind: "releases" },
|
|
31
|
+
},
|
|
23
32
|
serializer: dockerSerializer,
|
|
24
33
|
|
|
25
34
|
lintRules(): LintRule[] {
|