mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
fix(agentcompat): secure credentialed agent workspaces
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
1 parent
c7799854b9
commit
454c577968
3 files changed
+36
-4
No files matched your search
@@ -55,7 +55,7 @@ func closePreparedWorkspace(workspaceRoot *workspace.Workspace, cause error) err
|
||||
|
||||
func exposePreparedBinary(root, binaryPath string) error {
|
||||
for _, path := range []string{root, filepath.Dir(binaryPath)} {
|
||||
if err := os.Chmod(path, 0o755); err != nil {
|
||||
if err := os.Chmod(path, 0o711); err != nil { // #nosec G302 -- Directories need search permission for the credentialed test agent without granting directory reads; payloads and logs remain private.
|
||||
return fmt.Errorf("make prepared agent binary executable: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user