Write a Python script that connects to an AWS environment, identifies all S3 buckets, and flags any that are publicly accessible.