Cybersecurity of ad-hoc distributed systems