Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#375] Allow cross-account AWS IAM role assumption into opt-in regions #376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

choopka
Copy link

@choopka choopka commented Mar 3, 2025

Added authRegion drop-down list-box & variable to allow explicitly stating the region for authenticating with AWS IAM. This will address Issue #375 by permitting authentication with a region that is opted-in in the source AWS account, while accessing ECS clusters in an opt-in region in the target account (which is not opted-in for the source account).

The solution was adding an authRegion list-box to choose the region used for IAM authentication, which is stored in an authRegion variable. This box works in exactly the same manner as the regionName variable box, but by separating them it is now possible to authenticate with AWS IAM in region A while using ECS clusters in region B.

Testing done by:

  1. Adding authRegion to the fields in the automated test
  2. Installing the plugin and running it on a local installation of LTS Jenkins Controller (see attached screenshot)
ecs_cloud_screenshot 3. Successfully viewing and running ECS agents on ECS clusters in an opted-in region in the target account (which is not opted-in for the Jenkins Controller account), using IAM assume-role for access to the clusters.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes - none found
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

… opt-in regions

Added authRegion drop-down list-box & variable to allow explicitly
stating the region for authenticating with AWS IAM.
@choopka choopka requested a review from a team as a code owner March 3, 2025 10:40
return RegionUtils.getRegion(regionName);
} else {
return Region.getRegion(Regions.US_EAST_1);
public ListBoxModel doFillAuthRegionItems() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in ECSCloud#doFillAuthRegionItems
return RegionUtils.getRegion(regionName);
} else {
return Region.getRegion(Regions.US_EAST_1);
public ListBoxModel doFillAuthRegionItems() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing POST/RequirePOST annotation Warning

Potential CSRF vulnerability: If ECSCloud#doFillAuthRegionItems connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
return options;
}

public ListBoxModel doFillRegionNameItems() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in ECSCloud#doFillRegionNameItems
return options;
}

public ListBoxModel doFillRegionNameItems() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing POST/RequirePOST annotation Warning

Potential CSRF vulnerability: If ECSCloud#doFillRegionNameItems connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
@@ -507,9 +526,17 @@
}
return options;
}

public ListBoxModel doFillAuthRegionItems() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in DescriptorImpl#doFillAuthRegionItems
@@ -507,9 +526,17 @@
}
return options;
}

public ListBoxModel doFillAuthRegionItems() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing POST/RequirePOST annotation Warning

Potential CSRF vulnerability: If DescriptorImpl#doFillAuthRegionItems connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
@choopka
Copy link
Author

choopka commented Mar 4, 2025

@Stericson appreciate your input here.

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant