<div dir="ltr"><div>Hi,</div><div><br></div><div>I've integrated our AWS account with our Shib 3.3.1 instance for SSO access. The awsRoles attribute, which is required by AWS, is defined in attribute-resolver.xml as follows (111111111111 is the AWS account number):</div><div><br></div><div> <resolver:AttributeDefinition id="awsRoles" xsi:type="ad:Mapped" sourceAttributeID="memberOf"></div><div> <resolver:Dependency ref="myLDAP"/></div><div> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="<a href="https://aws.amazon.com/SAML/Attributes/Role">https://aws.amazon.com/SAML/Attributes/Role</a>" friendlyName="Role" /></div><div> <ad:ValueMap></div><div> <ad:ReturnValue></div><div> arn:aws:iam::111111111111:role/Dept-1,arn:aws:iam::111111111111:saml-provider/shib.tld</div><div> </ad:ReturnValue></div><div> <ad:SourceValue ignoreCase="true">.*CN=Dept-1.*</ad:SourceValue></div><div> </ad:ValueMap></div><div> </resolver:AttributeDefinition></div><div><br></div><div>If a user is in the Dept-1 AD group, browses to <a href="https://shib.tld/idp/profile/SAML2/Unsolicited/SSO?providerId=urn:amazon:webservices">https://shib.tld/idp/profile/SAML2/Unsolicited/SSO?providerId=urn:amazon:webservices</a> and authenticates, the awsRole is populated with the value arn:aws:iam::111111111111:role/Dept-1,arn:aws:iam::111111111111:saml-provider/shib.tld. It's pretty straightforward and works well.</div><div><br></div><div>We have some other AWS accounts that I'd like to integrate with Shib as well, and I'm trying to figure out how to populate the awsRoles attribute with different account numbers based on which AWS account is being accessed.</div><div><br></div><div>For example, if a user authenticates at <a href="https://shib.tld/idp/profile/SAML2/Unsolicited/SSO?providerId=urn:amazon:webservices">https://shib.tld/idp/profile/SAML2/Unsolicited/SSO?providerId=urn:amazon:webservices</a> (and is in the Dept-1 AD group), the awsRole value would be arn:aws:iam::111111111111:role/Dept-1,arn:aws:iam::111111111111:saml-provider/shib.tld.</div><div><br></div><div>If the same user instead authenticates at <a href="https://shib.tld/idp/profile/SAML2/Unsolicited/SSO?providerId=urn:amazon:webservices:test">https://shib.tld/idp/profile/SAML2/Unsolicited/SSO?providerId=urn:amazon:webservices:test</a>, the awsRole value would be arn:aws:iam::222222222222:role/Dept-1,arn:aws:iam::222222222222:saml-provider/shib.tld.</div><div><br></div><div>Any suggestions on how I might do this? Or perhaps there's a better approach? I did find <a href="https://gist.github.com/zircote/488b1d8096c9d888e5ea">https://gist.github.com/zircote/488b1d8096c9d888e5ea</a>, but that sets the account number based on AD membership. That wouldn't work for us since some users will need access to more than one AWS account.</div><div><br></div><div>Thanks,</div><div>Jason</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><pre cols="72">Jason Rotunno
System & Security Administrator
Swarthmore College
500 College Ave
Swarthmore, PA 19081
610.328.8505<br></pre><pre cols="72">Think BEFORE You Click!! Emails from Swarthmore College ITS won't be in your
Quarantine or Spam folder. We won't threaten you either! If you
receive any phishing emails, please forward them to <a href="mailto:phishing@swarthmore.edu" target="_blank">phishing@swarthmore.edu</a>.<br></pre></div></div></div></div></div>
</div>