More reliable check for security group filtering.