@ploaness/governance 1.2.0 → 1.4.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 (65) hide show
  1. package/dist/checkov-check.d.ts +9 -0
  2. package/dist/checkov-check.d.ts.map +1 -0
  3. package/dist/checkov-check.js +4 -0
  4. package/dist/checkov-check.js.map +1 -0
  5. package/dist/checkov-checks-aws.d.ts +4 -0
  6. package/dist/checkov-checks-aws.d.ts.map +1 -0
  7. package/dist/checkov-checks-aws.js +93 -0
  8. package/dist/checkov-checks-aws.js.map +1 -0
  9. package/dist/checkov-checks-azure.d.ts +4 -0
  10. package/dist/checkov-checks-azure.d.ts.map +1 -0
  11. package/dist/checkov-checks-azure.js +32 -0
  12. package/dist/checkov-checks-azure.js.map +1 -0
  13. package/dist/checkov-checks-google.d.ts +6 -0
  14. package/dist/checkov-checks-google.d.ts.map +1 -0
  15. package/dist/checkov-checks-google.js +53 -0
  16. package/dist/checkov-checks-google.js.map +1 -0
  17. package/dist/checkov-policy.d.ts +63 -0
  18. package/dist/checkov-policy.d.ts.map +1 -0
  19. package/dist/checkov-policy.js +105 -0
  20. package/dist/checkov-policy.js.map +1 -0
  21. package/dist/environment-coherence.d.ts +59 -5
  22. package/dist/environment-coherence.d.ts.map +1 -1
  23. package/dist/environment-coherence.js +107 -5
  24. package/dist/environment-coherence.js.map +1 -1
  25. package/dist/index.d.ts +8 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +8 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/payload-bootstrap.d.ts +52 -0
  30. package/dist/payload-bootstrap.d.ts.map +1 -0
  31. package/dist/payload-bootstrap.js +195 -0
  32. package/dist/payload-bootstrap.js.map +1 -0
  33. package/dist/payload-database.d.ts +80 -0
  34. package/dist/payload-database.d.ts.map +1 -0
  35. package/dist/payload-database.js +164 -0
  36. package/dist/payload-database.js.map +1 -0
  37. package/dist/payload-policy.d.ts +8 -0
  38. package/dist/payload-policy.d.ts.map +1 -1
  39. package/dist/payload-policy.js +12 -4
  40. package/dist/payload-policy.js.map +1 -1
  41. package/dist/shell-files.d.ts +45 -0
  42. package/dist/shell-files.d.ts.map +1 -0
  43. package/dist/shell-files.js +105 -0
  44. package/dist/shell-files.js.map +1 -0
  45. package/dist/source-security.d.ts +10 -0
  46. package/dist/source-security.d.ts.map +1 -1
  47. package/dist/source-security.js +88 -1
  48. package/dist/source-security.js.map +1 -1
  49. package/dist/terraform-files.d.ts +29 -0
  50. package/dist/terraform-files.d.ts.map +1 -0
  51. package/dist/terraform-files.js +50 -0
  52. package/dist/terraform-files.js.map +1 -0
  53. package/dist/terraform-policy.d.ts +13 -0
  54. package/dist/terraform-policy.d.ts.map +1 -0
  55. package/dist/terraform-policy.js +261 -0
  56. package/dist/terraform-policy.js.map +1 -0
  57. package/dist/terraform-providers.d.ts +28 -0
  58. package/dist/terraform-providers.d.ts.map +1 -0
  59. package/dist/terraform-providers.js +68 -0
  60. package/dist/terraform-providers.js.map +1 -0
  61. package/dist/toolchain-pins.d.ts +1 -1
  62. package/dist/toolchain-pins.d.ts.map +1 -1
  63. package/dist/toolchain-pins.js +9 -2
  64. package/dist/toolchain-pins.js.map +1 -1
  65. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ /** A provider this harness has curated checks for, named as its resource types spell it. */
