Probabilistic-Cost Enforcement of Security Policies in Distributed Systems