Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

localingest: give the pipe's owner full control

Claudecb7caecc5970
diff --git a/pkg/asymptoteobserve/localingest/server_windows_test.go b/pkg/asymptoteobserve/localingest/server_windows_test.go
index 93275ebb..bdbfd60d 100644
--- a/pkg/asymptoteobserve/localingest/server_windows_test.go
+++ b/pkg/asymptoteobserve/localingest/server_windows_test.go
@@ -236,7 +236,8 @@ func TestPipeSecurity(t *testing.T) {
sawNetworkDeny = true
}
case windows.ACCESS_ALLOWED_ACE_TYPE:
- if sid != sidLocalSystem && sid != sidAdministrators && ace.Mask&windows.FILE_APPEND_DATA != 0 {
+ // S-1-3-4 is OWNER RIGHTS: the pipe's owner, which is SYSTEM for the collector.
+ if sid != sidLocalSystem && sid != sidAdministrators && sid != "S-1-3-4" && ace.Mask&windows.FILE_APPEND_DATA != 0 {
t.Errorf("%s may create pipe instances (mask %#x)", sid, ace.Mask)
}
}
diff --git a/pkg/asymptoteobserve/localingest/transport_windows.go b/pkg/asymptoteobserve/localingest/transport_windows.go
index a2cc066e..f9e47e03 100644
--- a/pkg/asymptoteobserve/localingest/transport_windows.go
+++ b/pkg/asymptoteobserve/localingest/transport_windows.go
@@ -32,12 +32,15 @@ type Listener = net.Listener
// clients (go-winio creates it with FILE_PIPE_REJECT_REMOTE_CLIENTS), so the deny is a second
// lock on the same door: a pipe is otherwise reachable over SMB, and this channel must never be
// a network one.
-// - SYSTEM and Administrators have full control.
+// - SYSTEM and Administrators have full control, and so does the pipe's owner (OW). For the
+// collector that is SYSTEM again; it matters only to a process that is neither, such as a test
+// run from a shell that is not elevated, which needs FILE_CREATE_PIPE_INSTANCE on its own pipe
+// to keep serving it. Clients accept only a pipe owned by SYSTEM or Administrators regardless.
// - Authenticated users may connect, read and write: 0x12019b is FILE_GENERIC_READ and
// FILE_GENERIC_WRITE without FILE_APPEND_DATA, which on a pipe is FILE_CREATE_PIPE_INSTANCE.
// Without it no other account can add an instance of its own to this pipe and answer the
// clients that connect to it.
-const pipeSecurity = "D:P(D;;GA;;;NU)(A;;GA;;;SY)(A;;GA;;;BA)(A;;0x12019b;;;AU)"
+const pipeSecurity = "D:P(D;;GA;;;NU)(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;OW)(A;;0x12019b;;;AU)"
// clientPipeAccess is what a client asks for: read and write data, read attributes (go-winio reads
// the pipe's mode), READ_CONTROL to read the pipe's owner, and SYNCHRONIZE. GENERIC_WRITE would