VOLTTRON / volttron

VOLTTRON Distributed Control System Platform
https://volttron.readthedocs.io/
Other
452 stars 217 forks source link

@RPC.allow restrictions are not applied after restart of VOLTTRON #3168

Closed schandrika closed 1 month ago

schandrika commented 2 months ago

Describe the bug Auth restrictions on RPC methods specified using @RPC.allow decorators are not enforced on existing agents after a restart of VOLTTRON server. These are enforced on a newly installed agent or after auth update using "vctl auth" commands.

To Reproduce

  1. Start VOLTTRON
  2. Install agent, say AgentA, with RPC exported method with a auth restriction using the @RPC.allow decorator
  3. Install a second agent, say CallerAgent, and call the auth restricted method of AgentA on onstart method
  4. Start AgentA and CallerAgent
  5. This should cause the RPC call to fail with a error clearly mentioning that CallerAgent does not have the necessary capability to access AgentA's method
  6. Restart VOLTTRON
  7. Restart AgentA
  8. Restart CallerAgent
  9. Observe there is no auth error and CallerAgent is able to call the auth restricted method of AgentA

Expected behavior Auth rules should be enforced for newly installed agents and existing agents