Skip to content

refactor(systray): Redesign systray communication flow - #746

Open
rabbitstack wants to merge 1 commit into
masterfrom
revamp-systray-server-and-sender
Open

rabbitstack wants to merge 1 commit into
masterfrom
revamp-systray-server-and-sender

Conversation

@rabbitstack

Copy link
Copy Markdown
Owner

What is the purpose of this PR / why it is needed?

The systray alertsender and the server have the communication direction reversed. The service (or foreground fibratus run) now hosts the pipe, and fibratus systray in each user session connects as a read-only client. The service never starts or impersonates anything in a user session.

The pipe DACL gives SYSTEM and Administrators full control and gives interactive users read only, so nobody else can write to it or create pipe instances. The sender creates it as the first instance, so a squatted name is detected and the sender disables itself without breaking detection.

Client opens the pipe at the anonymous impersonation level and refuses to read from a pipe not owned by SYSTEM or Administrators.
Wire format is altered. Only {title, text} crosses the pipe, one JSON line per message, with size caps. Labels and events never leave the service.

Every logged-on user, including RDP, runs their own helper. A helper that starts late or outlives a service restart reconnects, so there is no 30-minute wait. A helper instance is spawned per session (a Local\ mutex). It keeps a hidden top-level window so it can receive TaskbarCreated and re-add the icon after an explorer restart. Its logs go to %LOCALAPPDATA%\Fibratus\Logs, because users can’t write to Program Files. The systray binary is superseded by a single binary that repurposes the Fibratus own binary with a new subcommand.

What type of change does this PR introduce?


Uncomment one or more /kind <> lines:

/kind feature (non-breaking change which adds functionality)

/kind bug-fix (non-breaking change which fixes an issue)

/kind refactor (non-breaking change that restructures the code, while not changing the original functionality)

/kind breaking (fix or feature that would cause existing functionality to not work as expected

/kind cleanup

/kind improvement

/kind design

/kind documentation

/kind other (change that doesn't pertain to any of the above categories)

Any specific area of the project related to this PR?


Uncomment one or more /area <> lines:

/area instrumentation

/area telemetry

/area rule-engine

/area filters

/area yara

/area event

/area captures

/area alertsenders

/area outputs

/area rules

/area filaments

/area config

/area cli

/area tests

/area ci

/area build

/area docs

/area deps

/area evasion

/area other

Special notes for the reviewer


Does this PR introduce a user-facing change?


The systray alertsender and the server have the communication direction reversed.
The service (or foreground fibratus run) now hosts the pipe, and fibratus systray
in each user session connects as a read-only client. The service never starts or
impersonates anything in a user session.

The pipe DACL gives SYSTEM and Administrators full control and gives interactive
users read only, so nobody else can write to it or create pipe instances. The sender
creates it as the first instance, so a squatted name is detected and the sender
disables itself without breaking detection.

Client opens the pipe at the anonymous impersonation level and refuses to read from
a pipe not owned by SYSTEM or Administrators.
Wire format is altered. Only {title, text} crosses the pipe, one JSON line per message,
with size caps. Labels and events never leave the service.

Every logged-on user, including RDP, runs their own helper. A helper that starts late or
outlives a service restart reconnects, so there is no 30-minute wait.
Helper instance is spawned per session (a Local\ mutex). It keeps a hidden top-level window
so it can receive TaskbarCreated and re-add the icon after an explorer restart. Its logs go
to %LOCALAPPDATA%\Fibratus\Logs, because users can’t write to Program Files.
The systray binary is superseded by a single binary that repurposes the
Fibratus own binary with a new subcommand.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant