Security and IAM Flashcards
You have built a severless mobile app for which you need to federate and generate temporary credentials to access an S3 bucket. What two technologies could you use?
Cognito and STS
What is the use of Cognito Synch (AKA AppSynch)?
Synchronises calls from a MOBILE device to Cognito
What is the maximum size of data that can be encrypted by KMS per call (NOT data at rest on S3)
4KB - If you need KMS to encrypt environment variables or user data, this must be less than 4Kb
What is the difference between a resource based policy and assuming an IAM role?
When you assume an IAM role you give up your own IAM permissions for the duration of the role assumption. When you are using a resource based policy, your IAM permissions remain unchanged
What CAN’T a security group reference? IP Address, CIDR block, DNS, another security group
A DNS cannot be referenced
You have been granted access (IAM) to an AWS parameter store and can retrieve an encrypted password. However when you try to decrypt the password, you get an error. Why?
IAM will get you access to the store - but you also need IAM permissions to KMS for decryption.
Which service allows you to issue temporary security credentials to allow access to AWS resources - Cognito, SSO or STS?
STS
You have a policy set up for S3 which has been assigned to a role called ‘S3SecGroup’. The policy contains the line Action:”S3:ListBucket” against a specified ARN. When you run an S3 LS in the CLI you get an access denied error - why?
The policy for ListBucket specifies the name of the bucket - you can only ls INSIDE the specified bucket. You cannot ls all buckets
For a security group, what are the defaults for In and Outbound traffic? Are there exceptions?
All inbound traffic is denied, all outbound traffic is allowed. It You can’t deny in a security group - but for everything EXCEPT SSH there is no specific allow rule for inbound.
In Identity federation, is user management inside or external to AWS. Why would we use identity federation
Identity management is external to AWS. A trust relationship must be created between AWS and the provider. You would do this if you had a social media app for example that required access to AWS resources. You want the social media provider to manage the identities rather than creating millions of IAM accounts.
Can secrets in AWS secrets manager be accessed from other accounts?
Yes - unlike a parameter store secrets manager can be accessed from other accounts. This is useful if two accounts need to share the same secret
Can you specify allow and deny rules for:
- A security Group
- A NACL
A Security group allows you to specify ALLOW rules only.
A NACL allows you to specify ALLOW and DENY
When configuring the AWS CLI on an EC2 instance should you provide your access key and secret access key?
No. Your access and secure access key should never be deployed on any AWS resources. IAM resources should always be used instead.
You get a timeout when connecting to an instances via ssh on 22. Why?
Inbound to 22 is not setup in the security group.
There are 2 policies that need to be enacted to give a user access to KMS. One is an IAM policy allowing API calls to KMS. What is the other.
A Key policy allowing the user access to the key.
Can an IAM user belong to multiple groups?
Yes
Can a security group be applied to multiple instances?
Yes. Each instance or ENI must have at least 1 security group.
How can you test a policy you have setup without executing it
AWS IAM Policy simulator
What is the function of a service control policy in AWS Organisations?
It allows for the white listing or blacklisting of specified AWS resources for specific organisational accounts. SCP’s are tree structured and support inheritence. If something is denied at a higher level, and something at a lower level is branched from that, such ans an OU then the resource for that OU will also be denied
Should you store AWS credentials in application code? What is best practice for this?
No. Best practice is that credentials should be inherited from mechanisms above - for AWS services this should always be IAM.