Automatically creating security policies