Skip to content

Hardening: whitelist for service runner#1989

Merged
TrystanLea merged 2 commits into
masterfrom
service-runner-whitelist
May 12, 2026
Merged

Hardening: whitelist for service runner#1989
TrystanLea merged 2 commits into
masterfrom
service-runner-whitelist

Conversation

@TrystanLea
Copy link
Copy Markdown
Member

This PR proposes replacing the free-form string protocol with a structured JSON payload and a server-side whitelist:

{"run": "emoncms-update", "args": ["all", "none", "/dev/ttyUSB0"], "log": "update"}
  • The daemon maps symbolic action codes to hardcoded absolute script paths — no script path crosses the Redis boundary
  • Log destinations are resolved from a hardcoded LOG_WHITELIST — no longer caller-controlled
  • Unknown actions, unknown log names, wrong arg counts, and non-string args are hard-rejected
  • The four PHP models (UpdateModel, ComponentsModel, ServiceModel, SerialModel) are updated to push JSON action codes instead of constructing script path strings

@TrystanLea TrystanLea merged commit ee6f816 into master May 12, 2026
0 of 8 checks passed
@TrystanLea TrystanLea deleted the service-runner-whitelist branch May 12, 2026 19:49
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