> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/iam/appsec-aws-348.md).

# AWS Access key enabled on root account misconfiguration detected in code

## Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_348                     |
| Category - Subcategory | IAM - Credential Exposure            |
| Provider               | AWS                                  |
| Severity               | HIGH                                 |
| Framework              | Terraform, Terraform Plan            |
| Mapped CSPM/KSPM Rule  | 88db4b66-4dec-48c0-9013-c7871d61b1c8 |

## Impact

The rule checks that the IAM root user does not have Access Keys. The root user has the highest level of access to all the AWS resources and services. If Access Keys are attached to a root user, they can be used to make programmatic calls to AWS APIs. An unauthorized personnel can misuse this to gain full access to all AWS services and resources, potentially causing severe security breach. Hence, it is essential to ensure that IAM root user doesn't have Access keys to avoid any potential risks or compromises to the system's security.

## How to Fix

*Resource:* aws\_iam\_access\_key

* *Arguments:* user

## To fix this issue, you should remove any access keys associated with the IAM root user account. This can typically be done through the AWS Management Console. This approach is highly recommended as AWS root account is highly privileged and it's not recommended to use routinely. \[source,go]

resource "aws\_iam\_access\_key" "fail" {

* user = "root"
* user = "someName" }

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/iam/appsec-aws-348.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
