@intentius/chant-lexicon-azure 0.13.1 → 0.15.1
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/import/live-export.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/op/activities/az-apply.d.ts +130 -0
- package/dist/op/activities/az-apply.d.ts.map +1 -0
- package/dist/op/activities/azure.d.ts +37 -0
- package/dist/op/activities/azure.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +10 -0
- package/dist/op/activities/index.d.ts.map +1 -0
- package/dist/ownership.d.ts +11 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/serializer.d.ts.map +1 -1
- package/package.json +7 -2
- package/src/import/live-export.ts +2 -1
- package/src/lint/audit-catalog.ts +30 -0
- package/src/op/activities/az-apply.test.ts +331 -0
- package/src/op/activities/az-apply.ts +468 -0
- package/src/op/activities/azure.test.ts +22 -0
- package/src/op/activities/azure.ts +66 -0
- package/src/op/activities/index.ts +24 -0
- package/src/ownership.test.ts +19 -0
- package/src/ownership.ts +16 -0
- package/src/plugin.ts +2 -0
- package/src/serializer.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-export.d.ts","sourceRoot":"","sources":["../../src/import/live-export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"live-export.d.ts","sourceRoot":"","sources":["../../src/import/live-export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAKnF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,OAAO,EACrB,QAAQ,CAAC,EAAE,gBAAgB,EAC3B,KAAK,CAAC,EAAE,OAAO,GACd,gBAAgB,CAoBlB"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "c71f8c6d91577879032b9b5f2c0947e2671a9b3de1b482e835765e4d50cfd61a",
|
|
5
5
|
"meta.json": "4b9c0be734f8b4a5fbba3136e14aaa1ea73ff0ee93f2aa480db83e476ce727b5",
|
|
6
6
|
"types/index.d.ts": "d62c0fd7947ddf04a9126cc8bf44a9f4437f21cf8647fc812c022398f2c00d57",
|
|
7
7
|
"rules/hardcoded-location.ts": "a9b1d1cec93f2ca9c5206641f53fc9621cefcfd2c00b3ab89c194b30a75fa949",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"skills/chant-azure-patterns.md": "1a3bacfac612826b77332d2692a59195638db9f1b5e8ea2eda7579621d25f603",
|
|
34
34
|
"skills/chant-azure-aks.md": "2d4e0098c1a22b54ffadd410564d9df0f3a04cb4eb7c6261f20ae33106e7aca8"
|
|
35
35
|
},
|
|
36
|
-
"composite": "
|
|
36
|
+
"composite": "80f4f69fdccb61156444408efef97a404f529b3346e6ec8287a9a5f80320b713"
|
|
37
37
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The azure lexicon's `chant audit` catalog — metadata for the AZR* ARM
|
|
3
|
+
* post-synth rules. Contributed via `azurePlugin.auditCatalog()` (#687).
|
|
4
|
+
*/
|
|
5
|
+
import { type RuleMeta } from "@intentius/chant/audit/catalog";
|
|
6
|
+
export declare const azureAuditCatalog: 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,EAAa,KAAK,QAAQ,EAAkB,MAAM,gCAAgC,CAAC;AAI1F,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAqBtD,CAAC"}
|
package/dist/manifest.json
CHANGED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/** One ARM resource from a `deploymentTemplate.json` `resources[]`. */
|
|
2
|
+
export interface ArmResource {
|
|
3
|
+
type: string;
|
|
4
|
+
apiVersion: string;
|
|
5
|
+
name: string;
|
|
6
|
+
location?: string;
|
|
7
|
+
properties?: unknown;
|
|
8
|
+
sku?: unknown;
|
|
9
|
+
kind?: unknown;
|
|
10
|
+
tags?: Record<string, string>;
|
|
11
|
+
dependsOn?: unknown;
|
|
12
|
+
}
|
|
13
|
+
/** Injectable HTTP client — mirrors the GCP applier so tests avoid the network. */
|
|
14
|
+
export type AzHttp = (method: string, url: string, body?: unknown, signal?: AbortSignal) => Promise<{
|
|
15
|
+
status: number;
|
|
16
|
+
text: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Context for evaluating ARM template expressions. `deployed` holds the response
|
|
20
|
+
* bodies of resources already applied this run (keyed by evaluated name) so
|
|
21
|
+
* `reference()` resolves; `http`/`base` let `listKeys()` call the resource's
|
|
22
|
+
* key action.
|
|
23
|
+
*/
|
|
24
|
+
export interface ArmEvalCtx {
|
|
25
|
+
subscriptionId: string;
|
|
26
|
+
resourceGroup: string;
|
|
27
|
+
location: string;
|
|
28
|
+
deployed: Map<string, unknown>;
|
|
29
|
+
http: AzHttp;
|
|
30
|
+
base: string;
|
|
31
|
+
signal?: AbortSignal;
|
|
32
|
+
}
|
|
33
|
+
/** Evaluate an ARM expression string (`"[...]"`); a plain string is returned as-is. */
|
|
34
|
+
export declare function evalArmString(s: string, ctx: ArmEvalCtx): Promise<unknown>;
|
|
35
|
+
/** Recursively evaluate every string in a value against the ARM context. */
|
|
36
|
+
export declare function evalArm(value: unknown, ctx: ArmEvalCtx): Promise<unknown>;
|
|
37
|
+
/** Resource names this resource references via `resourceId('type','name')` / `reference('name')`. Pure. */
|
|
38
|
+
export declare function armDependencies(resource: ArmResource, names: Set<string>): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Topologically order ARM resources so a referenced resource is applied before
|
|
41
|
+
* the resource that references it. Names that are expressions are ordered as-is
|
|
42
|
+
* (they don't match a literal reference). Throws on a cycle. Pure.
|
|
43
|
+
*/
|
|
44
|
+
export declare function orderArmResources(resources: ArmResource[]): ArmResource[];
|
|
45
|
+
/** The ARM resource-ID PUT URL for a resource (name expression evaluated). */
|
|
46
|
+
export declare function armResourceUrl(resource: ArmResource, ctx: ArmEvalCtx): Promise<string>;
|
|
47
|
+
/** The ARM resource PUT body (location/properties/sku/kind/tags), expressions evaluated. */
|
|
48
|
+
export declare function armResourceBody(resource: ArmResource, ctx: ArmEvalCtx): Promise<Record<string, unknown>>;
|
|
49
|
+
export interface AzApplyArgs {
|
|
50
|
+
/** Path to a built ARM template (`deploymentTemplate.json`). */
|
|
51
|
+
templatePath: string;
|
|
52
|
+
/** Resource group to deploy into. */
|
|
53
|
+
resourceGroup: string;
|
|
54
|
+
/** Region for the resource group and `resourceGroup().location`. Default: `eastus`. */
|
|
55
|
+
location?: string;
|
|
56
|
+
/** ARM endpoint override (e.g. floci-az `http://localhost:4577`). Default: real Azure. */
|
|
57
|
+
endpoint?: string;
|
|
58
|
+
/** Subscription id. Default: floci-az's local subscription. */
|
|
59
|
+
subscriptionId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Delete chant-owned resources of a templated type that are no longer in the
|
|
62
|
+
* template (owned-only prune). Destructive — off by default. Foreign
|
|
63
|
+
* (non-chant) resources are never touched.
|
|
64
|
+
*/
|
|
65
|
+
prune?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The native Azure applier — read a built ARM template and PUT each resource
|
|
69
|
+
* directly to the ARM resource-CRUD API, in dependency order, resolving ARM
|
|
70
|
+
* expressions (including `reference()`/`listKeys()` against resources applied
|
|
71
|
+
* earlier this run). The Azure twin of `gcpApply`: it targets floci-az (which
|
|
72
|
+
* `az deployment` can't, floci-az having no deployments provider) or real Azure
|
|
73
|
+
* by endpoint override; the resource group is ensured first.
|
|
74
|
+
*/
|
|
75
|
+
export declare function azApply(args: AzApplyArgs, signal?: AbortSignal, http?: AzHttp): Promise<{
|
|
76
|
+
applied: Array<{
|
|
77
|
+
type: string;
|
|
78
|
+
name: string;
|
|
79
|
+
}>;
|
|
80
|
+
pruned: Array<{
|
|
81
|
+
type: string;
|
|
82
|
+
name: string;
|
|
83
|
+
deleted: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
}>;
|
|
86
|
+
/** The ownership tag azApply stamps on every resource it applies. */
|
|
87
|
+
export declare function chantOwnershipTags(): Record<string, string>;
|
|
88
|
+
/** Whether a resource's tags mark it chant-owned. */
|
|
89
|
+
export declare function isChantOwned(tags: Record<string, string> | null | undefined): boolean;
|
|
90
|
+
/** One resource from the ARM resource-group listing. */
|
|
91
|
+
export interface ArmListItem {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
tags?: Record<string, string>;
|
|
96
|
+
}
|
|
97
|
+
/** List the resources in the group via the ARM resource-list endpoint. */
|
|
98
|
+
export declare function listGroupResources(ctx: ArmEvalCtx, http?: AzHttp, signal?: AbortSignal): Promise<ArmListItem[]>;
|
|
99
|
+
/** Idempotently delete one ARM resource by type/name/apiVersion. A 404 means it is already gone. */
|
|
100
|
+
export declare function deleteArmResource(type: string, name: string, apiVersion: string, ctx: ArmEvalCtx, http?: AzHttp, signal?: AbortSignal): Promise<{
|
|
101
|
+
type: string;
|
|
102
|
+
name: string;
|
|
103
|
+
deleted: boolean;
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Owned-only prune: for each resource type present in the template, delete the
|
|
107
|
+
* chant-owned live resources of that type whose (evaluated) name is not in the
|
|
108
|
+
* template. Scoped to templated types — like the GCP applier — so a type chant
|
|
109
|
+
* isn't managing this run is left alone, and the type's `apiVersion` is taken
|
|
110
|
+
* from the template. Foreign (non-chant) resources are never touched.
|
|
111
|
+
*/
|
|
112
|
+
export declare function pruneArmOrphans(desired: ArmResource[], ctx: ArmEvalCtx, http?: AzHttp, signal?: AbortSignal): Promise<Array<{
|
|
113
|
+
type: string;
|
|
114
|
+
name: string;
|
|
115
|
+
deleted: boolean;
|
|
116
|
+
}>>;
|
|
117
|
+
/**
|
|
118
|
+
* The inverse of {@link azApply} — read a built ARM template and delete the
|
|
119
|
+
* resources it declares, in reverse dependency order (a referrer goes before the
|
|
120
|
+
* resource it references). Idempotent: already-absent resources are a no-op. The
|
|
121
|
+
* Azure twin of `gcpDelete`; `http` is injectable for tests.
|
|
122
|
+
*/
|
|
123
|
+
export declare function azDelete(args: AzApplyArgs, signal?: AbortSignal, http?: AzHttp): Promise<{
|
|
124
|
+
deleted: Array<{
|
|
125
|
+
type: string;
|
|
126
|
+
name: string;
|
|
127
|
+
deleted: boolean;
|
|
128
|
+
}>;
|
|
129
|
+
}>;
|
|
130
|
+
//# sourceMappingURL=az-apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"az-apply.d.ts","sourceRoot":"","sources":["../../../src/op/activities/az-apply.ts"],"names":[],"mappings":"AAQA,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,SAAS,CAAC,EA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sB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,GAAE,MAAoB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CASlI;AAED,oGAAoG;AACpG,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,UAAU,EACf,IAAI,GAAE,MAAoB,EAC1B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAM3D;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,WAAW,EAAE,EACtB,GAAG,EAAE,UAAU,EACf,IAAI,GAAE,MAAoB,EAC1B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,CAmBlE;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,WAAW,EACjB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,GAAE,MAAoB,GACzB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAsB/E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface AzGroupEnsureArgs {
|
|
2
|
+
/** Resource group name — the same value passed as `env` to a `arm` `nativeApply`. */
|
|
3
|
+
resourceGroup: string;
|
|
4
|
+
/** Azure region for the group. Default: `eastus`. */
|
|
5
|
+
location?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AzGroupDeleteArgs {
|
|
8
|
+
/** Resource group to delete. */
|
|
9
|
+
resourceGroup: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Build the `az group create` command. `az group create` is idempotent — a group
|
|
13
|
+
* that already exists is returned unchanged — so no existence check is needed.
|
|
14
|
+
* Pure — exported for testing.
|
|
15
|
+
*/
|
|
16
|
+
export declare function azGroupEnsureCommand(resourceGroup: string, location: string): string;
|
|
17
|
+
/** Build the `az group delete` command (non-blocking). Pure — exported for testing. */
|
|
18
|
+
export declare function azGroupDeleteCommand(resourceGroup: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Ensure an Azure resource group exists before an ARM deployment.
|
|
21
|
+
*
|
|
22
|
+
* `az deployment group create` (the `arm` target of `nativeApply`) fails if its
|
|
23
|
+
* resource group is absent — unlike CloudFormation, which creates its own stack.
|
|
24
|
+
* Run this before the apply. Uses fastIdempotent profile — 5m timeout.
|
|
25
|
+
*
|
|
26
|
+
* This targets real Azure (via the logged-in `az` context). Local emulation
|
|
27
|
+
* against floci-az awaits an upstream `Microsoft.Resources/deployments` provider
|
|
28
|
+
* (see #705); when that lands, an endpoint/custom-cloud override slots in here.
|
|
29
|
+
*/
|
|
30
|
+
export declare function azGroupEnsure(args: AzGroupEnsureArgs, signal?: AbortSignal): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Delete an Azure resource group and everything in it (non-blocking). A no-op
|
|
33
|
+
* success when the group is already gone. Uses fastIdempotent profile — 5m
|
|
34
|
+
* timeout (`--no-wait` returns immediately).
|
|
35
|
+
*/
|
|
36
|
+
export declare function azGroupDelete(args: AzGroupDeleteArgs, signal?: AbortSignal): Promise<void>;
|
|
37
|
+
//# sourceMappingURL=azure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure.d.ts","sourceRoot":"","sources":["../../../src/op/activities/azure.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,qFAAqF;IACrF,aAAa,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED,uFAAuF;AACvF,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhG;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure Op activities — resolved by the core activity registry when a project's
|
|
3
|
+
* `chant.config.ts` lists the `azure` lexicon. Contributes the resource-group
|
|
4
|
+
* lifecycle (`azGroupEnsure`/`azGroupDelete`) that an ARM `nativeApply` needs.
|
|
5
|
+
*/
|
|
6
|
+
export { azGroupEnsure, azGroupDelete, azGroupEnsureCommand, azGroupDeleteCommand } from "./azure.js";
|
|
7
|
+
export type { AzGroupEnsureArgs, AzGroupDeleteArgs } from "./azure.js";
|
|
8
|
+
export { azApply, azDelete, pruneArmOrphans, deleteArmResource, listGroupResources, chantOwnershipTags, isChantOwned, evalArm, evalArmString, armResourceUrl, armResourceBody, armDependencies, orderArmResources, } from "./az-apply.js";
|
|
9
|
+
export type { AzApplyArgs, ArmEvalCtx, ArmResource, ArmListItem, AzHttp } from "./az-apply.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACnG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpE,OAAO,EACL,OAAO,EACP,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The azure lexicon's ownership tag convention. Azure tag keys forbid `/`, so
|
|
3
|
+
* chant's markers use a hyphenated `chant-<name>` form (distinct from the
|
|
4
|
+
* label-based convention core keeps for k8s/gcp, and from AWS's `chant:<name>`).
|
|
5
|
+
* Core owns the generic stamp/detect logic (@intentius/chant/ownership); this is
|
|
6
|
+
* the azure-specific key naming it stamps.
|
|
7
|
+
*/
|
|
8
|
+
import type { ChannelKeys } from "@intentius/chant/ownership";
|
|
9
|
+
/** Azure tag keys for chant's ownership markers. */
|
|
10
|
+
export declare const AZURE_TAG_OWNERSHIP_KEYS: ChannelKeys;
|
|
11
|
+
//# sourceMappingURL=ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../src/ownership.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,EAAE,WAItC,CAAC"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,0BAA0B,CAAC;AAsB5E;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,aAuazB,CAAC"}
|
package/dist/serializer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAsC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAsC,MAAM,6BAA6B,CAAC;AAgZlG;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,UA0C7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-azure",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Azure lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"types": "./dist/detect.d.ts",
|
|
45
45
|
"default": "./src/detect.ts"
|
|
46
46
|
},
|
|
47
|
+
"./op/activities": {
|
|
48
|
+
"development": "./src/op/activities/index.ts",
|
|
49
|
+
"types": "./dist/op/activities/index.d.ts",
|
|
50
|
+
"default": "./src/op/activities/index.ts"
|
|
51
|
+
},
|
|
47
52
|
"./lint/post-synth": {
|
|
48
53
|
"development": "./src/lint/post-synth/index.ts",
|
|
49
54
|
"types": "./dist/lint/post-synth/index.d.ts",
|
|
@@ -69,6 +74,6 @@
|
|
|
69
74
|
"typescript": "^5.9.3"
|
|
70
75
|
},
|
|
71
76
|
"peerDependencies": {
|
|
72
|
-
"@intentius/chant": "^0.
|
|
77
|
+
"@intentius/chant": "^0.15.1"
|
|
73
78
|
}
|
|
74
79
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExportedTemplate, ResourceSelector } from "@intentius/chant/lexicon";
|
|
2
2
|
import { hasOwnershipMarker } from "@intentius/chant/ownership";
|
|
3
|
+
import { AZURE_TAG_OWNERSHIP_KEYS } from "../ownership";
|
|
3
4
|
import { ArmParser } from "./parser";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -35,7 +36,7 @@ export function parseExportedTemplate(
|
|
|
35
36
|
if (selector?.name !== undefined && r.logicalId !== selector.name) return false;
|
|
36
37
|
if (owned) {
|
|
37
38
|
const tags = (r.properties as { tags?: Record<string, unknown> }).tags;
|
|
38
|
-
if (!hasOwnershipMarker(tags,
|
|
39
|
+
if (!hasOwnershipMarker(tags, AZURE_TAG_OWNERSHIP_KEYS)) return false;
|
|
39
40
|
}
|
|
40
41
|
return true;
|
|
41
42
|
}),
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The azure lexicon's `chant audit` catalog — metadata for the AZR* ARM
|
|
3
|
+
* post-synth rules. Contributed via `azurePlugin.auditCatalog()` (#687).
|
|
4
|
+
*/
|
|
5
|
+
import { auditRule, type RuleMeta, type Authority } from "@intentius/chant/audit/catalog";
|
|
6
|
+
|
|
7
|
+
const AZ_SEC: Authority = { name: "Microsoft Cloud Security Benchmark", url: "https://learn.microsoft.com/en-us/security/benchmark/azure/" };
|
|
8
|
+
|
|
9
|
+
export const azureAuditCatalog: Record<string, RuleMeta> = {
|
|
10
|
+
AZR010: auditRule("AZR010", "report-only", "guidance", "Redundant dependsOn", "Remove dependsOn already implied by reference()/resourceId().", { category: "best-practice" }),
|
|
11
|
+
AZR011: auditRule("AZR011", "merge-worthy", "guidance", "Missing or invalid apiVersion", "Set a valid YYYY-MM-DD apiVersion on every resource.", { category: "correctness" }),
|
|
12
|
+
AZR012: auditRule("AZR012", "report-only", "guidance", "Deprecated API version", "Move to a current apiVersion.", { category: "best-practice" }),
|
|
13
|
+
AZR013: auditRule("AZR013", "merge-worthy", "guidance", "Resource missing location", "Add the required location property.", { category: "correctness" }),
|
|
14
|
+
AZR014: auditRule("AZR014", "merge-worthy", "guidance", "Storage account allows public blob access", "Set allowBlobPublicAccess to false.", { authority: [AZ_SEC] }),
|
|
15
|
+
AZR015: auditRule("AZR015", "merge-worthy", "guidance", "Storage account missing encryption", "Enable encryption services for data at rest.", { authority: [AZ_SEC] }),
|
|
16
|
+
AZR016: auditRule("AZR016", "report-only", "guidance", "Key Vault soft-delete not enabled", "Enable soft-delete.", { category: "best-practice" }),
|
|
17
|
+
AZR017: auditRule("AZR017", "report-only", "guidance", "Key Vault purge protection not enabled", "Enable purge protection.", { category: "best-practice" }),
|
|
18
|
+
AZR018: auditRule("AZR018", "report-only", "guidance", "SQL Server missing auditing", "Enable auditing for compliance and threat detection.", { category: "best-practice" }),
|
|
19
|
+
AZR019: auditRule("AZR019", "merge-worthy", "guidance", "SQL database missing TDE", "Enable Transparent Data Encryption.", { authority: [AZ_SEC] }),
|
|
20
|
+
AZR020: auditRule("AZR020", "report-only", "guidance", "App Service missing managed identity", "Enable a system- or user-assigned identity.", { category: "best-practice" }),
|
|
21
|
+
AZR021: auditRule("AZR021", "merge-worthy", "guidance", "App Service not HTTPS-only", "Set httpsOnly to true.", { authority: [AZ_SEC] }),
|
|
22
|
+
AZR022: auditRule("AZR022", "merge-worthy", "guidance", "App Service min TLS below 1.2", "Set minTlsVersion to 1.2+.", { authority: [AZ_SEC] }),
|
|
23
|
+
AZR023: auditRule("AZR023", "report-only", "guidance", "VM not using a managed disk", "Use a managed disk.", { category: "best-practice" }),
|
|
24
|
+
AZR024: auditRule("AZR024", "report-only", "guidance", "VM missing boot diagnostics", "Enable boot diagnostics.", { category: "best-practice" }),
|
|
25
|
+
AZR025: auditRule("AZR025", "report-only", "guidance", "AKS cluster missing RBAC", "Enable Kubernetes RBAC.", { category: "best-practice" }),
|
|
26
|
+
AZR026: auditRule("AZR026", "report-only", "guidance", "AKS cluster missing network policy", "Configure a networkPolicy.", { category: "best-practice" }),
|
|
27
|
+
AZR027: auditRule("AZR027", "merge-worthy", "guidance", "Container Registry admin user enabled", "Disable the admin user; use Azure AD / service principals.", { authority: [AZ_SEC] }),
|
|
28
|
+
AZR028: auditRule("AZR028", "report-only", "guidance", "Network interface missing NSG", "Associate an NSG to control traffic.", { category: "best-practice" }),
|
|
29
|
+
AZR029: auditRule("AZR029", "merge-worthy", "guidance", "Managed disk missing encryption", "Enable encryption for data at rest.", { authority: [AZ_SEC] }),
|
|
30
|
+
};
|