AWS Security ChangesHomeSearch

AWS emr: Scope Glue IAM resource and clarify Spark agent permissions

Service: emr · 2026-11-18 · Security-related medium

File: emr/latest/ReleaseGuide/spark-troubleshooting-agent-iam-setup.md · Type: iam

Summary

Restructures the Apache Spark troubleshooting agent IAM setup page: adds an explanation of how the agents use the caller's IAM identity, makes the dedicated agent role optional, scopes the AWS Glue permissions example from Resource "*" to a job-execution-role ARN prefix, and updates KMS key and MCP condition-key wording.

Security assessment

The changed line replaces a wildcard IAM Resource with a constrained ARN pattern for Glue job execution roles, directly reducing over-permissive access (least privilege). The surrounding edits also document that agents inherit the MCP client's IAM identity and can only access what that identity permits, which is security-relevant IAM guidance rather than a fix for a named vulnerability.

Evidence

+          "Resource": "arn:aws:iam::${ACCOUNT_ID}:role/my-job-execution-role-prefix*",

Diff

diff --git a/emr/latest/ReleaseGuide/spark-troubleshooting-agent-iam-setup.md b/emr/latest/ReleaseGuide/spark-troubleshooting-agent-iam-setup.md
index 2aef4b8..c0d99e8 100644
--- a//emr/latest/ReleaseGuide/spark-troubleshooting-agent-iam-setup.md
+++ b//emr/latest/ReleaseGuide/spark-troubleshooting-agent-iam-setup.md
@@ -7 +7 @@
-PrerequisitesStep 1: Create the IAM roleStep 2: Attach permissions for your deployment modeStep 3: Configure your MCP clientCondition keys for MCP server requests
+PrerequisitesHow the Apache Spark agents use your permissionsStep 1: (Optional) Create a dedicated agent roleStep 2: Attach permissions for your deployment modeStep 3: Configure your MCP clientCondition keys for MCP server requests
@@ -9 +9 @@ PrerequisitesStep 1: Create the IAM roleStep 2: Attach permissions for your depl
-# IAM Role Setup
+# IAM permissions for the Apache Spark agents
@@ -13 +13 @@ PrerequisitesStep 1: Create the IAM roleStep 2: Attach permissions for your depl
-Before you begin, ensure you have:
+Before you begin, make sure that you have the following:
@@ -22 +22 @@ Before you begin, ensure you have:
-Set the following variables for use in subsequent commands:
+Set the following variables for use in later commands:
@@ -28 +28 @@ Set the following variables for use in subsequent commands:
-## Step 1: Create the IAM role
+## How the Apache Spark agents use your permissions
@@ -30 +30,9 @@ Set the following variables for use in subsequent commands:
-The SMUS MCP server uses your IAM role to authorize operations at the AWS service level. No separate MCP-specific permissions are required.
+The Amazon SageMaker Unified Studio (SMUS) MCP server authorizes operations at the AWS service level using the IAM identity that your MCP client is configured with. No separate MCP-specific permissions are required. The agents act as that identity, so they can only access what that identity is permitted to access.
+
+The policies on this page describe the permissions that the agents use at full capability. You choose how much of that access to grant. The agents use these permissions to read your job runs, logs, and Spark UI data. They don't start, modify, or stop your jobs. Attach the permissions that you want the agents to have to the IAM identity that your MCP client uses. This is normally the role that you already use to analyze your Spark jobs. Confirm that the role has the permissions in Step 2: Attach permissions for your deployment mode, and point your MCP client at it, as described in Step 3: Configure your MCP client.
+
+If you want the agents to run under a separate, scoped identity instead of your own, create a dedicated role, as described in Step 1: (Optional) Create a dedicated agent role. For an AWS CloudFormation template that creates the role, and for other ways to tighten the agents' access, see [How can I get more fine-grained control over the agents' permissions?](./spark-troubleshooting-agent-troubleshooting.html#spark-agents-qa-fine-grained).
+
+## Step 1: (Optional) Create a dedicated agent role
+
+Skip this step if you use your existing IAM role. Complete it only if you want to give the agents their own identity: a dedicated role that you create for the MCP server and grant only the access that you choose.
@@ -61 +69,5 @@ The SMUS MCP server uses your IAM role to authorize operations at the AWS servic
-Attach the permissions policy that matches your Spark deployment platform. You can attach one or more of the following depending on which platforms you use.
+Attach the permissions policy that matches your Spark deployment platform to the IAM identity that the agents use. This is either your existing role or the dedicated role from Step 1: (Optional) Create a dedicated agent role. The following commands use `SparkTroubleshootingMCPRole` as an example. Replace the `--role-name` value with your own role name. You can attach one or more of the following policies, depending on which platforms you use.
+
+Note
+
+The Apache Spark Optimization Agent supports only AWS Glue (Option B) and EMR Serverless (Option C). The Apache Spark Troubleshooting Agent can use all of the following options.
@@ -174 +186 @@ Alternatively, you can attach the [AmazonElasticMapReduceFullAccess](https://doc
-          "Resource": "*",
+          "Resource": "arn:aws:iam::${ACCOUNT_ID}:role/my-job-execution-role-prefix*",
@@ -184,0 +197,2 @@ Alternatively, you can attach the [AmazonElasticMapReduceFullAccess](https://doc
+Replace `my-job-execution-role-prefix` with the name prefix of your AWS Glue job execution roles.
+
@@ -307 +321 @@ Alternatively, you can attach the [AmazonElasticMapReduceFullAccess](https://doc
-If your CloudWatch Logs are encrypted with a customer-managed KMS key, add the following (replace `<KEY_ID>` with your KMS key ID):
+If your CloudWatch Logs are encrypted with a customer managed KMS key, add the following (replace `<KEY_ID>` with your KMS key ID):
@@ -324 +338,3 @@ If your CloudWatch Logs are encrypted with a customer-managed KMS key, add the f
-Configure your MCP client (for example, Claude Desktop or Amazon Q Developer) to use the role ARN you created:
+Configure your MCP client with AWS credentials for the identity that the agents use. For the supported MCP clients, see [Set up the Apache Spark agents](./spark-troubleshooting-agent-setup.html).
+
+  * **Using your existing role** – Point the client at the AWS profile that you already use, the one whose permissions you confirmed in Step 2: Attach permissions for your deployment mode. No additional role ARN is needed.
@@ -325,0 +342 @@ Configure your MCP client (for example, Claude Desktop or Amazon Q Developer) to
+  * **Using a dedicated role** – Configure the client to assume the role that you created in Step 1: (Optional) Create a dedicated agent role:
@@ -329 +346,4 @@ Configure your MCP client (for example, Claude Desktop or Amazon Q Developer) to
-Refer to your MCP client's documentation for how to configure AWS credentials (typically via an AWS profile that assumes this role).
+
+
+
+For how to configure AWS credentials, refer to your MCP client's documentation. This is typically through an AWS profile that uses your identity or assumes the role.
@@ -335 +355 @@ Two condition keys are automatically added to all requests made through the SMUS
-  * `aws:ViaAWSMCPService` – Set to `true` for any request made via an AWS managed MCP server.
+  * `aws:ViaAWSMCPService` – Set to `true` for any request made through an AWS managed MCP server.
@@ -344 +364 @@ You can use these condition keys to control access to your resources when reques
-**Example: Allow Glue read operations only when accessed via the SMUS MCP server:**
+**Example: Allow AWS Glue read operations only when accessed through the SMUS MCP server:**
@@ -364 +384 @@ You can use these condition keys to control access to your resources when reques
-**Example: Deny delete operations when accessed via any AWS managed MCP server:**
+**Example: Deny delete operations when accessed through any AWS managed MCP server:**
@@ -386 +406 @@ To use the Amazon Web Services Documentation, Javascript must be enabled. Please
-Prompt Examples
+Set up the agents
@@ -388 +408 @@ Prompt Examples
-Using Tools
+Apache Spark Troubleshooting Agent