Factor out cloud-specific security group code