Complete platform management workflows

This commit is contained in:
npc0-hue
2026-07-14 16:39:37 +08:00
parent 7e05d0a4e7
commit 4f33f761a3
106 changed files with 11313 additions and 460 deletions
+22 -2
View File
@@ -24,6 +24,9 @@ function unsafeFieldReason(fieldName: string): string | undefined {
if (compact.includes("runcredential") || compact.includes("runsocket") || compact.includes("directrun")) {
return "direct run access field is not allowed";
}
if (compact.includes("password") || compact.includes("dsn") || compact.includes("rawkey") || compact.includes("secretkey") || compact.includes("credential")) {
return "raw credential field is not allowed";
}
if (compact.includes("hostpath") || compact.includes("rawpath")) {
return "raw host path field is not allowed";
}
@@ -47,7 +50,13 @@ function unsafeStringReasons(value: string): string[] {
lowered.includes("raw api key") ||
lowered.includes("raw credential") ||
lowered.includes("provider key") ||
lowered.includes("ai key")
lowered.includes("ai key") ||
lowered.includes("password=") ||
lowered.includes("rcon password") ||
lowered.includes("ftp password") ||
lowered.startsWith("mysql://") ||
lowered.startsWith("sqlite://") ||
lowered.includes("database dsn")
) {
reasons.push("raw credential or AI/provider key content is not allowed");
}
@@ -56,7 +65,9 @@ function unsafeStringReasons(value: string): string[] {
lowered.includes("run socket") ||
lowered.includes("run credential") ||
lowered.includes("run token") ||
lowered.includes("direct socket")
lowered.includes("direct socket") ||
lowered.startsWith("tcp://") ||
lowered.startsWith("unix://")
) {
reasons.push("direct run access request is not allowed");
}
@@ -70,6 +81,15 @@ function unsafeStringReasons(value: string): string[] {
) {
reasons.push("raw host path access is not allowed");
}
if (
lowered.includes("shell script") ||
lowered.includes("bash -c") ||
lowered.includes("powershell -") ||
lowered.includes("cmd.exe") ||
lowered.includes("curl |")
) {
reasons.push("arbitrary shell content is not allowed");
}
return reasons;
}