> 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/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-glue-job-using-the-shadow-resource-bucket-for-script-location.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS Glue Job using the shadow resource bucket for script location

### Synopsis

| Field               | Value                                                             |
| ------------------- | ----------------------------------------------------------------- |
| Rule Type           | Detection                                                         |
| Finding Type        | AWS Glue Job using the shadow resource bucket for script location |
| Finding ID          | 60001459                                                          |
| Generates a Finding | This detection rule also generates a finding                      |
| Severity            | Medium                                                            |
| Category            | CONFIGURATION                                                     |
| Cloud Providers     | AWS                                                               |
| Platform Module     | CSPM                                                              |
| Asset Types         | AWS\_GLUE\_JOB                                                    |
| ATT\&CK Tactic      | TA0112 (TA0112)                                                   |
| ATT\&CK Technique   | T1685 (T1685)                                                     |

### Description

AWS Glue jobs utilizing an unintended S3 bucket for script storage present a significant security risk.

AWS Glue, a serverless ETL service, allows users to specify an S3 bucket to store job scripts. Improper configuration, such as using a shadow resource bucket (an unauthorized bucket mimicking a legitimate one), exposes the job to unauthorized access and manipulation. An attacker could create a similarly named bucket beforehand, redirecting script storage and potentially injecting malicious code, leading to remote code execution.

Successful exploitation of this misconfiguration grants attackers complete control over the Glue job, enabling data exfiltration, modification, or deletion. Maintaining control over script storage locations ensures data integrity and prevents unauthorized code execution. Using a known and trusted S3 bucket for script storage is crucial.

To mitigate this risk, explicitly define the intended S3 bucket for each Glue job. Verify bucket ownership and enforce restrictions on the bucket's access policies. Regularly audit Glue job configurations and monitor for any unexpected bucket usage. Employ least privilege principles, granting only necessary permissions to the Glue service.

### Remediation

**Manual steps:**

AWS Glue Job - Manual remediation steps:

To update the script location for an AWS Glue Job:

1. Sign in to the AWS Management Console and open the AWS Glue Studio console at <https://console.aws.amazon.com/gluestudio/>.
2. In the navigation pane, choose 'ETL jobs'.
3. Select the desired AWS Glue Job and choose 'Edit Job' from the 'Actions' drop-down.
4. In the 'Job Details' window, under 'Advanced properties', verify that the 'Script path' and 'Script filename' are authorized and managed according to your business requirements.
5. Move the required script to a new S3 bucket as per your requirements.
6. In the AWS Glue Studio console, go to the 'Job details' tab and update the 'Script filename' and 'Script path' parameters to reflect the new S3 location.
7. Choose 'Save'.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-glue-job-using-the-shadow-resource-bucket-for-script-location.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
