def check_policy_for_encryption(event):
    """
    Check for encryption in S3 bucket policy.

    Checks the event for a bucket policy PUT.  Loops through and checks for either AES256 or
    AWS:KMS.  Otherwise, trigger a violation.
    """
    try:
        for statement in event["detail"]["requestParameters"]["bucketPolicy"]["Statement"]:
            if statement["Condition"]["StringNotEquals"]["s3:x-amz-server-side-encryption"] == \
            "aws:kms" or statement["Condition"]["StringNotEquals"]\
            ["s3:x-amz-server-side-encryption"] == "AES256":
                print("S3 Bucket Policy uses SSE")
                return False
            else:
                return True
    except KeyError as err:
        print(err)
        return True