Click to play video
Cloud security is a giant can of worms. This isn't a security course, but I do want to give you a few pointers to keep you safe with a simple setup while using S3. A few things to think about:
At the moment, in your Tubely app:
While it's great that an attacker would need to steal your AWS credentials to be able to maliciously change the contents of your bucket, relying only on the secrecy of keys is often not enough.
Keys and passwords are compromised all the time.
One way to add an additional layer of security is to ensure that your keys can only be used from certain (virtual) locations. Then an attacker would need your keys and to be on your network to gain access.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "*",
"Resource": "*",
"Condition": {
"IpAddress": {
"aws:SourceIp": "0.0.0.0/32"
}
}
}
]
}
aws s3 cp <local_file_path> s3://<bucket_name>
You should get denied because your IP address is not allowed (your address isn't 0.0.0.0)
Run and submit the CLI tests.
Your IP address can change, e.g. from switching networks or dynamic IP addresses. Whenever that happens, you'll need to update the policy.