regula-wasi 3.2.3 → 3.2.4
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/index.d.ts +94 -0
- package/package.json +3 -1
- package/regula.wasm +0 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export interface RegulaOptions {
|
|
2
|
+
/** Input type: auto, tf, tf-plan, cfn, k8s, arm */
|
|
3
|
+
inputType?: "auto" | "tf" | "tf-plan" | "cfn" | "k8s" | "arm";
|
|
4
|
+
/** Additional rego rule files/directories to include */
|
|
5
|
+
include?: string | string[];
|
|
6
|
+
/** Only run these specific rule IDs */
|
|
7
|
+
only?: string | string[];
|
|
8
|
+
/** Exclude these specific rule IDs */
|
|
9
|
+
exclude?: string | string[];
|
|
10
|
+
/** Disable built-in rules (use only custom rules from include) */
|
|
11
|
+
noBuiltIns?: boolean;
|
|
12
|
+
/** Disable .gitignore filtering */
|
|
13
|
+
noIgnore?: boolean;
|
|
14
|
+
/** Terraform variable files (.tfvars) to use */
|
|
15
|
+
varFiles?: string | string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SourceLocation {
|
|
19
|
+
path: string;
|
|
20
|
+
line: number;
|
|
21
|
+
column: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface RuleResult {
|
|
25
|
+
controls: string[];
|
|
26
|
+
families: string[];
|
|
27
|
+
filepath: string;
|
|
28
|
+
input_type: string;
|
|
29
|
+
provider: string;
|
|
30
|
+
resource_id: string;
|
|
31
|
+
resource_type: string;
|
|
32
|
+
resource_tags: Record<string, unknown>;
|
|
33
|
+
rule_description: string;
|
|
34
|
+
rule_id: string;
|
|
35
|
+
rule_message: string;
|
|
36
|
+
rule_name: string;
|
|
37
|
+
rule_raw_result: boolean;
|
|
38
|
+
rule_remediation_doc?: string;
|
|
39
|
+
rule_result: "PASS" | "FAIL" | "WAIVED";
|
|
40
|
+
rule_severity: "Unknown" | "Informational" | "Low" | "Medium" | "High" | "Critical";
|
|
41
|
+
rule_summary: string;
|
|
42
|
+
source_location?: SourceLocation[];
|
|
43
|
+
active_waivers?: string[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface RegulaResult {
|
|
47
|
+
rule_results: RuleResult[];
|
|
48
|
+
summary: {
|
|
49
|
+
filepaths: string[];
|
|
50
|
+
rule_results: {
|
|
51
|
+
PASS: number;
|
|
52
|
+
FAIL: number;
|
|
53
|
+
WAIVED: number;
|
|
54
|
+
};
|
|
55
|
+
severities: {
|
|
56
|
+
Unknown: number;
|
|
57
|
+
Informational: number;
|
|
58
|
+
Low: number;
|
|
59
|
+
Medium: number;
|
|
60
|
+
High: number;
|
|
61
|
+
Critical: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Run regula on the specified path(s) and return parsed JSON results.
|
|
68
|
+
* @param paths - Path(s) to IaC files or directories
|
|
69
|
+
* @param options - Optional configuration
|
|
70
|
+
* @returns Parsed regula output with rule_results and summary
|
|
71
|
+
*/
|
|
72
|
+
export function runRegula(
|
|
73
|
+
paths: string | string[],
|
|
74
|
+
options?: RegulaOptions
|
|
75
|
+
): Promise<RegulaResult>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Validate IaC files and return rule results.
|
|
79
|
+
* Alias for runRegula().
|
|
80
|
+
* @param paths - Path(s) to IaC files or directories
|
|
81
|
+
* @param options - Optional configuration
|
|
82
|
+
* @returns Object with rule_results and summary
|
|
83
|
+
*/
|
|
84
|
+
export function validate(
|
|
85
|
+
paths: string | string[],
|
|
86
|
+
options?: RegulaOptions
|
|
87
|
+
): Promise<RegulaResult>;
|
|
88
|
+
|
|
89
|
+
declare const _default: {
|
|
90
|
+
runRegula: typeof runRegula;
|
|
91
|
+
validate: typeof validate;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "regula-wasi",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "Infrastructure as Code security and compliance evaluation tool (WASI build). Fork of fugue/regula with security patches.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
7
8
|
"bin": {
|
|
8
9
|
"regula": "cli.js"
|
|
9
10
|
},
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
17
18
|
"index.js",
|
|
19
|
+
"index.d.ts",
|
|
18
20
|
"cli.js",
|
|
19
21
|
"regula.wasm",
|
|
20
22
|
"README.md",
|
package/regula.wasm
CHANGED
|
Binary file
|