feat: add ExecInterpreterRule and NetworkHostRule plane-2 rules
This commit is contained in:
@@ -302,6 +302,10 @@ object ConfigLoader {
|
||||
workspaceRoot = asString(toolsSection["workspace_root"], ""),
|
||||
privilegedLocations = asStringList(toolsSection["privileged_locations"])
|
||||
.ifEmpty { ToolsConfig.DEFAULT_PRIVILEGED_LOCATIONS },
|
||||
interpreterExecutables = asStringList(toolsSection["interpreter_executables"])
|
||||
.ifEmpty { ToolsConfig.DEFAULT_INTERPRETERS },
|
||||
networkAllowedHosts = asStringList(toolsSection["network_allowed_hosts"]),
|
||||
networkDeniedHosts = asStringList(toolsSection["network_denied_hosts"]),
|
||||
)
|
||||
|
||||
val providers = providersList.mapNotNull { providerMap ->
|
||||
|
||||
@@ -41,12 +41,19 @@ data class ToolsConfig(
|
||||
val fileEditEnabled: Boolean = true,
|
||||
val workspaceRoot: String = "",
|
||||
val privilegedLocations: List<String> = DEFAULT_PRIVILEGED_LOCATIONS,
|
||||
val interpreterExecutables: List<String> = DEFAULT_INTERPRETERS,
|
||||
val networkAllowedHosts: List<String> = emptyList(),
|
||||
val networkDeniedHosts: List<String> = emptyList(),
|
||||
) {
|
||||
companion object {
|
||||
val DEFAULT_PRIVILEGED_LOCATIONS: List<String> = listOf(
|
||||
"/etc", "/usr", "/bin", "/sbin", "/boot", "/lib", "/lib64",
|
||||
"/sys", "/proc", "/dev", "/root",
|
||||
)
|
||||
val DEFAULT_INTERPRETERS: List<String> = listOf(
|
||||
"python", "python2", "python3", "bash", "sh", "zsh", "fish",
|
||||
"node", "deno", "ruby", "perl", "php", "Rscript", "lua", "groovy",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user