Skip to content

feat(agent): harden PSU gRPC POC support#1843

Merged
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
psu-devoagent-pocfrom
mamoreau-devolutions-review-psu-changes
Jun 30, 2026
Merged

feat(agent): harden PSU gRPC POC support#1843
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
psu-devoagent-pocfrom
mamoreau-devolutions-review-psu-changes

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Hardens the PSU gRPC agent POC and adds optional AppToken support for authenticating the agent to PowerShell Universal. The POC container also avoids running as root and no longer disables TLS verification during Docker builds.

This keeps unauthenticated local development possible when no AppToken is configured, while allowing PSU deployments to pass an application token through agent configuration or the container helper.

Issue: N/A

Remove the Docker build TLS verification bypass, run the POC container as a non-root user, suppress strict lints emitted by generated tonic code, and make PSU gRPC process cleanup/reporting more reliable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add optional AppToken configuration for the PSU gRPC agent and send it as bearer authorization metadata when configured. Wire the option through the POC container entrypoint and helper script while preserving unauthenticated local development behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mamoreau-devolutions

Copy link
Copy Markdown
Contributor Author

Implementation notes:

  • Adds optional PsuGrpcAgent.AppToken config and sends it as authorization: Bearer <token> gRPC metadata only when configured.
  • Adds PSU_APP_TOKEN and -AppToken wiring for the POC container scripts.
  • Reworks process stop handling so graceful stop closes stdin while preserving later kill control, and cleans registry state after process failures.
  • Reports spawn failures with StreamClosed and ProcessCompleted.
  • Drains stdout/stderr pump tasks before completion to avoid losing final output.
  • Removes GIT_SSL_NO_VERIFY=true from the POC Docker build and runs the runtime container as a non-root user.
  • Validated with cargo check -p devolutions-agent, cargo test -p devolutions-agent --quiet, cargo clippy -p devolutions-agent --tests -- -D warnings, Rust fmt, and script parser checks.

Remaining follow-up work:

  • Enforce TLS/HTTPS for AppToken-bearing production connections.
  • Add command/runtime allowlisting and process-tree cancellation.
  • Tighten protocol semantics around stream kinds, structured status, heartbeat, and cancel response.

@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) merged commit 54770bc into psu-devoagent-poc Jun 30, 2026
34 checks passed
@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) deleted the mamoreau-devolutions-review-psu-changes branch June 30, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant