@aaa-sentinel/iac-cost 0.8.0 → 0.9.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.
Files changed (3) hide show
  1. package/README.md +31 -1
  2. package/dist/cli.js +286 -58
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -7,7 +7,9 @@ internet is caught in review instead of after the deploy. With `iac-cost fix`, t
7
7
  your last scan on resources this Terraform manages come back to you as **pull requests**, not as
8
8
  console changes (see [Fixes as pull requests](#fixes-as-pull-requests)).
9
9
 
10
- > **New in 0.8.0:** `--fail-on-budget` fails the pull request when the change takes an AAA Sentinel budget over (see [Budget gate](#budget-gate)).
10
+ > **New in 0.9.0:** `iac-cost env-cost --env <name>` prints what an ephemeral environment has cost so far, resource by resource, with when its lease expires, and `--comment` posts it on the merge request (see [Environment cost](#environment-cost)).
11
+ >
12
+ > **In 0.8.0:** `--fail-on-budget` fails the pull request when the change takes an AAA Sentinel budget over (see [Budget gate](#budget-gate)).
11
13
  >
12
14
  > **In 0.7.0:** the plan check flags RDS and Aurora instances with `auto_minor_version_upgrade = false`
13
15
  > (CIS AWS 2.3.2; RDS Custom is skipped), and `iac-cost fix` turns it back on. Security findings have a
@@ -150,6 +152,34 @@ change and the projected total, in the budget's currency (`≈` when converted f
150
152
  npx --yes @aaa-sentinel/iac-cost plan.json --fail-on-budget --budget-account acc_9f2c1e
151
153
  ```
152
154
 
155
+ ## Environment cost
156
+
157
+ `iac-cost env-cost --env <name>` reads `GET /v1/environments/{env}/cost` and prints what an
158
+ ephemeral environment (the preview of a pull request, a load test) has cost so far. An environment
159
+ is every resource tagged `aaa-sentinel:env=<name>` (`aaa-sentinel_env` on GCP) or covered by an
160
+ AAA Sentinel lease with that `env`. For each resource it shows the type, account and region, its
161
+ monthly list cost, what it has cost over the days it has been alive, and when its lease expires.
162
+
163
+ ```bash
164
+ npx --yes @aaa-sentinel/iac-cost env-cost --env pr-412 # text table
165
+ npx --yes @aaa-sentinel/iac-cost env-cost --env pr-412 --format markdown > env.md
166
+ npx --yes @aaa-sentinel/iac-cost env-cost --env pr-412 --comment # GitLab merge request note
167
+ ```
168
+
169
+ | Option | Effect |
170
+ | --- | --- |
171
+ | `--env <name>` | Environment name: lowercase letters, digits, `.`, `_` or `-`, up to 63. Also `IAC_COST_ENV` |
172
+ | `--format <text\|markdown\|json>` | `text` by default, `markdown` with `--comment` |
173
+ | `--comment` | Posts the Markdown as a note on the GitLab merge request of the pipeline and updates it on later runs, like [`iac-cost comment`](#gitlab-ci) (needs `GITLAB_TOKEN`). It has its own marker, so it never replaces the plan cost note. On GitHub Actions and Bitbucket Pipelines, post stdout with the snippets below, changing the marker they look for to `<!-- aaa-sentinel:iac-cost-env -->` |
174
+
175
+ - **The amounts are an estimate**, not the bill: the list price of each resource in the last daily
176
+ scan, prorated over its days alive, in your organization currency and marked `≈`. A resource
177
+ created after the last scan, or tagged since, shows up after the next one; a resource without a
178
+ known list price shows `—` and does not add to the total.
179
+ - The OAuth2 application in `IAC_COST_CLIENT_ID` needs the `leases:read` scope (Pro plan or above).
180
+ - It always exits `0`, so a report can never fail the environment pipeline. Only a missing or
181
+ invalid `--env` or `--format` exits `2`.
182
+
153
183
  ## What actually leaves your machine
154
184
 
155
185
  Not the plan. `terraform show -json` output carries CIDRs, account identifiers and, often,
package/dist/cli.js CHANGED
@@ -16,6 +16,7 @@ var USAGE = `Usage: iac-cost [plan.json] [options]
16
16
  iac-cost fix [plan.json] --account <accountId> [options] (see iac-cost fix --help)
17
17
  iac-cost posture --account <accountId> [options] (see iac-cost posture --help)
18
18
  iac-cost comment [comment.md] (note on the GitLab merge request, see iac-cost comment --help)
19
+ iac-cost env-cost --env <name> [--comment] (estimated cost of an environment, see iac-cost env-cost --help)
19
20
 
20
21
  Reads \`terraform show -json\` output from the file or from stdin.
21
22
 
@@ -187,7 +188,7 @@ var GitLabError = class extends Error {
187
188
  this.status = status;
188
189
  }
189
190
  };
190
- async function gitLabCall(fetchImpl, url, token, init, label) {
191
+ async function gitLabCall(fetchImpl, url, token, init, label2) {
191
192
  const response = await fetchImpl(url, {
192
193
  method: init.method ?? "GET",
193
194
  headers: {
@@ -210,7 +211,7 @@ async function gitLabCall(fetchImpl, url, token, init, label) {
210
211
  } catch {
211
212
  detail = "";
212
213
  }
213
- throw new GitLabError(response.status, `${label} failed with HTTP ${response.status}${detail}`);
214
+ throw new GitLabError(response.status, `${label2} failed with HTTP ${response.status}${detail}`);
214
215
  }
215
216
  return response;
216
217
  }
@@ -328,6 +329,11 @@ async function runCommentCli(argv, io) {
328
329
  return skip(`could not read the comment, skipping: ${error2.message}`);
329
330
  }
330
331
  if (markdown.trim() === "") return skip("nothing to comment (empty input), the merge request is left as it is");
332
+ return postMergeRequestNote(markdown, io, COMMENT_MARKER, warnings);
333
+ }
334
+ async function postMergeRequestNote(markdown, io, marker, earlierWarnings = []) {
335
+ const warnings = [...earlierWarnings];
336
+ const skip = (message) => ({ stdout: null, warnings: [...warnings, message], exitCode: 0 });
331
337
  const { env } = io;
332
338
  if (env["GITLAB_CI"] !== "true") return skip("comment posts on GitLab merge requests and this is not a GitLab CI job, skipping (on GitHub and Bitbucket, use the README snippets)");
333
339
  const iid = env["CI_MERGE_REQUEST_IID"];
@@ -344,7 +350,7 @@ async function runCommentCli(argv, io) {
344
350
  if ("error" in server) return skip(`${server.error}, skipping the comment`);
345
351
  const fetchImpl = io.fetchImpl ?? fetch;
346
352
  const notesUrl = `${server.apiUrl}/projects/${target}/merge_requests/${iid}/notes`;
347
- const body2 = markdown.includes(COMMENT_MARKER) ? markdown : `${COMMENT_MARKER}
353
+ const body2 = markdown.includes(marker) ? markdown : `${marker}
348
354
  ${markdown}`;
349
355
  try {
350
356
  const me = await (await gitLabCall(fetchImpl, `${server.apiUrl}/user`, token, {}, "read token user")).json();
@@ -355,7 +361,7 @@ ${markdown}`;
355
361
  if (response.status === 404) throw new Error(`merge request !${iid} not found (does the token belong to this project?)`);
356
362
  const notes = await response.json();
357
363
  if (!Array.isArray(notes)) break;
358
- const mine = notes.find((n) => n.system !== true && n.author?.id === me.id && typeof n.body === "string" && n.body.includes(COMMENT_MARKER));
364
+ const mine = notes.find((n) => n.system !== true && n.author?.id === me.id && typeof n.body === "string" && n.body.includes(marker));
359
365
  if (mine && typeof mine.id === "number") existing = mine.id;
360
366
  if (response.headers.get("x-next-page") === "" || notes.length < 100) break;
361
367
  }
@@ -372,6 +378,9 @@ ${markdown}`;
372
378
  }
373
379
  }
374
380
 
381
+ // src/env-cost.ts
382
+ import { parseArgs as parseArgs3 } from "node:util";
383
+
375
384
  // ../../node_modules/zod/v4/core/util.js
376
385
  var util_exports = {};
377
386
  __export(util_exports, {
@@ -627,14 +636,14 @@ function promiseAllObject(promisesObj) {
627
636
  }
628
637
  function randomString(length = 10) {
629
638
  const chars = "abcdefghijklmnopqrstuvwxyz";
630
- let str = "";
639
+ let str2 = "";
631
640
  for (let i = 0; i < length; i++) {
632
- str += chars[Math.floor(Math.random() * chars.length)];
641
+ str2 += chars[Math.floor(Math.random() * chars.length)];
633
642
  }
634
- return str;
643
+ return str2;
635
644
  }
636
- function esc(str) {
637
- return JSON.stringify(str);
645
+ function esc(str2) {
646
+ return JSON.stringify(str2);
638
647
  }
639
648
  function slugify(input) {
640
649
  return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
@@ -748,8 +757,8 @@ var primitiveTypes = /* @__PURE__ */ new Set([
748
757
  "symbol",
749
758
  "undefined"
750
759
  ]);
751
- function escapeRegex(str) {
752
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
760
+ function escapeRegex(str2) {
761
+ return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
753
762
  }
754
763
  function clone(inst, def, params) {
755
764
  const cl = new inst._zod.constr(def ?? inst._zod.def);
@@ -1015,13 +1024,13 @@ function getSizableOrigin(input) {
1015
1024
  return "unknown";
1016
1025
  }
1017
1026
  var highSurrogate = /[\uD800-\uDBFF]/;
1018
- function codePointLength(str) {
1019
- const units = str.length;
1020
- if (!highSurrogate.test(str))
1027
+ function codePointLength(str2) {
1028
+ const units = str2.length;
1029
+ if (!highSurrogate.test(str2))
1021
1030
  return units;
1022
1031
  let count = units;
1023
1032
  for (let i = 0; i < units - 1; i++) {
1024
- if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
1033
+ if ((str2.charCodeAt(i) & 64512) === 55296 && (str2.charCodeAt(i + 1) & 64512) === 56320) {
1025
1034
  count--;
1026
1035
  i++;
1027
1036
  }
@@ -6840,12 +6849,224 @@ async function estimatePlan(projection, config2) {
6840
6849
  return aggregateEstimates(estimates);
6841
6850
  }
6842
6851
 
6852
+ // src/env-cost.ts
6853
+ var ENV_COST_USAGE = `Usage: iac-cost env-cost --env <name> [--comment] [--format text|markdown|json]
6854
+
6855
+ Prints the estimated cost of an AAA Sentinel environment (the resources tagged
6856
+ aaa-sentinel:env, or aaa-sentinel_env on GCP, or covered by a lease with that env):
6857
+ each resource, its monthly list cost, what it has cost so far over its days alive,
6858
+ and when its lease expires. The amounts are an estimate from list prices, in your
6859
+ organization currency, not the bill.
6860
+
6861
+ Options:
6862
+ --env <name> Environment name, e.g. pr-412 (also IAC_COST_ENV)
6863
+ --format <text|markdown|json>
6864
+ Output format (default: text; markdown with --comment)
6865
+ --comment Post the Markdown as a note on the GitLab merge request of
6866
+ this pipeline and update it on later runs, like
6867
+ iac-cost comment (needs GITLAB_TOKEN). On GitHub and
6868
+ Bitbucket, post stdout with the README snippets
6869
+ -h, --help Show this help
6870
+
6871
+ Environment:
6872
+ IAC_COST_CLIENT_ID / IAC_COST_CLIENT_SECRET
6873
+ OAuth2 application with the leases:read scope
6874
+ IAC_COST_BASE_URL API base URL (default https://api.aaa-sentinel.com)
6875
+
6876
+ It always exits 0, except for a missing or invalid --env (exit 2).`;
6877
+ var ENV_COST_MARKER = "<!-- aaa-sentinel:iac-cost-env -->";
6878
+ var SCOPE = "leases:read";
6879
+ var REQUEST_TIMEOUT_MS2 = 35e3;
6880
+ var RETRYABLE_STATUS2 = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
6881
+ var DEFAULT_BASE_URL = "https://api.aaa-sentinel.com";
6882
+ var ENV_RE = /^[a-z0-9][a-z0-9._-]{0,62}$/;
6883
+ var num = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
6884
+ var str = (v) => typeof v === "string" && v !== "" ? v : null;
6885
+ function mapEnvCostResponse(raw, env) {
6886
+ if (!raw || typeof raw !== "object") throw new Error("iac_cost_env_cost_malformed");
6887
+ const body2 = raw;
6888
+ if (!Array.isArray(body2["resources"])) throw new Error("iac_cost_env_cost_malformed");
6889
+ const resources = [];
6890
+ for (const item of body2["resources"]) {
6891
+ if (!item || typeof item !== "object") continue;
6892
+ const r = item;
6893
+ const resourceId = str(r["resourceId"]);
6894
+ if (!resourceId) continue;
6895
+ const name = str(r["name"]);
6896
+ resources.push({
6897
+ accountId: str(r["accountId"]) ?? "",
6898
+ resourceId,
6899
+ provider: str(r["provider"]) ?? "",
6900
+ type: str(r["type"]) ?? "",
6901
+ region: str(r["region"]) ?? "",
6902
+ ...name ? { name } : {},
6903
+ monthlyCost: num(r["monthlyCost"]),
6904
+ estimatedCost: num(r["estimatedCost"]),
6905
+ leaseId: str(r["leaseId"]),
6906
+ expiresAt: str(r["expiresAt"])
6907
+ });
6908
+ }
6909
+ return {
6910
+ env: str(body2["env"]) ?? env,
6911
+ currency: str(body2["currency"]) ?? "USD",
6912
+ // Siempre es una estimación de precio de lista: solo un `false` explícito lo quita.
6913
+ approximate: body2["approximate"] !== false,
6914
+ monthlyCost: num(body2["monthlyCost"]),
6915
+ estimatedCost: num(body2["estimatedCost"]),
6916
+ expiresAt: str(body2["expiresAt"]),
6917
+ resources
6918
+ };
6919
+ }
6920
+ async function fetchEnvironmentCost(config2, env) {
6921
+ const fetchImpl = config2.fetchImpl ?? fetch;
6922
+ const sleepImpl = config2.sleepImpl ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
6923
+ const token = await fetchToken(config2, SCOPE);
6924
+ for (let attempt = 0; attempt < 2; attempt++) {
6925
+ const response = await fetchImpl(`${config2.baseUrl}/v1/environments/${encodeURIComponent(env)}/cost`, {
6926
+ method: "GET",
6927
+ headers: { authorization: `Bearer ${token}` },
6928
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS2)
6929
+ });
6930
+ if (response.ok) return mapEnvCostResponse(await response.json(), env);
6931
+ if (response.status === 404) return "not_found";
6932
+ if (RETRYABLE_STATUS2.has(response.status) && attempt === 0) {
6933
+ await sleepImpl(1e3);
6934
+ continue;
6935
+ }
6936
+ const code2 = await apiErrorCode(response);
6937
+ throw new Error(`iac_cost_env_cost_http_${response.status}${code2 ? ` ${code2}` : ""}`);
6938
+ }
6939
+ throw new Error("iac_cost_env_cost_exhausted_retries");
6940
+ }
6941
+ function money(n, currency, approximate) {
6942
+ if (n === null) return "\u2014";
6943
+ let text;
6944
+ try {
6945
+ text = new Intl.NumberFormat("en-US", { style: "currency", currency }).format(n);
6946
+ } catch {
6947
+ text = `${n.toFixed(2)} ${currency}`;
6948
+ }
6949
+ return approximate ? `\u2248 ${text}` : text;
6950
+ }
6951
+ function expiryText(iso, now) {
6952
+ if (!iso) return "no lease";
6953
+ const t = Date.parse(iso);
6954
+ if (Number.isNaN(t)) return "no lease";
6955
+ const stamp = `${new Date(t).toISOString().slice(0, 16).replace("T", " ")} UTC`;
6956
+ const minutes = Math.round((t - now.getTime()) / 6e4);
6957
+ if (minutes <= 0) return `${stamp} (expired)`;
6958
+ const d = Math.floor(minutes / 1440);
6959
+ const h = Math.floor(minutes % 1440 / 60);
6960
+ const m = minutes % 60;
6961
+ const left = d > 0 ? `${d}d ${h}h` : h > 0 ? `${h}h ${m}m` : `${m}m`;
6962
+ return `${stamp} (in ${left})`;
6963
+ }
6964
+ var cell = (s) => s.replace(/[|\r\n`]+/g, " ").replace(/\s+/g, " ").trim();
6965
+ var label = (r) => r.name ? `${r.name} (${r.resourceId})` : r.resourceId;
6966
+ function renderEnvCostMarkdown(data, now) {
6967
+ const lines2 = [ENV_COST_MARKER, `### \u23F3 Environment \`${cell(data.env)}\``, ""];
6968
+ if (data.resources.length === 0) {
6969
+ lines2.push("No resources of this environment in the last inventory yet. New resources show up after the next daily scan.");
6970
+ return lines2.join("\n");
6971
+ }
6972
+ const approx = data.approximate;
6973
+ lines2.push(
6974
+ `**Cost so far:** ${money(data.estimatedCost, data.currency, approx)} \xB7 **Monthly at list price:** ${money(data.monthlyCost, data.currency, approx)} \xB7 **Expires:** ${expiryText(data.expiresAt, now)}`,
6975
+ "",
6976
+ "| Resource | Type | Account | Region | Monthly | So far | Expires |",
6977
+ "|---|---|---|---|---:|---:|---|"
6978
+ );
6979
+ for (const r of data.resources) {
6980
+ lines2.push(
6981
+ `| ${cell(label(r))} | ${cell(r.type)} | ${cell(r.accountId)} | ${cell(r.region)} | ${money(r.monthlyCost, data.currency, approx)} | ${money(r.estimatedCost, data.currency, approx)} | ${expiryText(r.expiresAt, now)} |`
6982
+ );
6983
+ }
6984
+ lines2.push("");
6985
+ if (approx) lines2.push("_\u2248 Estimate from list prices over each resource\u2019s days alive, in your organization currency: not the bill._");
6986
+ if (data.resources.some((r) => r.monthlyCost === null)) lines2.push("_\u2014 no known list price for that resource; it is not in the total._");
6987
+ return lines2.join("\n");
6988
+ }
6989
+ function pad(rows) {
6990
+ const widths = rows[0].map((_, i) => Math.max(...rows.map((row) => row[i].length)));
6991
+ return rows.map((row) => row.map((c, i) => c.padEnd(widths[i])).join(" ").trimEnd());
6992
+ }
6993
+ function renderEnvCostText(data, now) {
6994
+ const approx = data.approximate;
6995
+ const head = [
6996
+ `Environment ${data.env}`,
6997
+ ` Cost so far: ${money(data.estimatedCost, data.currency, approx)} Monthly at list price: ${money(data.monthlyCost, data.currency, approx)} Expires: ${expiryText(data.expiresAt, now)}`
6998
+ ];
6999
+ if (data.resources.length === 0) return [...head, " No resources of this environment in the last inventory yet."].join("\n");
7000
+ const rows = [
7001
+ ["RESOURCE", "TYPE", "ACCOUNT", "REGION", "MONTHLY", "SO FAR", "EXPIRES"],
7002
+ ...data.resources.map((r) => [
7003
+ label(r),
7004
+ r.type,
7005
+ r.accountId,
7006
+ r.region,
7007
+ money(r.monthlyCost, data.currency, approx),
7008
+ money(r.estimatedCost, data.currency, approx),
7009
+ expiryText(r.expiresAt, now)
7010
+ ])
7011
+ ];
7012
+ const tail = approx ? ["", "\u2248 estimate from list prices, not the bill."] : [];
7013
+ return [...head, "", ...pad(rows).map((line) => ` ${line}`), ...tail].join("\n");
7014
+ }
7015
+ async function runEnvCostCli(argv, io) {
7016
+ const warnings = [];
7017
+ const skip = (message) => ({ stdout: null, warnings: [...warnings, message], exitCode: 0 });
7018
+ const { values, positionals } = parseArgs3({
7019
+ args: [...argv],
7020
+ strict: false,
7021
+ allowPositionals: true,
7022
+ options: { env: { type: "string" }, format: { type: "string" }, comment: { type: "boolean" }, help: { type: "boolean", short: "h" } }
7023
+ });
7024
+ for (const name of Object.keys(values)) if (!["env", "format", "comment", "help", "h"].includes(name)) warnings.push(`unknown option --${name} ignored`);
7025
+ if (positionals.length > 0) warnings.push(`unexpected arguments ignored: ${positionals.join(" ")}`);
7026
+ if (values["help"] === true || values["h"] === true) return { stdout: ENV_COST_USAGE, warnings, exitCode: 0 };
7027
+ const rawEnv = typeof values["env"] === "string" ? values["env"] : io.env["IAC_COST_ENV"];
7028
+ const env = rawEnv?.trim().toLowerCase();
7029
+ if (!env || !ENV_RE.test(env)) {
7030
+ return { stdout: null, warnings: [...warnings, `${env ? `invalid --env "${env}"` : "--env is required"}: lowercase letters, digits, ".", "_" or "-", up to 63
7031
+
7032
+ ${ENV_COST_USAGE}`], exitCode: 2 };
7033
+ }
7034
+ const comment2 = values["comment"] === true;
7035
+ const format = typeof values["format"] === "string" ? values["format"] : comment2 ? "markdown" : "text";
7036
+ if (format !== "text" && format !== "markdown" && format !== "json") {
7037
+ return { stdout: null, warnings: [...warnings, `invalid --format "${format}": text, markdown or json
7038
+
7039
+ ${ENV_COST_USAGE}`], exitCode: 2 };
7040
+ }
7041
+ const baseUrl = resolveBaseUrl(io.env["IAC_COST_BASE_URL"] ?? DEFAULT_BASE_URL);
7042
+ if (!baseUrl) return skip("IAC_COST_BASE_URL must be an https URL, skipping the environment cost");
7043
+ const clientId = io.env["IAC_COST_CLIENT_ID"];
7044
+ const clientSecret = io.env["IAC_COST_CLIENT_SECRET"];
7045
+ if (!clientId || !clientSecret) return skip("IAC_COST_CLIENT_ID / IAC_COST_CLIENT_SECRET are not set, skipping the environment cost (the app needs the leases:read scope)");
7046
+ let data;
7047
+ try {
7048
+ data = await fetchEnvironmentCost(
7049
+ { baseUrl, clientId, clientSecret, ...io.fetchImpl ? { fetchImpl: io.fetchImpl } : {}, ...io.sleepImpl ? { sleepImpl: io.sleepImpl } : {} },
7050
+ env
7051
+ );
7052
+ } catch (error2) {
7053
+ return skip(`could not read the environment cost, continuing: ${error2.message}`);
7054
+ }
7055
+ if (data === "not_found") return skip(`environment "${env}" not found: no lease or tagged resource uses it yet (tags show up after the next daily scan)`);
7056
+ const now = (io.now ?? (() => /* @__PURE__ */ new Date()))();
7057
+ const markdown = renderEnvCostMarkdown(data, now);
7058
+ const stdout = format === "json" ? JSON.stringify(data, null, 2) : format === "markdown" ? markdown : renderEnvCostText(data, now);
7059
+ if (!comment2) return { stdout, warnings, exitCode: 0 };
7060
+ const posted = await postMergeRequestNote(markdown, io, ENV_COST_MARKER);
7061
+ return { stdout, warnings: [...warnings, ...posted.warnings, ...posted.stdout ? [posted.stdout] : []], exitCode: 0 };
7062
+ }
7063
+
6843
7064
  // src/fix/cli-fix.ts
6844
7065
  import path2 from "node:path";
6845
- import { parseArgs as parseArgs3 } from "node:util";
7066
+ import { parseArgs as parseArgs4 } from "node:util";
6846
7067
 
6847
7068
  // src/fix/api.ts
6848
- var SCOPE = "security:fix";
7069
+ var SCOPE2 = "security:fix";
6849
7070
  var TIMEOUT_MS2 = 35e3;
6850
7071
  var CodeFixApiError = class extends Error {
6851
7072
  constructor(status, code2, stage = "findings") {
@@ -6861,7 +7082,7 @@ function codeFixApi(config2) {
6861
7082
  let token = null;
6862
7083
  const bearer = async () => {
6863
7084
  try {
6864
- token ??= await fetchToken(config2, SCOPE);
7085
+ token ??= await fetchToken(config2, SCOPE2);
6865
7086
  } catch (error2) {
6866
7087
  if (error2 instanceof TokenHttpError) throw new CodeFixApiError(error2.status, error2.code, "token");
6867
7088
  throw error2;
@@ -6931,7 +7152,7 @@ var HostError = class extends Error {
6931
7152
  this.status = status;
6932
7153
  }
6933
7154
  };
6934
- async function call(fetchImpl, url, init, label) {
7155
+ async function call(fetchImpl, url, init, label2) {
6935
7156
  const response = await fetchImpl(url, { ...init, signal: AbortSignal.timeout(TIMEOUT_MS3) });
6936
7157
  if (!response.ok && response.status !== 404) {
6937
7158
  let detail = "";
@@ -6942,7 +7163,7 @@ async function call(fetchImpl, url, init, label) {
6942
7163
  } catch {
6943
7164
  detail = "";
6944
7165
  }
6945
- throw new HostError(response.status, `${label} failed with HTTP ${response.status}${detail}`);
7166
+ throw new HostError(response.status, `${label2} failed with HTTP ${response.status}${detail}`);
6946
7167
  }
6947
7168
  return response;
6948
7169
  }
@@ -6956,8 +7177,8 @@ function gitHubHost(config2) {
6956
7177
  "user-agent": "aaa-sentinel-iac-cost",
6957
7178
  "content-type": "application/json"
6958
7179
  };
6959
- const get = (path3, label) => call(fetchImpl, `${api}${path3}`, { headers }, label);
6960
- const post = (path3, body2, label) => call(fetchImpl, `${api}${path3}`, { method: "POST", headers, body: JSON.stringify(body2) }, label);
7180
+ const get = (path3, label2) => call(fetchImpl, `${api}${path3}`, { headers }, label2);
7181
+ const post = (path3, body2, label2) => call(fetchImpl, `${api}${path3}`, { method: "POST", headers, body: JSON.stringify(body2) }, label2);
6961
7182
  const owner = config2.repository.split("/")[0] ?? "";
6962
7183
  const stateOf = (pr) => typeof pr.merged_at === "string" && pr.merged_at !== "" ? "merged" : pr.state === "closed" ? "closed" : "open";
6963
7184
  return {
@@ -7026,7 +7247,7 @@ function bitbucketHost(config2) {
7026
7247
  const fetchImpl = config2.fetchImpl ?? fetch;
7027
7248
  const api = `${config2.apiUrl.replace(/\/+$/, "")}/repositories/${encodeURIComponent(config2.workspace)}/${encodeURIComponent(config2.repoSlug)}`;
7028
7249
  const auth = { authorization: `Bearer ${config2.token}`, accept: "application/json" };
7029
- const get = (path3, label) => call(fetchImpl, `${api}${path3}`, { headers: auth }, label);
7250
+ const get = (path3, label2) => call(fetchImpl, `${api}${path3}`, { headers: auth }, label2);
7030
7251
  const stateOf = (state) => state === "MERGED" ? "merged" : state === "OPEN" ? "open" : "closed";
7031
7252
  return {
7032
7253
  kind: "bitbucket",
@@ -7103,7 +7324,7 @@ var encodeGitLabPath = (value) => encodeURIComponent(value).replace(/\./g, "%2E"
7103
7324
  function gitLabHost(config2) {
7104
7325
  const fetchImpl = config2.fetchImpl ?? fetch;
7105
7326
  const api = `${config2.apiUrl}/projects/${encodeURIComponent(config2.projectId)}`;
7106
- const send = (path3, label, init = {}) => gitLabCall(fetchImpl, `${api}${path3}`, config2.token, init, label);
7327
+ const send = (path3, label2, init = {}) => gitLabCall(fetchImpl, `${api}${path3}`, config2.token, init, label2);
7107
7328
  const link = (iid) => pullRequestUrl("gitlab", config2.repository, iid, config2.server);
7108
7329
  const stateOf = (state) => state === "merged" ? "merged" : state === "closed" ? "closed" : "open";
7109
7330
  return {
@@ -7372,10 +7593,10 @@ function parseBody(text, start, end) {
7372
7593
  continue;
7373
7594
  }
7374
7595
  IDENT.lastIndex = j;
7375
- const label = IDENT.exec(text);
7376
- if (!label) throw new HclError(`unexpected token in block header at ${j}`);
7377
- labels.push(label[0]);
7378
- j += label[0].length;
7596
+ const label2 = IDENT.exec(text);
7597
+ if (!label2) throw new HclError(`unexpected token in block header at ${j}`);
7598
+ labels.push(label2[0]);
7599
+ j += label2[0].length;
7379
7600
  }
7380
7601
  const close = skipBalanced(text, j);
7381
7602
  if (close >= end) throw new HclError("block overflows its parent");
@@ -8869,7 +9090,7 @@ var VPC_INGRESS_RULE = {
8869
9090
  otherSources: [],
8870
9091
  singles: ["cidr_ipv4", "cidr_ipv6"]
8871
9092
  };
8872
- function judgeRule(text, block, items, shape, label) {
9093
+ function judgeRule(text, block, items, shape, label2) {
8873
9094
  const literalOfName = (name) => {
8874
9095
  const attr = attributeOf(items, name);
8875
9096
  return attr ? literalOf(text, attr) : void 0;
@@ -8935,7 +9156,7 @@ function judgeRule(text, block, items, shape, label) {
8935
9156
  const ports = fromPort !== null ? `port ${fromPort}` : "admin port";
8936
9157
  if (remaining.length === 0 && !others) {
8937
9158
  const attribute = shape === INLINE_RULE ? "ingress" : shape.lists[0] ?? shape.singles[0] ?? "ingress";
8938
- return { open: true, removesBlock: true, edits: [() => removeBlock(text, block)], attribute, changes: [`remove ${label} (${ports} open to the internet)`] };
9159
+ return { open: true, removesBlock: true, edits: [() => removeBlock(text, block)], attribute, changes: [`remove ${label2} (${ports} open to the internet)`] };
8939
9160
  }
8940
9161
  if (singles.length > 0) throw new Suggest("only_source", singles[0]?.name);
8941
9162
  return {
@@ -8943,7 +9164,7 @@ function judgeRule(text, block, items, shape, label) {
8943
9164
  removesBlock: false,
8944
9165
  attribute: lists.find(({ list }) => list.items.some((item) => OPEN_CIDRS.has(item.value)))?.attr.name ?? "cidr_blocks",
8945
9166
  edits: lists.filter(({ list }) => list.items.some((item) => OPEN_CIDRS.has(item.value))).map(({ attr, list }) => () => removeListItems(text, attr, list, (value) => OPEN_CIDRS.has(value))),
8946
- changes: lists.filter(({ list }) => list.items.some((item) => OPEN_CIDRS.has(item.value))).map(({ attr, list }) => `remove ${list.items.filter((i) => OPEN_CIDRS.has(i.value)).map((i) => `\`${i.value}\``).join(", ")} from \`${attr.name}\` in ${label} (${ports})`)
9167
+ changes: lists.filter(({ list }) => list.items.some((item) => OPEN_CIDRS.has(item.value))).map(({ attr, list }) => `remove ${list.items.filter((i) => OPEN_CIDRS.has(i.value)).map((i) => `\`${i.value}\``).join(", ")} from \`${attr.name}\` in ${label2} (${ports})`)
8947
9168
  };
8948
9169
  }
8949
9170
  function awsAdminOpen(ctx, builder) {
@@ -8953,8 +9174,8 @@ function awsAdminOpen(ctx, builder) {
8953
9174
  if (blocksOf(items, "dynamic").some((block) => block.labels[0] === "ingress")) throw new Suggest("dynamic_block", "ingress");
8954
9175
  if (attributeOf(items, "ingress")) throw new Suggest("value_from_expression", "ingress");
8955
9176
  let judged = 0;
8956
- const apply = (target, block, blockItems, shape, label, alignName = null) => {
8957
- const verdict = judgeRule(target.text, block, blockItems, shape, label);
9177
+ const apply = (target, block, blockItems, shape, label2, alignName = null) => {
9178
+ const verdict = judgeRule(target.text, block, blockItems, shape, label2);
8958
9179
  if (!verdict.open) return false;
8959
9180
  judged += 1;
8960
9181
  const lifecycleName = shape === INLINE_RULE ? "ingress" : verdict.removesBlock ? null : verdict.attribute;
@@ -9491,7 +9712,7 @@ Environment:
9491
9712
  async function runFixCli(argv, io) {
9492
9713
  const warnings = [];
9493
9714
  const fail = (message) => ({ stdout: null, warnings: [...warnings, message], exitCode: 2 });
9494
- const { values, positionals } = parseArgs3({
9715
+ const { values, positionals } = parseArgs4({
9495
9716
  args: [...argv],
9496
9717
  strict: false,
9497
9718
  allowPositionals: true,
@@ -9568,7 +9789,7 @@ ${FIX_USAGE}`);
9568
9789
  }
9569
9790
 
9570
9791
  // src/posture/posture.ts
9571
- import { parseArgs as parseArgs4 } from "node:util";
9792
+ import { parseArgs as parseArgs5 } from "node:util";
9572
9793
  var POSTURE_USAGE = `Usage: iac-cost posture --account <accountId> [options]
9573
9794
 
9574
9795
  Prints how the security posture of an AAA Sentinel account changed over a
@@ -9669,7 +9890,7 @@ async function fetchPostureHistory(config2) {
9669
9890
  async function runPostureCli(argv, io) {
9670
9891
  const warnings = [];
9671
9892
  const fail = (message) => ({ stdout: null, warnings: [...warnings, message], exitCode: 2 });
9672
- const { values, positionals } = parseArgs4({
9893
+ const { values, positionals } = parseArgs5({
9673
9894
  args: [...argv],
9674
9895
  strict: false,
9675
9896
  allowPositionals: true,
@@ -9864,18 +10085,18 @@ function parseTerraformPlan(plan) {
9864
10085
  }
9865
10086
 
9866
10087
  // src/budget.ts
9867
- var SCOPE2 = "budgets:read";
9868
- var REQUEST_TIMEOUT_MS2 = 35e3;
9869
- var RETRYABLE_STATUS2 = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
10088
+ var SCOPE3 = "budgets:read";
10089
+ var REQUEST_TIMEOUT_MS3 = 35e3;
10090
+ var RETRYABLE_STATUS3 = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
9870
10091
  async function checkBudgets(config2, input) {
9871
10092
  const fetchImpl = config2.fetchImpl ?? fetch;
9872
10093
  const sleepImpl = config2.sleepImpl ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
9873
- const token = await fetchToken(config2, SCOPE2);
10094
+ const token = await fetchToken(config2, SCOPE3);
9874
10095
  for (let attempt = 0; attempt < 2; attempt++) {
9875
10096
  const response = await fetchImpl(`${config2.baseUrl}/v1/budgets/check`, {
9876
10097
  method: "POST",
9877
10098
  headers: { authorization: `Bearer ${token}`, "content-type": "application/json" },
9878
- signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS2),
10099
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS3),
9879
10100
  body: JSON.stringify({ monthlyDeltaUsd: input.monthlyDeltaUsd, ...input.accountId ? { accountId: input.accountId } : {} })
9880
10101
  });
9881
10102
  if (response.ok) {
@@ -9883,7 +10104,7 @@ async function checkBudgets(config2, input) {
9883
10104
  if (!Array.isArray(body2.results)) throw new Error("iac_cost_budget_check_malformed");
9884
10105
  return { results: body2.results, approximate: body2.approximate === true };
9885
10106
  }
9886
- if (RETRYABLE_STATUS2.has(response.status) && attempt === 0) {
10107
+ if (RETRYABLE_STATUS3.has(response.status) && attempt === 0) {
9887
10108
  await sleepImpl(1e3);
9888
10109
  continue;
9889
10110
  }
@@ -9897,14 +10118,14 @@ function evaluateBudgetGate(response, mode) {
9897
10118
  const unresolved = response.results.filter((r) => r.status === "unresolved").length + (response.results.length === 0 ? 1 : 0);
9898
10119
  return { over, unresolved, blocks: over > 0 || mode === "strict" && unresolved > 0 };
9899
10120
  }
9900
- function money(n, currency) {
10121
+ function money2(n, currency) {
9901
10122
  try {
9902
10123
  return new Intl.NumberFormat("en-US", { style: "currency", currency }).format(n);
9903
10124
  } catch {
9904
10125
  return `${n.toFixed(2)} ${currency}`;
9905
10126
  }
9906
10127
  }
9907
- var signed = (n, currency) => `${n < 0 ? "-" : "+"}${money(Math.abs(n), currency)}`;
10128
+ var signed = (n, currency) => `${n < 0 ? "-" : "+"}${money2(Math.abs(n), currency)}`;
9908
10129
  function scopeText(scope) {
9909
10130
  if (scope.kind === "org") return "organization";
9910
10131
  if (scope.kind === "account") return `account ${scope.accountId}`;
@@ -9915,7 +10136,7 @@ var STATUS_TEXT = {
9915
10136
  over: "\u274C over budget",
9916
10137
  unresolved: "\u26A0\uFE0F no forecast yet"
9917
10138
  };
9918
- var cell = (s) => s.replace(/[|\r\n]+/g, " ").replace(/\s+/g, " ").trim();
10139
+ var cell2 = (s) => s.replace(/[|\r\n]+/g, " ").replace(/\s+/g, " ").trim();
9919
10140
  function renderBudgetMarkdown(response, mode) {
9920
10141
  const lines2 = ["### \u{1F3AF} Budgets", ""];
9921
10142
  if (response.results.length === 0) {
@@ -9928,7 +10149,7 @@ function renderBudgetMarkdown(response, mode) {
9928
10149
  lines2.push("| Budget | Scope | Monthly budget | This month at current pace | This change | Projected | Status |", "|---|---|---:|---:|---:|---:|---|");
9929
10150
  for (const r of response.results) {
9930
10151
  lines2.push(
9931
- `| ${cell(r.name)} | ${cell(scopeText(r.scope))} | ${money(r.amount, r.currency)} | ${r.forecast === null ? "\u2014" : approx + money(r.forecast, r.currency)} | ${approx}${signed(r.delta, r.currency)} | ${r.projected === null ? "\u2014" : approx + money(r.projected, r.currency)} | ${STATUS_TEXT[r.status]} |`
10152
+ `| ${cell2(r.name)} | ${cell2(scopeText(r.scope))} | ${money2(r.amount, r.currency)} | ${r.forecast === null ? "\u2014" : approx + money2(r.forecast, r.currency)} | ${approx}${signed(r.delta, r.currency)} | ${r.projected === null ? "\u2014" : approx + money2(r.projected, r.currency)} | ${STATUS_TEXT[r.status]} |`
9932
10153
  );
9933
10154
  }
9934
10155
  lines2.push("");
@@ -9943,23 +10164,23 @@ function renderBudgetText(response) {
9943
10164
  if (response.results.length === 0) return "Budgets\n No budget applies to this change.";
9944
10165
  const approx = response.approximate ? "~" : "";
9945
10166
  const rows = response.results.map(
9946
- (r) => ` ${r.name} (${scopeText(r.scope)}): ${r.status}, budget ${money(r.amount, r.currency)}, projected ${r.projected === null ? "unknown" : approx + money(r.projected, r.currency)} (change ${approx}${signed(r.delta, r.currency)})`
10167
+ (r) => ` ${r.name} (${scopeText(r.scope)}): ${r.status}, budget ${money2(r.amount, r.currency)}, projected ${r.projected === null ? "unknown" : approx + money2(r.projected, r.currency)} (change ${approx}${signed(r.delta, r.currency)})`
9947
10168
  );
9948
10169
  return ["Budgets", ...rows].join("\n");
9949
10170
  }
9950
10171
 
9951
10172
  // src/security/drift.ts
9952
- var SCOPE3 = "security:read";
9953
- var REQUEST_TIMEOUT_MS3 = 35e3;
10173
+ var SCOPE4 = "security:read";
10174
+ var REQUEST_TIMEOUT_MS4 = 35e3;
9954
10175
  var CAUSE_OUTSIDE_PLAN = /* @__PURE__ */ new Set(["SEC_AWS_LOGGING_VPC_SIN_FLOW_LOGS", "SEC_AWS_LOGGING_FLOW_LOGS_INCOMPLETOS"]);
9955
10176
  var REGIONAL_NAMES = /* @__PURE__ */ new Set(["lambda_function", "rds_instance"]);
9956
10177
  async function fetchLiveFindings(config2) {
9957
10178
  const fetchImpl = config2.fetchImpl ?? fetch;
9958
- const token = await fetchToken(config2, SCOPE3);
10179
+ const token = await fetchToken(config2, SCOPE4);
9959
10180
  const url = `${config2.baseUrl}/v1/security/findings?accountId=${encodeURIComponent(config2.accountId)}`;
9960
10181
  const response = await fetchImpl(url, {
9961
10182
  headers: { authorization: `Bearer ${token}` },
9962
- signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS3)
10183
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS4)
9963
10184
  });
9964
10185
  if (!response.ok) throw new Error(`security_findings_http_${response.status}`);
9965
10186
  const body2 = await response.json();
@@ -13482,7 +13703,7 @@ function displayAddress(address) {
13482
13703
  return address.replace(/\["((?:[^"\\]|\\.)*)"\]/g, (_, key) => `[#${createHash2("sha256").update(key).digest("hex").slice(0, 8)}]`);
13483
13704
  }
13484
13705
  var code = (text) => "`" + displayAddress(text).replace(/[\r\n]+/g, " ").replace(/`/g, "'").replace(/\|/g, "\\|") + "`";
13485
- var cell2 = (text) => text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\|/g, "\\|").replace(/[\r\n]+/g, " ");
13706
+ var cell3 = (text) => text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\|/g, "\\|").replace(/[\r\n]+/g, " ");
13486
13707
  function groupedGaps(items) {
13487
13708
  const seen = /* @__PURE__ */ new Set();
13488
13709
  return items.filter((item) => {
@@ -13517,7 +13738,7 @@ function renderSecurityMarkdown(report) {
13517
13738
  for (const { finding, count } of rows.values()) {
13518
13739
  const detail = [evidenceSummary(finding), count > 1 ? `\xD7${count}` : ""].filter(Boolean).join(" ");
13519
13740
  lines2.push(
13520
- `| ${BADGE[finding.severity]} | ${cell2(ruleTitle(finding.ruleId))} | ${code(finding.address)} | ${ACTION[finding.action] ?? finding.action} | ${cell2(detail) || "\u2014"} |`
13741
+ `| ${BADGE[finding.severity]} | ${cell3(ruleTitle(finding.ruleId))} | ${code(finding.address)} | ${ACTION[finding.action] ?? finding.action} | ${cell3(detail) || "\u2014"} |`
13521
13742
  );
13522
13743
  }
13523
13744
  }
@@ -13525,7 +13746,7 @@ function renderSecurityMarkdown(report) {
13525
13746
  lines2.push("", "**Toxic combinations** \u2014 findings that are worse together, fix these first:", "");
13526
13747
  lines2.push("| Severity | Combination | Resource |", "|---|---|---|");
13527
13748
  for (const combo of report.combos) {
13528
- lines2.push(`| ${BADGE[combo.severity]} | ${cell2(comboTitle(combo.comboId))} | ${code(combo.address)} |`);
13749
+ lines2.push(`| ${BADGE[combo.severity]} | ${cell3(comboTitle(combo.comboId))} | ${code(combo.address)} |`);
13529
13750
  }
13530
13751
  }
13531
13752
  if (drift.length > 0) {
@@ -13533,7 +13754,7 @@ function renderSecurityMarkdown(report) {
13533
13754
  lines2.push("", `**Last scan vs. this plan** (AAA Sentinel scan${when}):`, "");
13534
13755
  lines2.push("| Severity | Rule | Resource | What it means |", "|---|---|---|---|");
13535
13756
  for (const item of drift) {
13536
- lines2.push(`| ${BADGE[item.severity]} | ${cell2(ruleTitle(item.ruleId))} | ${code(item.address)} | ${DRIFT_TEXT[item.status]} |`);
13757
+ lines2.push(`| ${BADGE[item.severity]} | ${cell3(ruleTitle(item.ruleId))} | ${code(item.address)} | ${DRIFT_TEXT[item.status]} |`);
13537
13758
  }
13538
13759
  }
13539
13760
  if (report.drift?.truncated) {
@@ -13543,7 +13764,7 @@ function renderSecurityMarkdown(report) {
13543
13764
  if (gaps.length > 0) {
13544
13765
  lines2.push("", `<details><summary>Not evaluable before apply (${gaps.length})</summary>`, "");
13545
13766
  lines2.push("| Rule | Resource | Why |", "|---|---|---|");
13546
- for (const gap of gaps) lines2.push(`| ${cell2(ruleTitle(gap.ruleId))} | ${code(gap.address)} | ${GAP_TEXT[gap.reason]} |`);
13767
+ for (const gap of gaps) lines2.push(`| ${cell3(ruleTitle(gap.ruleId))} | ${code(gap.address)} | ${GAP_TEXT[gap.reason]} |`);
13547
13768
  lines2.push("", "</details>");
13548
13769
  }
13549
13770
  const notes = [];
@@ -13742,7 +13963,7 @@ ${body2}`, warnings, exitCode };
13742
13963
  }
13743
13964
 
13744
13965
  // src/cli.ts
13745
- var DEFAULT_BASE_URL = "https://api.aaa-sentinel.com";
13966
+ var DEFAULT_BASE_URL2 = "https://api.aaa-sentinel.com";
13746
13967
  function pair(id, secret) {
13747
13968
  return id && secret ? { clientId: id, clientSecret: secret } : null;
13748
13969
  }
@@ -13771,10 +13992,17 @@ async function comment(argv) {
13771
13992
  if (outcome.stdout) console.log(outcome.stdout);
13772
13993
  process.exitCode = outcome.exitCode;
13773
13994
  }
13995
+ async function envCost(argv) {
13996
+ const outcome = await runEnvCostCli(argv, { env: process.env });
13997
+ for (const warning of outcome.warnings) console.warn(`iac-cost: ${warning}`);
13998
+ if (outcome.stdout) console.log(outcome.stdout);
13999
+ process.exitCode = outcome.exitCode;
14000
+ }
13774
14001
  async function main() {
13775
14002
  if (process.argv[2] === "fix") return fix(process.argv.slice(3));
13776
14003
  if (process.argv[2] === "posture") return posture(process.argv.slice(3));
13777
14004
  if (process.argv[2] === "comment") return comment(process.argv.slice(3));
14005
+ if (process.argv[2] === "env-cost") return envCost(process.argv.slice(3));
13778
14006
  const options = parseCliArgs(process.argv.slice(2), process.env);
13779
14007
  if ("error" in options) {
13780
14008
  console.error(`iac-cost: ${options.error}
@@ -13788,7 +14016,7 @@ ${USAGE}`);
13788
14016
  return;
13789
14017
  }
13790
14018
  const credentials = {
13791
- baseUrl: resolveBaseUrl(process.env["IAC_COST_BASE_URL"] ?? DEFAULT_BASE_URL),
14019
+ baseUrl: resolveBaseUrl(process.env["IAC_COST_BASE_URL"] ?? DEFAULT_BASE_URL2),
13792
14020
  cost: pair(process.env["IAC_COST_CLIENT_ID"], process.env["IAC_COST_CLIENT_SECRET"]),
13793
14021
  security: pair(process.env["IAC_SECURITY_CLIENT_ID"], process.env["IAC_SECURITY_CLIENT_SECRET"])
13794
14022
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaa-sentinel/iac-cost",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Estimate the monthly cost delta of a Terraform plan, check it against the AAA Sentinel security rules, open security fixes as pull requests and report how the security posture changed, from your CI",
5
5
  "license": "MIT",
6
6
  "type": "module",