2
+ export type CuratedProviderName = 'aws' | 'azurerm' | 'google' | 'digitalocean' | 'linode';
3
+ /** One enabled check: the identifier checkov knows it by, its provider, and why the finding is refused. */
4
+ export interface CheckovCheck {
5
+ readonly id: string;
6
+ readonly provider: CuratedProviderName;
7
+ readonly reason: string;
8
+ }
9
+ //# sourceMappingURL=checkov-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-check.d.ts","sourceRoot":"","sources":["../src/checkov-check.ts"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,CAAA;AAE1F,2GAA2G;AAC3G,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAA;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB"}
@@ -0,0 +1,4 @@
1
+ // The shape of one enabled checkov check, declared apart from the tables that list them and the policy
2
+ // that reads them so that neither imports the other.
3
+ export {};
4
+ //# sourceMappingURL=checkov-check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-check.js","sourceRoot":"","sources":["../src/checkov-check.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,qDAAqD"}
@@ -0,0 +1,4 @@
1
+ import type { CheckovCheck } from './checkov-check.js';
2
+ /** The AWS checks enabled at error severity. */
3
+ export declare const AWS_CHECKS: readonly CheckovCheck[];
4
+ //# sourceMappingURL=checkov-checks-aws.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-checks-aws.d.ts","sourceRoot":"","sources":["../src/checkov-checks-aws.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,gDAAgD;AAChD,eAAO,MAAM,UAAU,EAAE,SAAS,YAAY,EAoH7C,CAAA"}
@@ -0,0 +1,93 @@
1
+ const aws = (id, reason) => ({ id, provider: 'aws', reason });
2
+ /** The AWS checks enabled at error severity. */
3
+ export const AWS_CHECKS = [
4
+ // Identity and access.
5
+ aws('CKV_AWS_274', 'a role, user or group carries AdministratorAccess, so one environment can destroy another'),
6
+ aws('CKV_AWS_275', 'the same administrator policy reached through a data source rather than an attachment'),
7
+ aws('CKV_AWS_1', 'a policy document grants every action on every resource'),
8
+ aws('CKV_AWS_49', 'a policy document names "*" as a statement action'),
9
+ aws('CKV_AWS_62', 'the same administrative grant written as an inline policy'),
10
+ aws('CKV_AWS_63', 'the same wildcard action written as an inline policy'),
11
+ aws('CKV2_AWS_40', 'a policy grants every IAM action, which is administrator access under another name'),
12
+ aws('CKV2_AWS_56', 'a principal carries IAMFullAccess'),
13
+ aws('CKV_AWS_283', 'a resource policy grants an action to every principal with no condition'),
14
+ aws('CKV_AWS_41', 'a long-lived access key is written into a provider block'),
15
+ aws('CKV_AWS_348', 'an access key is minted for the root user'),
16
+ aws('CKV_AWS_364', 'a service principal may invoke the function from any account, with no source ARN or account'),
17
+ aws('CKV_AWS_33', 'a key policy grants a wildcard principal with no condition'),
18
+ // Databases, caches and search.
19
+ aws('CKV_AWS_17', 'the database is reachable from the public internet'),
20
+ aws('CKV_AWS_16', 'the database instance stores its content unencrypted'),
21
+ aws('CKV_AWS_96', 'the database cluster stores its content unencrypted'),
22
+ aws('CKV_AWS_140', 'the global database cluster stores its content unencrypted'),
23
+ aws('CKV_AWS_211', 'the database pins a retired certificate authority bundle'),
24
+ aws('CKV_AWS_302', 'a database snapshot is shared with every AWS account'),
25
+ aws('CKV_AWS_74', 'the document database stores its content unencrypted'),
26
+ aws('CKV_AWS_90', 'the document database explicitly disables TLS'),
27
+ aws('CKV_AWS_44', 'the graph database stores its content unencrypted'),
28
+ aws('CKV_AWS_102', 'the graph database is reachable from the public internet'),
29
+ aws('CKV_AWS_64', 'the warehouse stores its content unencrypted'),
30
+ aws('CKV_AWS_87', 'the warehouse is reachable from the public internet, which is its default'),
31
+ aws('CKV_AWS_29', 'the cache stores its content unencrypted'),
32
+ aws('CKV_AWS_30', 'the cache accepts plaintext connections'),
33
+ aws('CKV_AWS_202', 'the in-memory database explicitly disables TLS'),
34
+ aws('CKV_AWS_47', 'the DynamoDB accelerator stores its content unencrypted'),
35
+ aws('CKV_AWS_239', 'the DynamoDB accelerator endpoint is plaintext'),
36
+ aws('CKV_AWS_5', 'the search domain stores its content unencrypted'),
37
+ aws('CKV_AWS_6', 'a multi-node search domain moves data between nodes in plaintext'),
38
+ aws('CKV_AWS_83', 'the search domain explicitly allows plain HTTP'),
39
+ aws('CKV_AWS_228', 'the search endpoint accepts TLS below 1.2, which is its default policy'),
40
+ aws('CKV_AWS_89', 'the migration instance is reachable from the public internet'),
41
+ aws('CKV2_AWS_49', 'a migration endpoint explicitly sets its SSL mode to none'),
42
+ // Storage.
43
+ aws('CKV_AWS_20', 'a bucket ACL grants public read, which serves unpublished media to anybody'),
44
+ aws('CKV_AWS_57', 'a bucket ACL grants public write, which is arbitrary upload to the site own origin'),
45
+ aws('CKV_AWS_70', 'a bucket policy names any principal, which is the policy spelling of the same exposure'),
46
+ aws('CKV_AWS_375', 'a bucket ACL grant gives full control or ACL reads to every user'),
47
+ aws('CKV2_AWS_43', 'a bucket ACL grant targets every authenticated AWS user'),
48
+ aws('CKV_AWS_19', 'the bucket stores uploads unencrypted'),
49
+ aws('CKV_AWS_53', 'the bucket does not block public ACLs'),
50
+ aws('CKV_AWS_54', 'the bucket does not block a public policy'),
51
+ aws('CKV_AWS_55', 'the bucket does not ignore public ACLs already set'),
52
+ aws('CKV_AWS_56', 'the bucket does not restrict public access at the account boundary'),
53
+ aws('CKV_AWS_392', 'an access point disables all four public-access blocks'),
54
+ aws('CKV_AWS_3', 'a volume stores its content unencrypted'),
55
+ aws('CKV_AWS_8', 'an instance root device stores its content unencrypted'),
56
+ aws('CKV_AWS_106', 'account default volume encryption is explicitly switched off'),
57
+ aws('CKV_AWS_42', 'the file system stores its content unencrypted'),
58
+ aws('CKV_AWS_97', 'a task mounts the file system without transit encryption'),
59
+ aws('CKV_AWS_204', 'an image block device is unencrypted'),
60
+ aws('CKV_AWS_235', 'an image copy is unencrypted'),
61
+ // Network.
62
+ aws('CKV_AWS_277', 'a security group admits every port from the whole internet'),
63
+ aws('CKV_AWS_100', 'a node group sets an SSH key with no source security group, which AWS opens to the world'),
64
+ aws('CKV_AWS_79', 'instance metadata v1 is enabled, so any request forgery becomes credential theft'),
65
+ aws('CKV_AWS_371', 'the notebook instance allows instance metadata v1'),
66
+ // Compute and build.
67
+ aws('CKV_AWS_210', 'a batch container runs privileged'),
68
+ aws('CKV_AWS_78', 'build artifact encryption is explicitly disabled'),
69
+ aws('CKV_AWS_386', 'an image lookup names no owner and a wildcard name, which is the substitution attack'),
70
+ aws('CKV_AWS_390', 'the cluster block on public access is switched off'),
71
+ // The edge.
72
+ aws('CKV_AWS_328', 'the load balancer runs request-desync mitigation in monitor mode only'),
73
+ aws('CKV_AWS_34', 'a cache behaviour serves the site over plain HTTP as well as HTTPS'),
74
+ aws('CKV2_AWS_54', 'an origin lists SSLv3 among its protocols'),
75
+ aws('CKV_AWS_308', 'a stage caches responses unencrypted'),
76
+ // Messaging.
77
+ aws('CKV_AWS_168', 'the queue policy is reachable from the internet'),
78
+ aws('CKV_AWS_169', 'the topic policy is reachable from the internet'),
79
+ aws('CKV_AWS_43', 'the stream stores records unencrypted'),
80
+ aws('CKV_AWS_240', 'the delivery stream stores records unencrypted'),
81
+ aws('CKV_AWS_291', 'the message brokers carry public IP addresses'),
82
+ aws('CKV_AWS_69', 'the message broker is reachable from the public internet'),
83
+ // Other services a project may reach for.
84
+ aws('CKV_AWS_32', 'the container registry policy is reachable from the internet'),
85
+ aws('CKV_AWS_167', 'the vault access policy is reachable from the internet'),
86
+ aws('CKV_AWS_303', 'a systems manager document is shared with every AWS account'),
87
+ aws('CKV_AWS_357', 'the transfer server enables plaintext FTP'),
88
+ aws('CKV_AWS_214', 'the API cache stores responses unencrypted'),
89
+ aws('CKV_AWS_215', 'the API cache moves responses in plaintext'),
90
+ aws('CKV_AWS_218', 'the search endpoint accepts TLS 1.0'),
91
+ aws('CKV_AWS_220', 'the search endpoint allows plain HTTP'),
92
+ ];
93
+ //# sourceMappingURL=checkov-checks-aws.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-checks-aws.js","sourceRoot":"","sources":["../src/checkov-checks-aws.ts"],"names":[],"mappings":"AA0BA,MAAM,GAAG,GAAG,CAAC,EAAU,EAAE,MAAc,EAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,QA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AAG,CAAC,aAAa,EAAE,qCAAqC,CAAC;IACzD,GAAG,CAAC,aAAa,EAAE,uCAAuC,CAAC;CAC5D,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { CheckovCheck } from './checkov-check.js';
2
+ /** The Azure checks enabled at error severity. */
3
+ export declare const AZURE_CHECKS: readonly CheckovCheck[];
4
+ //# sourceMappingURL=checkov-checks-azure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-checks-azure.d.ts","sourceRoot":"","sources":["../src/checkov-checks-azure.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,kDAAkD;AAClD,eAAO,MAAM,YAAY,EAAE,SAAS,YAAY,EA4B/C,CAAA"}
@@ -0,0 +1,32 @@
1
+ const azure = (id, reason) => ({ id, provider: 'azurerm', reason });
2
+ /** The Azure checks enabled at error severity. */
3
+ export const AZURE_CHECKS = [
4
+ // Identity and registries.
5
+ azure('CKV_AZURE_39', 'a custom role grants every action, which is an owner written by hand'),
6
+ azure('CKV_AZURE_137', 'the container registry exposes a shared administrator credential'),
7
+ azure('CKV_AZURE_138', 'the container registry serves images to unauthenticated pulls'),
8
+ azure('CKV2_AZURE_30', 'the registry webhook posts to a plain-HTTP endpoint'),
9
+ // Databases.
10
+ azure('CKV_AZURE_11', 'a database firewall rule admits every IP address'),
11
+ azure('CKV2_AZURE_26', 'the PostgreSQL server admits every Azure tenant, or every address'),
12
+ azure('CKV2_AZURE_34', 'the SQL server admits every Azure tenant'),
13
+ azure('CKV2_AZURE_25', 'the SQL database explicitly stores its content unencrypted'),
14
+ // Storage.
15
+ azure('CKV_AZURE_34', 'the blob container serves its blobs anonymously'),
16
+ // Network.
17
+ azure('CKV_AZURE_9', 'a network security rule admits RDP from the whole internet'),
18
+ azure('CKV_AZURE_10', 'a network security rule admits SSH from the whole internet'),
19
+ // Compute.
20
+ azure('CKV_AZURE_149', 'the Linux virtual machine or scale set accepts password logins'),
21
+ azure('CKV_AZURE_5', 'the Kubernetes cluster runs without role-based access control'),
22
+ azure('CKV_AZURE_143', 'the Kubernetes nodes carry public IP addresses'),
23
+ azure('CKV_AZURE_246', 'the retired, unauthenticated HTTP application routing add-on is on'),
24
+ // Web.
25
+ azure('CKV_AZURE_14', 'the web app serves plain HTTP, which is its default'),
26
+ azure('CKV_AZURE_153', 'a deployment slot serves plain HTTP, which is its default'),
27
+ azure('CKV_AZURE_70', 'the function app serves plain HTTP, which is its default'),
28
+ azure('CKV_AZURE_15', 'the web app accepts TLS 1.0 or 1.1'),
29
+ azure('CKV_AZURE_145', 'the function app accepts TLS 1.0 or 1.1'),
30
+ azure('CKV_AZURE_72', 'the app exposes its remote-debugging endpoint'),
31
+ ];
32
+ //# sourceMappingURL=checkov-checks-azure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-checks-azure.js","sourceRoot":"","sources":["../src/checkov-checks-azure.ts"],"names":[],"mappings":"AA6BA,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,MAAc,EAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAA;AAEjG,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAA4B;IACnD,2BAA2B;IAC3B,KAAK,CAAC,cAAc,EAAE,sEAAsE,CAAC;IAC7F,KAAK,CAAC,eAAe,EAAE,kEAAkE,CAAC;IAC1F,KAAK,CAAC,eAAe,EAAE,+DAA+D,CAAC;IACvF,KAAK,CAAC,eAAe,EAAE,qDAAqD,CAAC;IAC7E,aAAa;IACb,KAAK,CAAC,cAAc,EAAE,kDAAkD,CAAC;IACzE,KAAK,CAAC,eAAe,EAAE,mEAAmE,CAAC;IAC3F,KAAK,CAAC,eAAe,EAAE,0CAA0C,CAAC;IAClE,KAAK,CAAC,eAAe,EAAE,4DAA4D,CAAC;IACpF,WAAW;IACX,KAAK,CAAC,cAAc,EAAE,iDAAiD,CAAC;IACxE,WAAW;IACX,KAAK,CAAC,aAAa,EAAE,4DAA4D,CAAC;IAClF,KAAK,CAAC,cAAc,EAAE,4DAA4D,CAAC;IACnF,WAAW;IACX,KAAK,CAAC,eAAe,EAAE,gEAAgE,CAAC;IACxF,KAAK,CAAC,aAAa,EAAE,+DAA+D,CAAC;IACrF,KAAK,CAAC,eAAe,EAAE,gDAAgD,CAAC;IACxE,KAAK,CAAC,eAAe,EAAE,oEAAoE,CAAC;IAC5F,OAAO;IACP,KAAK,CAAC,cAAc,EAAE,qDAAqD,CAAC;IAC5E,KAAK,CAAC,eAAe,EAAE,2DAA2D,CAAC;IACnF,KAAK,CAAC,cAAc,EAAE,0DAA0D,CAAC;IACjF,KAAK,CAAC,cAAc,EAAE,oCAAoC,CAAC;IAC3D,KAAK,CAAC,eAAe,EAAE,yCAAyC,CAAC;IACjE,KAAK,CAAC,cAAc,EAAE,+CAA+C,CAAC;CACvE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { CheckovCheck } from './checkov-check.js';
2
+ /** The Google Cloud checks enabled at error severity. */
3
+ export declare const GOOGLE_CHECKS: readonly CheckovCheck[];
4
+ /** The DigitalOcean and Linode checks enabled at error severity: the pinned image ships ten in all. */
5
+ export declare const SMALL_CLOUD_CHECKS: readonly CheckovCheck[];
6
+ //# sourceMappingURL=checkov-checks-google.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-checks-google.d.ts","sourceRoot":"","sources":["../src/checkov-checks-google.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,yDAAyD;AACzD,eAAO,MAAM,aAAa,EAAE,SAAS,YAAY,EAmChD,CAAA;AAED,uGAAuG;AACvG,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAYrD,CAAA"}
@@ -0,0 +1,53 @@
1
+ const google = (id, reason) => ({ id, provider: 'google', reason });
2
+ /** The Google Cloud checks enabled at error severity. */
3
+ export const GOOGLE_CHECKS = [
4
+ // Identity and keys.
5
+ google('CKV_GCP_41', 'a principal may act as every service account in the project'),
6
+ google('CKV_GCP_31', 'the virtual machine runs as the default compute account with every API'),
7
+ google('CKV_GCP_112', 'the KMS key can be used by anybody'),
8
+ google('CKV2_GCP_8', 'the whole key ring can be used by anybody'),
9
+ // Databases and caches.
10
+ google('CKV_GCP_11', 'the Cloud SQL instance admits every address on the internet'),
11
+ google('CKV_GCP_95', 'the Redis instance accepts unauthenticated connections'),
12
+ // Storage.
13
+ google('CKV_GCP_28', 'the bucket is readable or writable by anybody'),
14
+ google('CKV_GCP_29', 'the bucket honours per-object ACLs, so one object can be made public'),
15
+ google('CKV_GCP_114', 'the bucket can be made public by any later grant'),
16
+ // Network.
17
+ google('CKV_GCP_2', 'a firewall admits SSH from the whole internet'),
18
+ google('CKV_GCP_3', 'a firewall admits RDP from the whole internet'),
19
+ google('CKV_GCP_88', 'a firewall admits MySQL from the whole internet'),
20
+ google('CKV_GCP_75', 'a firewall admits FTP control from the whole internet'),
21
+ google('CKV_GCP_77', 'a firewall admits FTP data from the whole internet'),
22
+ google('CKV2_GCP_12', 'a firewall admits every port and protocol from the whole internet'),
23
+ google('CKV_GCP_27', 'the project gets the default network and its allow-from-anywhere rules'),
24
+ // Compute.
25
+ google('CKV_GCP_7', 'the cluster honours legacy ABAC, which bypasses RBAC'),
26
+ google('CKV_GCP_18', "the control plane's authorised network list is the whole internet"),
27
+ google('CKV_GCP_34', 'the virtual machine opts out of OS Login'),
28
+ google('CKV_GCP_35', 'the virtual machine exposes an interactive serial console'),
29
+ google('CKV2_GCP_10', 'the HTTP-triggered function answers plaintext HTTP'),
30
+ // The edge.
31
+ google('CKV_GCP_4', 'the TLS policy admits TLS 1.0 or 1.1, or a non-forward-secret cipher suite'),
32
+ google('CKV_GCP_17', 'DNSSEC signs the zone with RSASHA1'),
33
+ // Other services a project may reach for.
34
+ google('CKV_GCP_99', 'the topic can be published to or read by anybody'),
35
+ google('CKV_GCP_100', 'the table can be read by anybody'),
36
+ google('CKV_GCP_101', 'the image repository can be pulled by anybody'),
37
+ google('CKV_GCP_98', 'the cluster can be driven by anybody'),
38
+ ];
39
+ /** The DigitalOcean and Linode checks enabled at error severity: the pinned image ships ten in all. */
40
+ export const SMALL_CLOUD_CHECKS = [
41
+ { id: 'CKV_DIO_3', provider: 'digitalocean', reason: 'the Spaces bucket is world-readable' },
42
+ {
43
+ id: 'CKV_LIN_1',
44
+ provider: 'linode',
45
+ reason: 'a Linode API token is written into the provider block',
46
+ },
47
+ {
48
+ id: 'CKV_LIN_5',
49
+ provider: 'linode',
50
+ reason: "the firewall's default inbound action is allow, so every port not listed is open",
51
+ },
52
+ ];
53
+ //# sourceMappingURL=checkov-checks-google.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-checks-google.js","sourceRoot":"","sources":["../src/checkov-checks-google.ts"],"names":[],"mappings":"AA8BA,MAAM,MAAM,GAAG,CAAC,EAAU,EAAE,MAAc,EAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;AAEjG,yDAAyD;AACzD,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,qBAAqB;IACrB,MAAM,CAAC,YAAY,EAAE,6DAA6D,CAAC;IACnF,MAAM,CAAC,YAAY,EAAE,wEAAwE,CAAC;IAC9F,MAAM,CAAC,aAAa,EAAE,oCAAoC,CAAC;IAC3D,MAAM,CAAC,YAAY,EAAE,2CAA2C,CAAC;IACjE,wBAAwB;IACxB,MAAM,CAAC,YAAY,EAAE,6DAA6D,CAAC;IACnF,MAAM,CAAC,YAAY,EAAE,wDAAwD,CAAC;IAC9E,WAAW;IACX,MAAM,CAAC,YAAY,EAAE,+CAA+C,CAAC;IACrE,MAAM,CAAC,YAAY,EAAE,sEAAsE,CAAC;IAC5F,MAAM,CAAC,aAAa,EAAE,kDAAkD,CAAC;IACzE,WAAW;IACX,MAAM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+ /** The checks enabled at error severity, each confirmed present in the pinned image. */
3
+ export declare const CHECKOV_CHECKS: readonly CheckovCheck[];
4
+ /**
5
+ * The value of checkov's `--check` flag.
6
+ *
7
+ * Read from the catalogue rather than written out, so the list that runs and the list that carries the
8
+ * reasons cannot drift. An empty value would run EVERY check rather than none, which is why the spec
9
+ * beside this asserts the catalogue is not empty.
10
+ * @returns the enabled identifiers, comma separated.
11
+ */
12
+ export declare const checkovCheckList: () => string;
13
+ /**
14
+ * How many checks checkov reports as failed.
15
+ * @param output the analyzer's output for a scan that found at least one resource.
16
+ * @returns the tally, or undefined when the output carries none - which a caller treats as a run that
17
+ * did not complete rather than as a clean one.
18
+ */
19
+ export declare const failedCheckCount: (output: string) => number | undefined;
20
+ /**
21
+ * The checks that can apply to a set of providers.
22
+ * @param providers provider names as the resource types spell them.
23
+ * @returns every enabled check bound to one of them.
24
+ */
25
+ export declare const checksFor: (providers: readonly string[]) => readonly CheckovCheck[];
26
+ /**
27
+ * Why a provider has no enabled check. The summary says which, rather than claiming checks that could
28
+ * not have run: a `--check` id bound to no resource in the tree matches nothing and raises no error, so
29
+ * without this the analyzer exits 0 over a cloud it never looked at.
30
+ */
31
+ export type ProviderStanding = 'utility' | 'unsupported' | 'audited';
32
+ /**
33
+ * Every provider this harness knows to have no enabled check, and why. A provider on neither this map
34
+ * nor the catalogue is refused: the harness cannot tell whether the analyzer covers it and does not
35
+ * guess. The `unsupported` entries were confirmed absent from the pinned image with `--list`, and are
36
+ * re-confirmed when the pin moves.
37
+ */
38
+ export declare const PROVIDERS_WITHOUT_CHECKS: ReadonlyMap<string, ProviderStanding>;
39
+ /** The providers a tree declares, sorted into what the gate does about each. */
40
+ export interface ProviderClassification {
41
+ /** At least one enabled check binds to it. */
42
+ readonly curated: readonly string[];
43
+ readonly utility: readonly string[];
44
+ readonly unsupported: readonly string[];
45
+ readonly audited: readonly string[];
46
+ /** On no list; the gate refuses to guess. */
47
+ readonly unclassified: readonly string[];
48
+ }
49
+ /**
50
+ * The providers at least one enabled check binds to.
51
+ *
52
+ * Derived from the catalogue rather than declared beside it, so a cloud cannot be listed as curated
53
+ * with nothing enabled for it.
54
+ * @returns the provider names.
55
+ */
56
+ export declare const curatedProviders: () => ReadonlySet<string>;
57
+ /**
58
+ * Sort the providers a tree declares by what the gate does about each.
59
+ * @param detected provider names, in any order and with any repetition.
60
+ * @returns each provider once, in its standing, ordered so a report reads the same on every machine.
61
+ */
62
+ export declare const classifyProviders: (detected: readonly string[]) => ProviderClassification;
63
+ //# sourceMappingURL=checkov-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-policy.d.ts","sourceRoot":"","sources":["../src/checkov-policy.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAKtD,wFAAwF;AACxF,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAKjD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,QAAO,MACqC,CAAA;AAMzE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,SAG1D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,WAAW,SAAS,MAAM,EAAE,KAAG,SAAS,YAAY,EACe,CAAA;AAE7F;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAoCzE,CAAA;AAEF,gFAAgF;AAChF,MAAM,WAAW,sBAAsB;IACrC,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CACzC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAO,WAAW,CAAC,MAAM,CACwB,CAAA;AAQ9E;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,SAAS,MAAM,EAAE,KAAG,sBAc/D,CAAA"}
@@ -0,0 +1,105 @@
1
+ import { AWS_CHECKS } from './checkov-checks-aws.js';
2
+ import { AZURE_CHECKS } from './checkov-checks-azure.js';
3
+ import { GOOGLE_CHECKS, SMALL_CLOUD_CHECKS } from './checkov-checks-google.js';
4
+ /** The checks enabled at error severity, each confirmed present in the pinned image. */
5
+ export const CHECKOV_CHECKS = [
6
+ ...AWS_CHECKS,
7
+ ...AZURE_CHECKS,
8
+ ...GOOGLE_CHECKS,
9
+ ...SMALL_CLOUD_CHECKS,
10
+ ];
11
+ /**
12
+ * The value of checkov's `--check` flag.
13
+ *
14
+ * Read from the catalogue rather than written out, so the list that runs and the list that carries the
15
+ * reasons cannot drift. An empty value would run EVERY check rather than none, which is why the spec
16
+ * beside this asserts the catalogue is not empty.
17
+ * @returns the enabled identifiers, comma separated.
18
+ */
19
+ export const checkovCheckList = () => CHECKOV_CHECKS.map((check) => check.id).join(',');
20
+ // The tally checkov prints after a scan. Its compact output spends several lines on each failed check
21
+ // and a few on headers, so counting lines would report defects that are not there.
22
+ const FAILED_CHECKS = /Failed checks: (?<count>\d+)/;
23
+ /**
24
+ * How many checks checkov reports as failed.
25
+ * @param output the analyzer's output for a scan that found at least one resource.
26
+ * @returns the tally, or undefined when the output carries none - which a caller treats as a run that
27
+ * did not complete rather than as a clean one.
28
+ */
29
+ export const failedCheckCount = (output) => {
30
+ const count = FAILED_CHECKS.exec(output)?.groups?.['count'];
31
+ return count === undefined ? undefined : Number(count);
32
+ };
33
+ /**
34
+ * The checks that can apply to a set of providers.
35
+ * @param providers provider names as the resource types spell them.
36
+ * @returns every enabled check bound to one of them.
37
+ */
38
+ export const checksFor = (providers) => CHECKOV_CHECKS.filter((check) => providers.includes(check.provider));
39
+ /**
40
+ * Every provider this harness knows to have no enabled check, and why. A provider on neither this map
41
+ * nor the catalogue is refused: the harness cannot tell whether the analyzer covers it and does not
42
+ * guess. The `unsupported` entries were confirmed absent from the pinned image with `--list`, and are
43
+ * re-confirmed when the pin moves.
44
+ */
45
+ export const PROVIDERS_WITHOUT_CHECKS = new Map([
46
+ // Declares no cloud resource, so there is nothing for an analyzer to judge.
47
+ ['random', 'utility'],
48
+ ['null', 'utility'],
49
+ ['local', 'utility'],
50
+ ['tls', 'utility'],
51
+ ['time', 'utility'],
52
+ ['archive', 'utility'],
53
+ ['external', 'utility'],
54
+ ['http', 'utility'],
55
+ ['template', 'utility'],
56
+ ['cloudinit', 'utility'],
57
+ ['terraform', 'utility'],
58
+ // The pinned image ships no check for these. A project on one of them is judged by the pattern
59
+ // rules alone, and the summary says so.
60
+ ['hcloud', 'unsupported'],
61
+ ['cloudflare', 'unsupported'],
62
+ ['vercel', 'unsupported'],
63
+ ['fly', 'unsupported'],
64
+ ['render', 'unsupported'],
65
+ ['scaleway', 'unsupported'],
66
+ ['ovh', 'unsupported'],
67
+ ['vultr', 'unsupported'],
68
+ ['upcloud', 'unsupported'],
69
+ ['exoscale', 'unsupported'],
70
+ ['mongodbatlas', 'unsupported'],
71
+ ['neon', 'unsupported'],
72
+ ['helm', 'unsupported'],
73
+ // Azure's sibling providers. `azapi` binds no check at all. `azuread` binds exactly one,
74
+ // `CKV_AZURE_249`, whose regular expression over an OIDC subject rejects a value that arrives through
75
+ // a variable - so it failed the rubric, and nothing is enabled for the provider.
76
+ ['azapi', 'unsupported'],
77
+ ['azuread', 'audited'],
78
+ ]);
79
+ /**
80
+ * The providers at least one enabled check binds to.
81
+ *
82
+ * Derived from the catalogue rather than declared beside it, so a cloud cannot be listed as curated
83
+ * with nothing enabled for it.
84
+ * @returns the provider names.
85
+ */
86
+ export const curatedProviders = () => new Set(CHECKOV_CHECKS.map((check) => check.provider));
87
+ const standingOf = (provider, curated) => curated.has(provider) ? 'curated' : (PROVIDERS_WITHOUT_CHECKS.get(provider) ?? 'unclassified');
88
+ /**
89
+ * Sort the providers a tree declares by what the gate does about each.
90
+ * @param detected provider names, in any order and with any repetition.
91
+ * @returns each provider once, in its standing, ordered so a report reads the same on every machine.
92
+ */
93
+ export const classifyProviders = (detected) => {
94
+ const curated = curatedProviders();
95
+ const unique = [...new Set(detected)].toSorted((left, right) => left.localeCompare(right));
96
+ const standing = (wanted) => unique.filter((provider) => standingOf(provider, curated) === wanted);
97
+ return {
98
+ curated: standing('curated'),
99
+ utility: standing('utility'),
100
+ unsupported: standing('unsupported'),
101
+ audited: standing('audited'),
102
+ unclassified: standing('unclassified'),
103
+ };
104
+ };
105
+ //# sourceMappingURL=checkov-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkov-policy.js","sourceRoot":"","sources":["../src/checkov-policy.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE9E,wFAAwF;AACxF,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,GAAG,UAAU;IACb,GAAG,YAAY;IACf,GAAG,aAAa;IAChB,GAAG,kBAAkB;CACtB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAW,EAAE,CAC3C,cAAc,CAAC,GAAG,CAAC,CAAC,KAAmB,EAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAEzE,sGAAsG;AACtG,mFAAmF;AACnF,MAAM,aAAa,GAAW,8BAA8B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,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,CAAA;IACxF,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC;QAC5B,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC;QAC5B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC;QACpC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC;QAC5B,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC;KACvC,CAAA;AACH,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /** Where a variable was declared, for a message that names the two places rather than one. */
2
- export type EnvironmentOrigin = 'application' | 'compose';
2
+ export type EnvironmentOrigin = 'application' | 'compose' | 'dockerfile';
3
3
  /** An environment variable declared in one place and absent from another it has to reach. */
