There might be a scenario where you want not to allow hotlinking your images uploaded in your s3 bucket then you need to apply bucket policies as mentioned below.

{
  "Id": "Policy1484810954966",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Allow access to images only from specified domain",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::<bucket name>/<folders or *>",
      "Principal": "*",
      "Condition": {
		"StringLike": {
			"aws:Referer": [
				"https://mnkartik.github.io",
				"<any other domains to block>"
			]
		}
	  }
    }
  ]
}

This allows access to only https://mnkartik.github.io and for every other domain its restricted and will get access denied error.