mirror of
https://github.com/floci-io/floci.git
synced 2026-11-29 08:31:53 -05:00
Under enforcement a REST route no vendored model names runs unchecked, and AWS Batch was among them: a caller could create a compute environment with any service, instance or Spot Fleet role and register a job definition with any job or execution role, as #6255 reports. Batch's model routes are vendored, so each request is checked as its operation's action, and Batch joins the table of request resources and the passed-roles table. The passed-roles generator reads RegisterJobDefinition's roles, each passed to ecs-tasks.amazonaws.com, alone. The Service Reference passes CreateComputeEnvironment's and UpdateComputeEnvironment's roles to batch, ec2, ecs and spotfleet without saying which member's goes where, so a vendored source, tools/aws/sources/batch-roles.json, written by tools/aws/fetch_batch_roles.py from the Batch API reference and user guide, gives each: serviceRole is trusted by batch.amazonaws.com, a compute resource's instanceRole is an instance profile whose role is trusted by ec2.amazonaws.com, spotIamFleetRole by spotfleet.amazonaws.com, and a managed instances provider's infrastructureRoleArn needs "iam:PassedToService: ecs.amazonaws.com", the update's naming the same role in the same words. SubmitServiceJob, which Floci does not serve, names its role inside the SageMaker request it queues, a string the table does not read. The request-resources generator reads a type of two variables from a member whose documentation spells it, as it does ECS's "(family:revision)", now also where a variable shares only some of its words with the type's name, so DeregisterJobDefinition's "(name:revision)" names a job definition revision whole, not only its name, and where a member lists the form among those it takes, as SubmitJob's "definition-name, definition-name:revision, or the ARN" does, naming the revision rather than the job definition its name alone fills: "the request ARN includes the revision". BatchStoredResourceArns resolves it as Batch does, a name alone being the latest active revision a job runs, and answers the tags of what Batch stores. A member of a structure documented as "The Amazon Resource Name (ARN) of the" resource is read as one, so a job queue's computeEnvironmentOrder[].computeEnvironment is checked. No other namespace's reading changes. A role name a path prefixes, which Batch documents ("if a role with the name bar has a path of /foo/, specify /foo/bar as the role name"), is checked on the role IAM holds under that name and path. Batch's tag routes are served, as every namespace's the table reads, on the route its model gives, /v1/tags/{resourceArn} with the ARN encoded as an SDK sends it. Its tag-on-create reading waits: CreateComputeEnvironment is checked as batch:TagResource or batch:SetCapacityTags, and nothing says which of its tag members each is for. Part of #6255.
116 lines
9.7 KiB
JSON
116 lines
9.7 KiB
JSON
{
|
|
"_source": {
|
|
"pages": [
|
|
"https://docs.aws.amazon.com/batch/latest/APIReference/API_CreateComputeEnvironment.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-general.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-sagemaker.html",
|
|
"https://docs.aws.amazon.com/batch/latest/APIReference/API_UpdateComputeEnvironment.html",
|
|
"https://docs.aws.amazon.com/batch/latest/APIReference/API_ComputeResource.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/batch-check-ecsinstancerole.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/spot-fleet-roles-cli.html",
|
|
"https://docs.aws.amazon.com/batch/latest/APIReference/API_ComputeResourceUpdate.html",
|
|
"https://docs.aws.amazon.com/batch/latest/APIReference/API_ManagedInstancesProvider.html",
|
|
"https://docs.aws.amazon.com/batch/latest/APIReference/API_UpdateManagedInstancesProviderConfiguration.html"
|
|
],
|
|
"fetcher": "tools/aws/fetch_batch_roles.py",
|
|
"retrieved": "2026-11-28",
|
|
"note": "Each member's description on its API reference page, copied as it stands; the service it names where it names one, the role of the member it updates where it names that role in the same words (sameRoleAs), and otherwise the title of the user guide's page of its role and the service principals that page's trust policies name, or those of the pages it lists (trustPages)."
|
|
},
|
|
"members": [
|
|
{
|
|
"operation": "CreateComputeEnvironment",
|
|
"member": "serviceRole",
|
|
"description": "The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf. For more information, see AWS Batch service IAM role in the AWS Batch User Guide . Important If your account already created the AWS Batch service-linked role, that role is used by default for your compute environment unless you specify a different role here. If the AWS Batch service-linked role doesn't exist in your account, and no role is specified here, the service attempts to create the AWS Batch service-linked role in your account. This automatic service-linked role creation only applies to MANAGED compute environments. For UNMANAGED compute environments, you must explicitly specify a serviceRole . If your specified role has a path other than / , then you must specify either the full role ARN (recommended) or prefix the role name with the path. For example, if a role with the name bar has a path of /foo/ , specify /foo/bar as the role name. For more information, see Friendly names and paths in the IAM User Guide . Note Depending on how you created your AWS Batch service role, its ARN might contain the service-role path prefix. When you only specify the name of the service role, AWS Batch assumes that your ARN doesn't use the service-role path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.",
|
|
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html",
|
|
"title": "Using service-linked roles for AWS Batch - AWS Batch",
|
|
"trustedBy": [
|
|
"batch.amazonaws.com",
|
|
"sagemaker-queuing.batch.amazonaws.com"
|
|
],
|
|
"trustPages": [
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-general.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-sagemaker.html"
|
|
]
|
|
},
|
|
{
|
|
"operation": "UpdateComputeEnvironment",
|
|
"member": "serviceRole",
|
|
"description": "The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf. For more information, see AWS Batch service IAM role in the AWS Batch User Guide . Important If the compute environment has a service-linked role, it can't be changed to use a regular IAM role. Likewise, if the compute environment has a regular IAM role, it can't be changed to use a service-linked role. To update the parameters for the compute environment that require an infrastructure update to change, the AWSServiceRoleForBatch service-linked role must be used. For more information, see Updating compute environments in the AWS Batch User Guide . If your specified role has a path other than / , then you must either specify the full role ARN (recommended) or prefix the role name with the path. Note Depending on how you created your AWS Batch service role, its ARN might contain the service-role path prefix. When you only specify the name of the service role, AWS Batch assumes that your ARN doesn't use the service-role path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.",
|
|
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html",
|
|
"title": "Using service-linked roles for AWS Batch - AWS Batch",
|
|
"trustedBy": [
|
|
"batch.amazonaws.com",
|
|
"sagemaker-queuing.batch.amazonaws.com"
|
|
],
|
|
"trustPages": [
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-general.html",
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/using-service-linked-roles-batch-sagemaker.html"
|
|
]
|
|
},
|
|
{
|
|
"type": "ComputeResource",
|
|
"member": "instanceRole",
|
|
"description": "The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. This parameter is required for Amazon EC2 instances types. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, ecsInstanceRole or arn:aws:iam:: <aws_account_id> :instance-profile/ ecsInstanceRole . For more information, see Amazon ECS instance role in the AWS Batch User Guide . Note This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.",
|
|
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html",
|
|
"title": "Amazon ECS instance role - AWS Batch",
|
|
"trustedBy": [
|
|
"ec2.amazonaws.com"
|
|
],
|
|
"trustPages": [
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/batch-check-ecsinstancerole.html"
|
|
],
|
|
"instanceProfile": true
|
|
},
|
|
{
|
|
"type": "ComputeResource",
|
|
"member": "spotIamFleetRole",
|
|
"description": "The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This role is required if the allocation strategy set to BEST_FIT or if the allocation strategy isn't specified. For more information, see Amazon EC2 spot fleet role in the AWS Batch User Guide . Note This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it. Important To tag your Spot Instances on creation, the Spot Fleet IAM role specified here must use the newer AmazonEC2SpotFleetTaggingRole managed policy. The previously recommended AmazonEC2SpotFleetRole managed policy doesn't have the required permissions to tag Spot Instances. For more information, see Spot instances not tagged on creation in the AWS Batch User Guide .",
|
|
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html",
|
|
"title": "Amazon EC2 spot fleet role - AWS Batch",
|
|
"trustedBy": [
|
|
"spotfleet.amazonaws.com"
|
|
],
|
|
"trustPages": [
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/spot-fleet-roles-cli.html"
|
|
]
|
|
},
|
|
{
|
|
"type": "ComputeResourceUpdate",
|
|
"member": "instanceRole",
|
|
"description": "The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. Required for Amazon EC2 instances. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, ecsInstanceRole or arn:aws:iam:: <aws_account_id> :instance-profile/ ecsInstanceRole . For more information, see Amazon ECS instance role in the AWS Batch User Guide . When updating a compute environment, changing this setting requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the AWS Batch User Guide . Note This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.",
|
|
"rolePage": "https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html",
|
|
"title": "Amazon ECS instance role - AWS Batch",
|
|
"trustedBy": [
|
|
"ec2.amazonaws.com"
|
|
],
|
|
"trustPages": [
|
|
"https://docs.aws.amazon.com/batch/latest/userguide/batch-check-ecsinstancerole.html"
|
|
],
|
|
"instanceProfile": true
|
|
},
|
|
{
|
|
"type": "ManagedInstancesProvider",
|
|
"member": "infrastructureRoleArn",
|
|
"description": "The Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes to manage Amazon EC2 instances on your behalf. This role must have a trust policy for ecs.amazonaws.com . You must have the iam:PassRole permission for this role with the condition iam:PassedToService: ecs.amazonaws.com .",
|
|
"passedToService": [
|
|
"ecs.amazonaws.com"
|
|
]
|
|
},
|
|
{
|
|
"type": "UpdateManagedInstancesProviderConfiguration",
|
|
"member": "infrastructureRoleArn",
|
|
"description": "The updated Amazon Resource Name (ARN) of the IAM role that Amazon ECS assumes to manage Amazon EC2 instances on your behalf.",
|
|
"sameRoleAs": {
|
|
"type": "ManagedInstancesProvider",
|
|
"member": "infrastructureRoleArn"
|
|
},
|
|
"passedToService": [
|
|
"ecs.amazonaws.com"
|
|
]
|
|
}
|
|
]
|
|
}
|