4
4
  export interface EnvironmentViolation {
5
5
  readonly name: string;
@@ -11,6 +11,18 @@ export interface WorkflowFile {
11
11
  readonly file: string;
12
12
  readonly content: string;
13
13
  }
14
+ /** A Dockerfile, as the rule needs it: what to call it in a finding, and what it declares. */
15
+ export interface DockerfileSource {
16
+ readonly file: string;
17
+ readonly content: string;
18
+ }
19
+ /** One member's image build: the files whose reads it inlines, and the Dockerfiles that build it. */
20
+ export interface ImageBuild {
21
+ /** Contents of the validated module and the framework configuration, where the member has them. */
22
+ readonly sources: readonly string[];
23
+ /** Every Dockerfile that builds this member. Empty when the member ships no image. */
24
+ readonly dockerfiles: readonly DockerfileSource[];
25
+ }
14
26
  /** Inputs for {@link findEnvironmentViolations}, already read so the core stays pure. */
15
27
  export interface EnvironmentInputs {
16
28
  /** The contents of every validated environment module the repository holds, one per member. */
@@ -21,6 +33,8 @@ export interface EnvironmentInputs {
21
33
  readonly composeSources: readonly string[];
22
34
  /** Every workflow the repository ships. Only the verifying ones are judged. */
23
35
  readonly workflows: readonly WorkflowFile[];
36
+ /** One entry per member: what its build inlines, and the images that must declare it. */
37
+ readonly builds: readonly ImageBuild[];
24
38
  }
25
39
  /**
26
40
  * The module a Payload project reads `process.env` in, which is the only module ploaness exempts from
@@ -43,6 +57,15 @@ export declare const ENVIRONMENT_READ_EXEMPTIONS: readonly string[];
43
57
  * `.env.sample` has documented its variables just as well as one using `.env.example`.
44
58
  */
45
59
  export declare const ENVIRONMENT_EXAMPLE_FILES: readonly string[];
60
+ /**
61
+ * The framework configuration a member may hold at its own root.
62
+ *
63
+ * It is evaluated during the image build, so a variable it reads is one the build has to be given - and
64
+ * it sits outside `sourceRoots`, which is why the `process.env` ban never reached it and why this rule
65
+ * has to. Every spelling present is read, unlike the example files above, because a project ships one
66
+ * and reading all of them cannot produce two answers that disagree.
67
+ */
68
+ export declare const BUILD_CONFIGURATION_FILES: readonly string[];
46
69
  /**
47
70
  * The variables an application reads out of its validated environment module.
48
71
  * @param source the contents of that module.
@@ -61,6 +84,22 @@ export declare const documentedEnvironmentNames: (example: string) => readonly s
61
84
  * @returns each name once, sorted.
62
85
  */
63
86
  export declare const interpolatedEnvironmentNames: (compose: string) => readonly string[];
87
+ /**
88
+ * The variables a file's reads inline into the image at build time.
89
+ * @param source the contents of a validated environment module or a framework configuration.
90
+ * @returns each name once, sorted.
91
+ */
92
+ export declare const inlinedEnvironmentNames: (source: string) => readonly string[];
93
+ /**
94
+ * The build arguments a Dockerfile declares, in every stage and under either spelling.
95
+ *
96
+ * Every stage, because `ARG` scope is per stage and which stage runs the build is not a fact this text
97
+ * can establish. Reading the file as one namespace can only ACCEPT a declaration that sits in the wrong
98
+ * stage; resolving stages by guessing which `RUN` is the build would REJECT correct files.
99
+ * @param dockerfile the Dockerfile body.
100
+ * @returns each name once, sorted.
101
+ */
102
+ export declare const declaredBuildArguments: (dockerfile: string) => readonly string[];
64
103
  /**
65
104
  * The variables a workflow supplies, by any means and at any nesting depth.
66
105
  * @param workflow the contents of the workflow file.
@@ -73,15 +112,30 @@ export declare const workflowSuppliedNames: (workflow: string) => readonly strin
73
112
  * @returns true when the workflow invokes verification or a single gate.
74
113
  */
75
114
  export declare const isVerifyingWorkflow: (workflow: string) => boolean;
115
+ /**
116
+ * The Dockerfiles that build one member: those inside its own directory, and - for the member at the
117
+ * repository root - those no other member owns.
118
+ * @param memberPath the member's repo-relative path, `.` at the repository root.
119
+ * @param everyMemberPath every governed member's path.
120
+ * @param dockerfiles every Dockerfile the repository tracks.
121
+ * @returns the Dockerfiles that build this member, in the order given.
122
+ */
123
+ export declare const dockerfilesBuilding: (memberPath: string, everyMemberPath: readonly string[], dockerfiles: readonly DockerfileSource[]) => readonly DockerfileSource[];
76
124
  /**
77
125
  * Every environment variable declared in one place and absent from another it has to reach.
78
126
  *
79
- * Three containments, each one-directional. What the application reads must be documented. What a
127
+ * Four containments, each one-directional. What the application reads must be documented. What a
80
128
  * compose file interpolates must be documented, because `docker compose config` reads the example file
81
- * a developer copied. And what a compose file interpolates must be supplied by every workflow that
82
- * verifies, because a workflow has no copied file to interpolate from.
129
+ * a developer copied. What a compose file interpolates must be supplied by every workflow that
130
+ * verifies, because a workflow has no copied file to interpolate from. And what a build inlines must be
131
+ * declared as an `ARG`, because docker discards a `--build-arg` the Dockerfile never named and warns
132
+ * rather than failing - so the value is absent from the image and nothing says so.
133
+ *
134
+ * The inlined names feed the Dockerfile containment ALONE. Joining them to the example-file rule would
135
+ * report a member that documents its public variables in its own example file rather than the
136
+ * repository's, which is where they belong and where this reader does not look.
83
137
  * @param inputs the files, already read.
84
- * @returns the violations, sorted by name within each rule. An empty array means the four places agree.
138
+ * @returns the violations, sorted by name within each rule. An empty array means the five places agree.
85
139
  */
86
140
  export declare const findEnvironmentViolations: (inputs: EnvironmentInputs) => readonly EnvironmentViolation[];
87
141
  //# sourceMappingURL=environment-coherence.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment-coherence.d.ts","sourceRoot":"","sources":["../src/environment-coherence.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,SAAS,CAAA;AAEzD,6FAA6F;AAC7F,MAAM,W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