# Access Control (via available tools)

## IAM Access Control

Tools that can help in monitoring Access Control are as follows:

* **Credential Report** - It can be used to identify unused credentials and maintain compliance evidences by providing a CSV about password and access keys usage of a particular IAM user with its ARN, creation time, password or access key last used, last changed, next rotation date and MFA active, last used service and also X.509 certificates

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2FUGZ2h0EpCMD6JH1PU2v3%2Fimage.png?alt=media&#x26;token=2249c0c7-10e8-4e5a-953b-3a41579526bb" alt=""><figcaption></figcaption></figure>

* **Access Analyzer** - A feature in IAM that allows to monitor the usage of policies so that unwanted policies can either be modified or removed. It has service name, policy granting permissions, last accessed, access by members. This is particularly useful to see if a person who has changed jobs or moved from the organization does not have that same level of access, which it discovers by telling IAM policy not getting used. Apart from all these, it can be used to monitor external access also

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2FQ3xXcQ1AXklNGDFI11Hu%2Fimage.png?alt=media&#x26;token=5e9d9518-3a9d-495b-b308-e59ed1435a2e" alt=""><figcaption><p>Working Model for Access Analyzer</p></figcaption></figure>

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2FT8W0KpWZw2a5ugXdm7bW%2Fimage.png?alt=media&#x26;token=4c0e9089-f8ab-4462-a2d8-fc09fbdb0ce9" alt=""><figcaption></figcaption></figure>

In short, it identifies resources shared with external principals for few resources such as:

* [x] S3
* [x] AWS KMS keys
* [x] Lambda functions
* [x] AWS IAM Roles
* [x] Amazon SQS queues
* [x] AWS Secrets Manager secrets

Feel free to navigate to the following link to have a more hands-on approach:

<https://aws.amazon.com/blogs/security/iam-access-analyzer-simplifies-inspection-of-unused-access-in-your-organization/>

* **AWS CloudTrail** - One of the foundational AWS logging service that can be used to monitor as collect forensic evidence. More details on[ AWS CloudTrail page](https://notes.radifine.com/aws/other-aws-services/logging-and-monitoring/aws-cloudtrail).
* **AWS Trusted Advisor** - Useful for newly created AWS account to know the must do's. It helps with Cost optimization, performance, fault tolerance, security etc. **It has lot of many checks, but are behind a paywall. First thing post setup** should be to check suggestions from IAM

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2FRmz4cM3UKBNVHQicLkZf%2Fimage.png?alt=media&#x26;token=ac949b73-c4f3-4c9c-ad1e-2c665e4a00d1" alt=""><figcaption></figcaption></figure>

* **AWS Config** - This paid service from Amazon, assesses, audits and evaluates configurations of AWS resources, but where it really shines is its nature for enforcement. It is kind of File Integrity Monitoring but for AWS configurations. Hence the feature list is as follows:
  1. Continuous Monitoring of configurations when it differs from baseline
  2. Continuous Assessment of configurations when it differs from baseline whether the change is permitted or not.
  3. Change Management - view all the changes
  4. Operational Troubleshooting - if any flow breaks, then it can help in that
  5. Helps in Compliance

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2F0tYstZugj9Hp9dei61Wt%2Fimage.png?alt=media&#x26;token=a6d7bbf2-17e0-43c2-97fe-1aa4eda5fe7a" alt=""><figcaption></figcaption></figure>

W\.r.t IAM, AWS config can help in:

* [x] Monitoring of Root Account MFA enabled or disabled
* [x] Changes to IAM password policy
* [x] IAM policy blacklisted check helps in monitoring if a blacklisted user has suddenly got any policy.
* [x] Monitoring if a group has suddenly got additions or subtractions in its members (useful for checking if any user is part of Admin access)
* [x] If an IAM User has any policies applied to them
* [x] If an IAM group has any user or is it is blank

Setup example for AWS Config:

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2F7fvCTGbfxCU0Zq4Nt2Nt%2Fimage.png?alt=media&#x26;token=f2c43e38-bdbd-4868-81bf-ef94eca0c030" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2F8aYlRU3xZRrXph2vtim3%2Fimage.png?alt=media&#x26;token=d35427e2-96d8-4017-85c7-7e182c8bc6ff" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2F1qQt9p0xJ9z5fP6mWcfR%2Fimage.png?alt=media&#x26;token=bc3af99b-21da-4c82-93f7-c147ccfac35c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2FyeKXns1QvpiidEdxE7io%2Fimage.png?alt=media&#x26;token=c0c61e7f-750c-4c0b-9d5c-1b17cb81d5ff" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note, one can create its own Rules using Lambda and Guard
{% endhint %}

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2Fwk8kTDmU43W3YfmecBeO%2Fimage.png?alt=media&#x26;token=7da17b16-538e-480f-8191-c6dd913597ae" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3681896347-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjfQTFfcSjS8MYnjfKw2c%2Fuploads%2FbZdUmmTk1Vocuqc1bibV%2Fimage.png?alt=media&#x26;token=350ada4b-edfc-4b3f-be37-7c26cc762b27" alt=""><figcaption></figcaption></figure>
