varasto icon indicating copy to clipboard operation
varasto copied to clipboard

Safety: don't allow built-in client to accidentally communicate with a non-related instance

Open joonas-fi opened this issue 1 year ago • 0 comments

Problem

I was wondering why I see in logs my test server instance connecting to my production instance.

The issue is that some server components (e.g. mediascanner) also act as client.

I spun up a test server on the same machine where I have a client configured to connect to the production instance.

Hence my production server accidentally acted as a client not to itself, but to the production server.

Solution

Maybe have some sort of cluster ID which is stored in the client config file. Then when reading the client config file, assert that the server and the client cluster IDs match?

See also: "lineage" in Terraform: https://developer.hashicorp.com/terraform/language/state/backends#manual-state-pull-push

joonas-fi avatar Apr 17 '23 11:04 joonas-fi