timonel 2.8.0-beta.5 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -25
- package/README.md +12 -55
- package/dist/cli.d.ts.map +1 -0
- package/dist/{src/cli.js → cli.js} +4 -35
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/{src/lib → lib}/helm.d.ts +234 -4
- package/dist/lib/helm.d.ts.map +1 -0
- package/dist/{src/lib → lib}/helm.js +309 -20
- package/dist/lib/helm.js.map +1 -0
- package/dist/lib/helmChartWriter.d.ts.map +1 -0
- package/dist/{src/lib → lib}/helmChartWriter.js +5 -19
- package/dist/lib/helmChartWriter.js.map +1 -0
- package/dist/{src/lib → lib}/resources/baseResourceProvider.d.ts +1 -1
- package/dist/lib/resources/baseResourceProvider.d.ts.map +1 -0
- package/dist/lib/resources/baseResourceProvider.js.map +1 -0
- package/dist/{src/lib → lib}/resources/cloud/aws/awsResources.d.ts +5 -14
- package/dist/lib/resources/cloud/aws/awsResources.d.ts.map +1 -0
- package/dist/{src/lib → lib}/resources/cloud/aws/awsResources.js +63 -78
- package/dist/lib/resources/cloud/aws/awsResources.js.map +1 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.d.ts.map +1 -0
- package/dist/lib/resources/cloud/aws/karpenterResources.js.map +1 -0
- package/dist/lib/rutter.d.ts +445 -0
- package/dist/lib/rutter.d.ts.map +1 -0
- package/dist/lib/rutter.js +585 -0
- package/dist/lib/rutter.js.map +1 -0
- package/dist/{src/lib → lib}/security.d.ts +2 -72
- package/dist/lib/security.d.ts.map +1 -0
- package/dist/lib/security.js +390 -0
- package/dist/lib/security.js.map +1 -0
- package/dist/lib/umbrella.d.ts.map +1 -0
- package/dist/lib/umbrella.js.map +1 -0
- package/dist/{src/lib → lib}/umbrellaRutter.d.ts +1 -1
- package/dist/lib/umbrellaRutter.d.ts.map +1 -0
- package/dist/lib/umbrellaRutter.js.map +1 -0
- package/dist/{src/lib → lib}/utils/helmHelpers.d.ts +2 -12
- package/dist/lib/utils/helmHelpers.d.ts.map +1 -0
- package/dist/{src/lib → lib}/utils/helmHelpers.js +2 -46
- package/dist/lib/utils/helmHelpers.js.map +1 -0
- package/package.json +3 -4
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/index.d.ts +0 -23
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/constants.d.ts +0 -142
- package/dist/src/lib/constants.d.ts.map +0 -1
- package/dist/src/lib/constants.js +0 -167
- package/dist/src/lib/constants.js.map +0 -1
- package/dist/src/lib/helm.d.ts.map +0 -1
- package/dist/src/lib/helm.js.map +0 -1
- package/dist/src/lib/helmChartWriter.d.ts.map +0 -1
- package/dist/src/lib/helmChartWriter.js.map +0 -1
- package/dist/src/lib/resources/autoscaling/autoscalingResources.d.ts +0 -248
- package/dist/src/lib/resources/autoscaling/autoscalingResources.d.ts.map +0 -1
- package/dist/src/lib/resources/autoscaling/autoscalingResources.js +0 -81
- package/dist/src/lib/resources/autoscaling/autoscalingResources.js.map +0 -1
- package/dist/src/lib/resources/baseResourceProvider.d.ts.map +0 -1
- package/dist/src/lib/resources/baseResourceProvider.js.map +0 -1
- package/dist/src/lib/resources/cloud/aws/awsResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/aws/awsResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/aws/karpenterResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/aws/karpenterResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/azure/azureResources.d.ts +0 -169
- package/dist/src/lib/resources/cloud/azure/azureResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/azure/azureResources.js +0 -218
- package/dist/src/lib/resources/cloud/azure/azureResources.js.map +0 -1
- package/dist/src/lib/resources/cloud/gcp/gcpResources.d.ts +0 -164
- package/dist/src/lib/resources/cloud/gcp/gcpResources.d.ts.map +0 -1
- package/dist/src/lib/resources/cloud/gcp/gcpResources.js +0 -192
- package/dist/src/lib/resources/cloud/gcp/gcpResources.js.map +0 -1
- package/dist/src/lib/resources/core/coreResources.d.ts +0 -790
- package/dist/src/lib/resources/core/coreResources.d.ts.map +0 -1
- package/dist/src/lib/resources/core/coreResources.js +0 -1115
- package/dist/src/lib/resources/core/coreResources.js.map +0 -1
- package/dist/src/lib/resources/core/storageResources.d.ts +0 -133
- package/dist/src/lib/resources/core/storageResources.d.ts.map +0 -1
- package/dist/src/lib/resources/core/storageResources.js +0 -120
- package/dist/src/lib/resources/core/storageResources.js.map +0 -1
- package/dist/src/lib/resources/network/networkResources.d.ts +0 -515
- package/dist/src/lib/resources/network/networkResources.d.ts.map +0 -1
- package/dist/src/lib/resources/network/networkResources.js +0 -784
- package/dist/src/lib/resources/network/networkResources.js.map +0 -1
- package/dist/src/lib/resources/security/encryption.d.ts +0 -290
- package/dist/src/lib/resources/security/encryption.d.ts.map +0 -1
- package/dist/src/lib/resources/security/encryption.js +0 -295
- package/dist/src/lib/resources/security/encryption.js.map +0 -1
- package/dist/src/lib/resources/security/index.d.ts +0 -6
- package/dist/src/lib/resources/security/index.d.ts.map +0 -1
- package/dist/src/lib/resources/security/index.js +0 -6
- package/dist/src/lib/resources/security/index.js.map +0 -1
- package/dist/src/lib/resources/validation/validationResources.d.ts +0 -26
- package/dist/src/lib/resources/validation/validationResources.d.ts.map +0 -1
- package/dist/src/lib/resources/validation/validationResources.js +0 -33
- package/dist/src/lib/resources/validation/validationResources.js.map +0 -1
- package/dist/src/lib/rutter.d.ts +0 -1106
- package/dist/src/lib/rutter.d.ts.map +0 -1
- package/dist/src/lib/rutter.js +0 -1295
- package/dist/src/lib/rutter.js.map +0 -1
- package/dist/src/lib/security.d.ts.map +0 -1
- package/dist/src/lib/security.js +0 -569
- package/dist/src/lib/security.js.map +0 -1
- package/dist/src/lib/umbrella.d.ts.map +0 -1
- package/dist/src/lib/umbrella.js.map +0 -1
- package/dist/src/lib/umbrellaRutter.d.ts.map +0 -1
- package/dist/src/lib/umbrellaRutter.js.map +0 -1
- package/dist/src/lib/utils/helmHelpers.d.ts.map +0 -1
- package/dist/src/lib/utils/helmHelpers.js.map +0 -1
- package/dist/src/lib/utils/podTemplates.d.ts +0 -192
- package/dist/src/lib/utils/podTemplates.d.ts.map +0 -1
- package/dist/src/lib/utils/podTemplates.js +0 -331
- package/dist/src/lib/utils/podTemplates.js.map +0 -1
- package/dist/src/lib/utils/resourceNaming.d.ts +0 -57
- package/dist/src/lib/utils/resourceNaming.d.ts.map +0 -1
- package/dist/src/lib/utils/resourceNaming.js +0 -82
- package/dist/src/lib/utils/resourceNaming.js.map +0 -1
- /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
- /package/dist/{src/lib → lib}/helmChartWriter.d.ts +0 -0
- /package/dist/{src/lib → lib}/resources/baseResourceProvider.js +0 -0
- /package/dist/{src/lib → lib}/resources/cloud/aws/karpenterResources.d.ts +0 -0
- /package/dist/{src/lib → lib}/resources/cloud/aws/karpenterResources.js +0 -0
- /package/dist/{src/lib → lib}/umbrella.d.ts +0 -0
- /package/dist/{src/lib → lib}/umbrella.js +0 -0
- /package/dist/{src/lib → lib}/umbrellaRutter.js +0 -0
|
@@ -46,41 +46,14 @@ export declare class SecurityUtils {
|
|
|
46
46
|
*/
|
|
47
47
|
static isValidTypeScriptFile(filePath: string): boolean;
|
|
48
48
|
/**
|
|
49
|
-
* Validates
|
|
49
|
+
* Validates if a path is safe for use in Helm templates
|
|
50
|
+
* Enhanced validation with better security checks and Helm best practices
|
|
50
51
|
* @param templatePath - The template path to validate
|
|
51
52
|
* @returns True if the path is valid for Helm templates
|
|
52
53
|
*
|
|
53
54
|
* @since 2.2.0
|
|
54
55
|
*/
|
|
55
56
|
static isValidHelmTemplatePath(templatePath: string): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Checks for dangerous characters in template path
|
|
58
|
-
* @param path - Path to check
|
|
59
|
-
* @returns True if dangerous characters found
|
|
60
|
-
* @since 2.9.0
|
|
61
|
-
*/
|
|
62
|
-
private static hasDangerousCharacters;
|
|
63
|
-
/**
|
|
64
|
-
* Checks for control characters in template path
|
|
65
|
-
* @param path - Path to check
|
|
66
|
-
* @returns True if control characters found
|
|
67
|
-
* @since 2.9.0
|
|
68
|
-
*/
|
|
69
|
-
private static hasControlCharacters;
|
|
70
|
-
/**
|
|
71
|
-
* Validates path segments in dot notation
|
|
72
|
-
* @param path - Path to validate
|
|
73
|
-
* @returns True if all segments are valid
|
|
74
|
-
* @since 2.9.0
|
|
75
|
-
*/
|
|
76
|
-
private static validatePathSegments;
|
|
77
|
-
/**
|
|
78
|
-
* Validates individual path segment
|
|
79
|
-
* @param segment - Segment to validate
|
|
80
|
-
* @returns True if segment is valid
|
|
81
|
-
* @since 2.9.0
|
|
82
|
-
*/
|
|
83
|
-
private static isValidPathSegment;
|
|
84
57
|
/**
|
|
85
58
|
* Validates chart names according to Helm conventions
|
|
86
59
|
* @param chartName - Chart name to validate
|
|
@@ -111,49 +84,6 @@ export declare class SecurityUtils {
|
|
|
111
84
|
name: string;
|
|
112
85
|
value: string;
|
|
113
86
|
};
|
|
114
|
-
/**
|
|
115
|
-
* Enhanced dangerous pattern detection with nested command injection prevention
|
|
116
|
-
* @param value - String to check for dangerous patterns
|
|
117
|
-
* @returns Pattern name if dangerous pattern detected, null otherwise
|
|
118
|
-
* @since 2.9.0
|
|
119
|
-
*/
|
|
120
|
-
private static detectDangerousPatterns;
|
|
121
|
-
/**
|
|
122
|
-
* Detects shell metacharacters that could enable command injection
|
|
123
|
-
* @param value - String to check
|
|
124
|
-
* @returns True if shell metacharacters found
|
|
125
|
-
* @since 2.9.0
|
|
126
|
-
*/
|
|
127
|
-
private static hasShellMetacharacters;
|
|
128
|
-
/**
|
|
129
|
-
* Detects nested command substitution patterns like $(command $(nested))
|
|
130
|
-
* @param value - String to check for nested patterns
|
|
131
|
-
* @returns True if nested command substitution is detected
|
|
132
|
-
* @since 2.9.0
|
|
133
|
-
*/
|
|
134
|
-
private static hasNestedCommandSubstitution;
|
|
135
|
-
/**
|
|
136
|
-
* Detects nested backtick execution patterns like `command `nested` `
|
|
137
|
-
* @param value - String to check for nested patterns
|
|
138
|
-
* @returns True if nested backtick execution is detected
|
|
139
|
-
* @since 2.9.0
|
|
140
|
-
*/
|
|
141
|
-
private static hasNestedBacktickExecution;
|
|
142
|
-
/**
|
|
143
|
-
* Helper method to check for nested backticks in substring
|
|
144
|
-
* @param value - Full string
|
|
145
|
-
* @param startIndex - Starting index to check from
|
|
146
|
-
* @returns True if nested backtick found
|
|
147
|
-
* @since 2.9.0
|
|
148
|
-
*/
|
|
149
|
-
private static hasNestedBacktickInSubstring;
|
|
150
|
-
/**
|
|
151
|
-
* Detects nested variable expansion patterns like ${var${nested}}
|
|
152
|
-
* @param value - String to check for nested patterns
|
|
153
|
-
* @returns True if nested variable expansion is detected
|
|
154
|
-
* @since 2.9.0
|
|
155
|
-
*/
|
|
156
|
-
private static hasNestedVariableExpansion;
|
|
157
87
|
/**
|
|
158
88
|
* Validates container image tags for security best practices
|
|
159
89
|
* Prevents use of dangerous tags and ensures proper versioning
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/lib/security.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;GAKG;AACH,qBAAa,aAAa;IACxB;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM;IA2BvE;;;;;;OAMG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAgBlD;;;;;;;OAOG;IACH,MAAM,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAmBnD;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAMvD;;;;;;;OAOG;IACH,MAAM,CAAC,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IA6C7D;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAWnD;;;;;;OAMG;IACH,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAIzD;;;;;;;;;OASG;IACH,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IA6DnF;;;;;;;;OAQG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IA+C7C;;;;;;;;;OASG;IACH,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;IA0BpE;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAsB/B;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IA0B3B;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;CA4BhC"}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Security utilities for input validation and sanitization
|
|
3
|
+
* Focused on CLI tool security concerns: path traversal, injection prevention
|
|
4
|
+
* @since 2.2.0
|
|
5
|
+
*/
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
/**
|
|
8
|
+
* Security utilities for input validation and sanitization
|
|
9
|
+
* Focused on CLI tool security concerns: path traversal, injection prevention
|
|
10
|
+
*
|
|
11
|
+
* @since 2.2.0
|
|
12
|
+
*/
|
|
13
|
+
export class SecurityUtils {
|
|
14
|
+
/**
|
|
15
|
+
* Validates and sanitizes file paths to prevent path traversal attacks
|
|
16
|
+
* @param inputPath - The path to validate
|
|
17
|
+
* @param allowedBasePath - The base path that the input should be within
|
|
18
|
+
* @returns Sanitized path if valid
|
|
19
|
+
* @throws Error if path is invalid or contains traversal sequences
|
|
20
|
+
*
|
|
21
|
+
* @since 2.2.0
|
|
22
|
+
*/
|
|
23
|
+
static validatePath(inputPath, allowedBasePath) {
|
|
24
|
+
if (!inputPath || typeof inputPath !== 'string') {
|
|
25
|
+
throw new Error('Invalid path: path must be a non-empty string');
|
|
26
|
+
}
|
|
27
|
+
// Check for path traversal sequences
|
|
28
|
+
if (inputPath.includes('../') ||
|
|
29
|
+
inputPath.includes('..\\') ||
|
|
30
|
+
inputPath.includes('%2e%2e%2f') ||
|
|
31
|
+
inputPath.includes('%2e%2e%5c')) {
|
|
32
|
+
throw new Error('Invalid path: path traversal sequences detected');
|
|
33
|
+
}
|
|
34
|
+
// Resolve and normalize paths
|
|
35
|
+
const resolvedInput = path.resolve(inputPath);
|
|
36
|
+
const resolvedBase = path.resolve(allowedBasePath);
|
|
37
|
+
// Ensure the resolved path is within the allowed base path
|
|
38
|
+
if (!resolvedInput.startsWith(resolvedBase + path.sep) && resolvedInput !== resolvedBase) {
|
|
39
|
+
throw new Error(`Invalid path: path must be within ${resolvedBase}`);
|
|
40
|
+
}
|
|
41
|
+
return resolvedInput;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Sanitizes log messages to prevent log injection attacks
|
|
45
|
+
* @param message - The message to sanitize
|
|
46
|
+
* @returns Sanitized message with control characters removed
|
|
47
|
+
*
|
|
48
|
+
* @since 2.2.0
|
|
49
|
+
*/
|
|
50
|
+
static sanitizeLogMessage(message) {
|
|
51
|
+
if (typeof message !== 'string') {
|
|
52
|
+
return String(message);
|
|
53
|
+
}
|
|
54
|
+
// Remove control characters (ASCII 0-31 and 127) and normalize line endings
|
|
55
|
+
return (message
|
|
56
|
+
// eslint-disable-next-line no-control-regex -- Intentionally removing control characters for security
|
|
57
|
+
.replace(/[\x00-\x1F\x7F]/g, '') // Remove control characters
|
|
58
|
+
.replace(/\r\n/g, ' ') // Replace CRLF with space
|
|
59
|
+
.replace(/[\r\n]/g, ' ') // Replace remaining CR/LF with space
|
|
60
|
+
.trim());
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Sanitizes environment names to prevent path traversal (CWE-22)
|
|
64
|
+
* @param env - Environment name to sanitize
|
|
65
|
+
* @returns Sanitized environment name
|
|
66
|
+
* @throws Error if environment name is invalid
|
|
67
|
+
*
|
|
68
|
+
* @since 2.2.0
|
|
69
|
+
*/
|
|
70
|
+
static sanitizeEnvironmentName(env) {
|
|
71
|
+
if (!env || typeof env !== 'string') {
|
|
72
|
+
throw new Error('Environment name must be a non-empty string');
|
|
73
|
+
}
|
|
74
|
+
// Allow only alphanumeric, hyphens, and underscores
|
|
75
|
+
const sanitized = env.replace(/[^a-zA-Z0-9-_]/g, '');
|
|
76
|
+
if (sanitized !== env) {
|
|
77
|
+
throw new Error(`Invalid environment name: ${this.sanitizeLogMessage(env)}`);
|
|
78
|
+
}
|
|
79
|
+
if (sanitized.length === 0 || sanitized.length > 63) {
|
|
80
|
+
throw new Error('Environment name must be 1-63 characters long');
|
|
81
|
+
}
|
|
82
|
+
return sanitized;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Validates TypeScript file extensions for dynamic imports
|
|
86
|
+
* @param filePath - The file path to validate
|
|
87
|
+
* @returns True if the file has a valid TypeScript extension
|
|
88
|
+
*
|
|
89
|
+
* @since 2.2.0
|
|
90
|
+
*/
|
|
91
|
+
static isValidTypeScriptFile(filePath) {
|
|
92
|
+
const allowedExtensions = ['.ts', '.tsx'];
|
|
93
|
+
const ext = path.extname(filePath);
|
|
94
|
+
return allowedExtensions.includes(ext);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Validates if a path is safe for use in Helm templates
|
|
98
|
+
* Enhanced validation with better security checks and Helm best practices
|
|
99
|
+
* @param templatePath - The template path to validate
|
|
100
|
+
* @returns True if the path is valid for Helm templates
|
|
101
|
+
*
|
|
102
|
+
* @since 2.2.0
|
|
103
|
+
*/
|
|
104
|
+
static isValidHelmTemplatePath(templatePath) {
|
|
105
|
+
if (!templatePath || typeof templatePath !== 'string') {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
// Check length limits (reasonable for Helm paths)
|
|
109
|
+
if (templatePath.length > 253) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
// Enhanced validation following Kubernetes naming conventions
|
|
113
|
+
// Check if starts and ends with alphanumeric
|
|
114
|
+
if (!/^[a-zA-Z0-9]/.test(templatePath) || !/[a-zA-Z0-9]$/.test(templatePath)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
// Check for valid characters only (safe regex)
|
|
118
|
+
if (!/^[a-zA-Z0-9._-]+$/.test(templatePath)) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
// Additional security checks
|
|
122
|
+
// Prevent path traversal attempts
|
|
123
|
+
if (templatePath.includes('..') || templatePath.includes('//')) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
// Prevent reserved words that could cause issues
|
|
127
|
+
const reservedWords = ['nil', 'null', 'undefined', 'true', 'false'];
|
|
128
|
+
const pathSegments = templatePath.split('.');
|
|
129
|
+
for (const segment of pathSegments) {
|
|
130
|
+
if (reservedWords.includes(segment.toLowerCase())) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
// Each segment should not be empty
|
|
134
|
+
if (segment.length === 0) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Validates chart names according to Helm conventions
|
|
142
|
+
* @param chartName - Chart name to validate
|
|
143
|
+
* @returns True if chart name follows Helm naming rules
|
|
144
|
+
*
|
|
145
|
+
* @since 2.2.0
|
|
146
|
+
*/
|
|
147
|
+
static isValidChartName(chartName) {
|
|
148
|
+
if (!chartName || typeof chartName !== 'string') {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
// Helm chart name validation (RFC 1123 subdomain) - safe regex
|
|
152
|
+
// eslint-disable-next-line security/detect-unsafe-regex -- Simple character class regex is safe
|
|
153
|
+
const chartNameRegex = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/;
|
|
154
|
+
return chartNameRegex.test(chartName) && chartName.length <= 63;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Validates subchart names according to Helm conventions
|
|
158
|
+
* @param subchartName - Subchart name to validate
|
|
159
|
+
* @returns True if subchart name is valid
|
|
160
|
+
*
|
|
161
|
+
* @since 2.2.0
|
|
162
|
+
*/
|
|
163
|
+
static isValidSubchartName(subchartName) {
|
|
164
|
+
return this.isValidChartName(subchartName);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Sanitizes environment variable names and values for Kubernetes security
|
|
168
|
+
* Prevents injection attacks and ensures compliance with Kubernetes naming rules
|
|
169
|
+
* @param name - Environment variable name to sanitize
|
|
170
|
+
* @param value - Environment variable value to sanitize
|
|
171
|
+
* @returns Object with sanitized name and value
|
|
172
|
+
* @throws Error if name or value contains dangerous patterns
|
|
173
|
+
*
|
|
174
|
+
* @since 2.6.0
|
|
175
|
+
*/
|
|
176
|
+
static sanitizeEnvVar(name, value) {
|
|
177
|
+
if (!name || typeof name !== 'string') {
|
|
178
|
+
throw new Error('Environment variable name must be a non-empty string');
|
|
179
|
+
}
|
|
180
|
+
if (typeof value !== 'string') {
|
|
181
|
+
throw new Error('Environment variable value must be a string');
|
|
182
|
+
}
|
|
183
|
+
// Kubernetes env var name validation (RFC 1123 compatible)
|
|
184
|
+
let sanitizedName = name.toUpperCase().replace(/[^A-Z0-9_]/g, '_');
|
|
185
|
+
// Ensure name starts with letter or underscore
|
|
186
|
+
if (/^[0-9]/.test(sanitizedName)) {
|
|
187
|
+
sanitizedName = `_${sanitizedName}`;
|
|
188
|
+
}
|
|
189
|
+
const nameRegex = /^[A-Z_][A-Z0-9_]*$/;
|
|
190
|
+
if (!nameRegex.test(sanitizedName)) {
|
|
191
|
+
throw new Error(`Invalid environment variable name: ${this.sanitizeLogMessage(name)}`);
|
|
192
|
+
}
|
|
193
|
+
// Check for dangerous patterns in value using safer string methods
|
|
194
|
+
const hasDangerousPattern = (val) => {
|
|
195
|
+
if (val.includes('$(') && val.includes(')'))
|
|
196
|
+
return 'command substitution';
|
|
197
|
+
if (val.includes('`'))
|
|
198
|
+
return 'backtick execution';
|
|
199
|
+
if (val.includes('${') && val.includes('}'))
|
|
200
|
+
return 'variable expansion';
|
|
201
|
+
// Check for control characters
|
|
202
|
+
for (let i = 0; i < val.length; i++) {
|
|
203
|
+
const code = val.charCodeAt(i);
|
|
204
|
+
if ((code >= 0x00 && code <= 0x08) ||
|
|
205
|
+
code === 0x0b ||
|
|
206
|
+
code === 0x0c ||
|
|
207
|
+
(code >= 0x0e && code <= 0x1f) ||
|
|
208
|
+
code === 0x7f) {
|
|
209
|
+
return 'control characters';
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
};
|
|
214
|
+
const dangerousPattern = hasDangerousPattern(value);
|
|
215
|
+
if (dangerousPattern) {
|
|
216
|
+
throw new Error(`Environment variable value contains dangerous pattern (${dangerousPattern}): ${this.sanitizeLogMessage(value)}`);
|
|
217
|
+
}
|
|
218
|
+
// Limit value length to prevent DoS
|
|
219
|
+
if (value.length > 32768) {
|
|
220
|
+
throw new Error('Environment variable value exceeds maximum length (32KB)');
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
name: sanitizedName,
|
|
224
|
+
value: value.trim(),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Validates container image tags for security best practices
|
|
229
|
+
* Prevents use of dangerous tags and ensures proper versioning
|
|
230
|
+
* @param tag - Image tag to validate
|
|
231
|
+
* @returns True if tag is valid and secure
|
|
232
|
+
* @throws Error if tag violates security policies
|
|
233
|
+
*
|
|
234
|
+
* @since 2.6.0
|
|
235
|
+
*/
|
|
236
|
+
static validateImageTag(tag) {
|
|
237
|
+
if (!tag || typeof tag !== 'string') {
|
|
238
|
+
throw new Error('Image tag must be a non-empty string');
|
|
239
|
+
}
|
|
240
|
+
const trimmedTag = tag.trim();
|
|
241
|
+
// Reject dangerous or non-specific tags
|
|
242
|
+
const dangerousTags = ['latest', 'master', 'main', 'dev', 'development', 'test', 'staging'];
|
|
243
|
+
if (dangerousTags.includes(trimmedTag.toLowerCase())) {
|
|
244
|
+
throw new Error(`Insecure image tag detected: '${trimmedTag}'. Use specific version tags for security.`);
|
|
245
|
+
}
|
|
246
|
+
// Validate tag format (Docker tag rules)
|
|
247
|
+
const tagRegex = /^[a-zA-Z0-9._-]+$/;
|
|
248
|
+
if (!tagRegex.test(trimmedTag)) {
|
|
249
|
+
throw new Error(`Invalid image tag format: ${this.sanitizeLogMessage(trimmedTag)}`);
|
|
250
|
+
}
|
|
251
|
+
// Check length limits
|
|
252
|
+
if (trimmedTag.length > 128) {
|
|
253
|
+
throw new Error('Image tag exceeds maximum length (128 characters)');
|
|
254
|
+
}
|
|
255
|
+
// Prefer semantic versioning patterns
|
|
256
|
+
// eslint-disable-next-line security/detect-unsafe-regex -- Simple regex patterns are safe for validation
|
|
257
|
+
const semverPattern = /^v?\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?$/;
|
|
258
|
+
const hashPattern = /^[a-f0-9]{7,64}$/;
|
|
259
|
+
// eslint-disable-next-line security/detect-unsafe-regex -- Simple date pattern is safe for validation
|
|
260
|
+
const datePattern = /^\d{4}-\d{2}-\d{2}(-[a-zA-Z0-9.-]+)?$/;
|
|
261
|
+
if (!semverPattern.test(trimmedTag) &&
|
|
262
|
+
!hashPattern.test(trimmedTag) &&
|
|
263
|
+
!datePattern.test(trimmedTag)) {
|
|
264
|
+
// Warning for non-standard tags but don't fail
|
|
265
|
+
console.warn(`Warning: Image tag '${trimmedTag}' doesn't follow recommended patterns (semver, hash, or date)`);
|
|
266
|
+
}
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Generates secure names for Kubernetes secrets
|
|
271
|
+
* Ensures names follow RFC 1123 and are safe for Kubernetes
|
|
272
|
+
* @param baseName - Base name for the secret
|
|
273
|
+
* @param suffix - Optional suffix to append
|
|
274
|
+
* @returns Secure secret name
|
|
275
|
+
* @throws Error if generated name is invalid
|
|
276
|
+
*
|
|
277
|
+
* @since 2.6.0
|
|
278
|
+
*/
|
|
279
|
+
static generateSecretName(baseName, suffix) {
|
|
280
|
+
if (!baseName || typeof baseName !== 'string') {
|
|
281
|
+
throw new Error('Base name must be a non-empty string');
|
|
282
|
+
}
|
|
283
|
+
let sanitizedBase = this.sanitizeBaseName(baseName);
|
|
284
|
+
if (suffix) {
|
|
285
|
+
sanitizedBase = this.appendSuffix(sanitizedBase, suffix);
|
|
286
|
+
}
|
|
287
|
+
// Ensure name starts with letter (not number)
|
|
288
|
+
if (/^[0-9]/.test(sanitizedBase)) {
|
|
289
|
+
sanitizedBase = `s${sanitizedBase}`;
|
|
290
|
+
}
|
|
291
|
+
sanitizedBase = this.truncateIfNeeded(sanitizedBase, suffix);
|
|
292
|
+
// Final validation
|
|
293
|
+
if (!this.isValidChartName(sanitizedBase)) {
|
|
294
|
+
throw new Error(`Generated secret name is invalid: ${sanitizedBase}`);
|
|
295
|
+
}
|
|
296
|
+
return sanitizedBase;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Sanitizes the base name for secret generation using safe string methods
|
|
300
|
+
* @param baseName - Base name to sanitize
|
|
301
|
+
* @returns Sanitized base name
|
|
302
|
+
* @throws Error if no valid characters remain
|
|
303
|
+
*
|
|
304
|
+
* @since 2.6.0
|
|
305
|
+
*/
|
|
306
|
+
static sanitizeBaseName(baseName) {
|
|
307
|
+
// Use character-by-character processing instead of regex
|
|
308
|
+
let sanitized = '';
|
|
309
|
+
for (const char of baseName.toLowerCase()) {
|
|
310
|
+
if ((char >= 'a' && char <= 'z') || (char >= '0' && char <= '9') || char === '-') {
|
|
311
|
+
sanitized += char;
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
sanitized += '-';
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
// Collapse multiple hyphens using split/filter/join
|
|
318
|
+
const parts = sanitized.split('-').filter((part) => part.length > 0);
|
|
319
|
+
sanitized = parts.join('-');
|
|
320
|
+
if (!sanitized) {
|
|
321
|
+
throw new Error('Base name contains no valid characters');
|
|
322
|
+
}
|
|
323
|
+
return sanitized;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Appends suffix to sanitized base name using safe string methods
|
|
327
|
+
* @param baseName - Sanitized base name
|
|
328
|
+
* @param suffix - Suffix to append
|
|
329
|
+
* @returns Base name with suffix
|
|
330
|
+
* @throws Error if suffix is invalid
|
|
331
|
+
*
|
|
332
|
+
* @since 2.6.0
|
|
333
|
+
*/
|
|
334
|
+
static appendSuffix(baseName, suffix) {
|
|
335
|
+
if (typeof suffix !== 'string') {
|
|
336
|
+
throw new Error('Suffix must be a string');
|
|
337
|
+
}
|
|
338
|
+
// Use character-by-character processing instead of regex
|
|
339
|
+
let sanitizedSuffix = '';
|
|
340
|
+
for (const char of suffix.toLowerCase()) {
|
|
341
|
+
if ((char >= 'a' && char <= 'z') || (char >= '0' && char <= '9') || char === '-') {
|
|
342
|
+
sanitizedSuffix += char;
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
sanitizedSuffix += '-';
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
// Collapse multiple hyphens using split/filter/join
|
|
349
|
+
const parts = sanitizedSuffix.split('-').filter((part) => part.length > 0);
|
|
350
|
+
sanitizedSuffix = parts.join('-');
|
|
351
|
+
if (sanitizedSuffix) {
|
|
352
|
+
return `${baseName}-${sanitizedSuffix}`;
|
|
353
|
+
}
|
|
354
|
+
return baseName;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Truncates name if it exceeds length limits
|
|
358
|
+
* @param name - Name to potentially truncate
|
|
359
|
+
* @param suffix - Original suffix for preservation
|
|
360
|
+
* @returns Truncated name if needed
|
|
361
|
+
*
|
|
362
|
+
* @since 2.6.0
|
|
363
|
+
*/
|
|
364
|
+
static truncateIfNeeded(name, suffix) {
|
|
365
|
+
const maxLength = 63;
|
|
366
|
+
if (name.length <= maxLength) {
|
|
367
|
+
return name;
|
|
368
|
+
}
|
|
369
|
+
// Truncate but preserve suffix if possible
|
|
370
|
+
if (suffix) {
|
|
371
|
+
// Use safe character processing instead of regex
|
|
372
|
+
let safeSuffix = '';
|
|
373
|
+
for (const char of suffix.toLowerCase()) {
|
|
374
|
+
if ((char >= 'a' && char <= 'z') || (char >= '0' && char <= '9') || char === '-') {
|
|
375
|
+
safeSuffix += char;
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
safeSuffix += '-';
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
const suffixPart = `-${safeSuffix}`;
|
|
382
|
+
const maxBaseLength = maxLength - suffixPart.length;
|
|
383
|
+
if (maxBaseLength > 0) {
|
|
384
|
+
return name.substring(0, maxBaseLength) + suffixPart;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return name.substring(0, maxLength);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
//# sourceMappingURL=security.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/lib/security.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACxB;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CAAC,SAAiB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3,"file":"umbrella.js","sourceRoot":"","sources":["../../src/lib/umbrella.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,OAAO,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @fileoverview UmbrellaRutter class for managing Helm umbrella charts with multiple subcharts
|
|
3
3
|
* @since 0.2.0
|
|
4
4
|
*/
|
|
5
|
-
import type { Rutter } from './rutter.js';
|
|
6
5
|
import type { HelmChartMeta } from './helmChartWriter.js';
|
|
6
|
+
import type { Rutter } from './rutter.js';
|
|
7
7
|
/**
|
|
8
8
|
* Configuration for a subchart within an umbrella chart
|
|
9
9
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"umbrellaRutter.d.ts","sourceRoot":"","sources":["../../src/lib/umbrellaRutter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,IAAI,EAA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ANDARD_HELPERS: HelperDefinition[];
|
|
|
23
23
|
* @since 2.5.0
|
|
24
24
|
*/
|
|
25
25
|
export declare const AWS_HELPERS: HelperDefinition[];
|
|
26
|
-
/**
|
|
27
|
-
* Azure-specific Helm helpers
|
|
28
|
-
* @since 2.5.0
|
|
29
|
-
*/
|
|
30
|
-
export declare const AZURE_HELPERS: HelperDefinition[];
|
|
31
|
-
/**
|
|
32
|
-
* GCP-specific Helm helpers
|
|
33
|
-
* @since 2.5.0
|
|
34
|
-
*/
|
|
35
|
-
export declare const GCP_HELPERS: HelperDefinition[];
|
|
36
26
|
/**
|
|
37
27
|
* Converts helper definitions to Helm template format
|
|
38
28
|
* @param helpers - Array of helper definitions
|
|
@@ -46,7 +36,7 @@ export declare function formatHelpers(helpers: HelperDefinition[]): string;
|
|
|
46
36
|
* @returns Combined standard and cloud-specific helpers
|
|
47
37
|
* @since 2.5.0
|
|
48
38
|
*/
|
|
49
|
-
export declare function getDefaultHelpers(cloudProvider?: 'aws'
|
|
39
|
+
export declare function getDefaultHelpers(cloudProvider?: 'aws'): HelperDefinition[];
|
|
50
40
|
/**
|
|
51
41
|
* Generates complete _helpers.tpl content
|
|
52
42
|
* @param cloudProvider - Optional cloud provider for specific helpers
|
|
@@ -54,5 +44,5 @@ export declare function getDefaultHelpers(cloudProvider?: 'aws' | 'azure' | 'gcp
|
|
|
54
44
|
* @returns Complete helpers template content
|
|
55
45
|
* @since 2.5.0
|
|
56
46
|
*/
|
|
57
|
-
export declare function generateHelpersTemplate(cloudProvider?: 'aws'
|
|
47
|
+
export declare function generateHelpersTemplate(cloudProvider?: 'aws', customHelpers?: HelperDefinition[]): string;
|
|
58
48
|
//# sourceMappingURL=helmHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helmHelpers.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/helmHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,EAoC9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAiBzC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAWjE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,gBAAgB,EAAE,CAQ3E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,CAAC,EAAE,KAAK,EACrB,aAAa,CAAC,EAAE,gBAAgB,EAAE,GACjC,MAAM,CAQR"}
|
|
@@ -65,42 +65,6 @@ export const AWS_HELPERS = [
|
|
|
65
65
|
template: `{{- printf "%s.dkr.ecr.%s.amazonaws.com/%s" (include "aws.accountId" .) (include "aws.region" .) .Values.aws.ecrRepositoryName }}`,
|
|
66
66
|
},
|
|
67
67
|
];
|
|
68
|
-
/**
|
|
69
|
-
* Azure-specific Helm helpers
|
|
70
|
-
* @since 2.5.0
|
|
71
|
-
*/
|
|
72
|
-
export const AZURE_HELPERS = [
|
|
73
|
-
{
|
|
74
|
-
name: 'azure.resourceGroup',
|
|
75
|
-
template: `{{- required "Azure Resource Group is required" .Values.azure.resourceGroup }}`,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: 'azure.subscriptionId',
|
|
79
|
-
template: `{{- required "Azure Subscription ID is required" .Values.azure.subscriptionId }}`,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: 'azure.acrLoginServer',
|
|
83
|
-
template: `{{- printf "%s.azurecr.io" .Values.azure.acrName }}`,
|
|
84
|
-
},
|
|
85
|
-
];
|
|
86
|
-
/**
|
|
87
|
-
* GCP-specific Helm helpers
|
|
88
|
-
* @since 2.5.0
|
|
89
|
-
*/
|
|
90
|
-
export const GCP_HELPERS = [
|
|
91
|
-
{
|
|
92
|
-
name: 'gcp.projectId',
|
|
93
|
-
template: `{{- required "GCP Project ID is required" .Values.gcp.projectId }}`,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'gcp.region',
|
|
97
|
-
template: `{{- .Values.gcp.region | default "us-central1" }}`,
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: 'gcp.garRepository',
|
|
101
|
-
template: `{{- printf "%s-docker.pkg.dev/%s/%s" (include "gcp.region" .) (include "gcp.projectId" .) .Values.gcp.repositoryName }}`,
|
|
102
|
-
},
|
|
103
|
-
];
|
|
104
68
|
/**
|
|
105
69
|
* Converts helper definitions to Helm template format
|
|
106
70
|
* @param helpers - Array of helper definitions
|
|
@@ -125,16 +89,8 @@ ${helper.template}
|
|
|
125
89
|
*/
|
|
126
90
|
export function getDefaultHelpers(cloudProvider) {
|
|
127
91
|
const helpers = [...STANDARD_HELPERS];
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
helpers.push(...AWS_HELPERS);
|
|
131
|
-
break;
|
|
132
|
-
case 'azure':
|
|
133
|
-
helpers.push(...AZURE_HELPERS);
|
|
134
|
-
break;
|
|
135
|
-
case 'gcp':
|
|
136
|
-
helpers.push(...GCP_HELPERS);
|
|
137
|
-
break;
|
|
92
|
+
if (cloudProvider === 'aws') {
|
|
93
|
+
helpers.push(...AWS_HELPERS);
|
|
138
94
|
}
|
|
139
95
|
return helpers;
|
|
140
96
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helmHelpers.js","sourceRoot":"","sources":["../../../src/lib/utils/helmHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAuB;IAClD;QACE,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,6EAA6E;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