Skip to content

Commit 633c9e5

Browse files
author
Matt Smith
authored
Merge pull request #2 from salsify/INF-7625
INF-7625 | Merge upstream
2 parents 78dfe61 + 07349a4 commit 633c9e5

20 files changed

+2541
-403
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
lib/aws-sdk/build/node_modules/
3+
lib/aws-sdk/lib/aws-js-sdk-bundle.js.LICENSE.txt

CHANGELOG.md

+30-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Changelog
22

3+
## 2023-mar-20 (v3.3)
4+
* Option to set custom Session Duration
5+
6+
## 2022-dec-19 (v3.2)
7+
* Fix [#61](https://github.com/prolane/samltoawsstskeys/issues/61). Instead of using the aws http api directly for AssumeRoleWithSAML, this version switches to using the aws sdk. This is to fix processing large SAML Assertions.
8+
* Fix [#62](https://github.com/prolane/samltoawsstskeys/issues/62). When the IDP does not add a Session Duration as SAML Assertion Attribute, ignore and continue.
9+
10+
## 2022-dec-16 (v3.1)
11+
* Fix [#58](https://github.com/prolane/samltoawsstskeys/issues/58). Parse various SAML Assertion AttributeValue syntax in a consistent way.
12+
13+
## 2022-dec-15 (v3.0)
14+
* Code refactoring due to upgrading to Extension Manifest V3
15+
* Improved popup styling
16+
* LCM on dependency libs
17+
18+
## 2022-jun-29 (v2.8)
19+
* At request of Google, the "tabs" permission is removed.
20+
21+
## 2019-feb-8 (v2.7)
22+
* Changed permissions. The extension will now ask access to any requested URL. This is needed because of changed policy in Chrome 72 for the chrome.webRequest API. Read [here](https://github.com/prolane/samltoawsstskeys/issues/28#issuecomment-461938267) for the rationale behind it. Fixes [#28](https://github.com/prolane/samltoawsstskeys/issues/28).
23+
24+
## 2019-feb-7 (v2.6)
25+
* Adds the option to enable debug logs
26+
27+
## 2018-nov-15 (v2.5)
28+
* Implements CRLF as newlines in the credentials file when the client is on Windows. Fixes [#21](https://github.com/prolane/samltoawsstskeys/issues/21)
29+
* Removes unnecessary spaces prior the newlines in credentials file. Fixes [#14](https://github.com/prolane/samltoawsstskeys/issues/14)
30+
331
## 2018-aug-2 (v2.4)
432
* Bug fix for users with one IAM role in the SAML claim. Bug was introduced with release 2.1, but according to user reports only results in an error starting with Chrome release 68.
533

@@ -17,11 +45,11 @@
1745
* Updated 'AWS SDK for Javascript' library to latest version
1846
* Plugin now shows changelog to the user after the installation of new version
1947
* Options panel has a new look to improve readability
20-
48+
2149
## 2016-jul-24 (v1.2)
2250
* Bug fix: when just 1 role in the SAML Assertion available now also works well
2351
* Now uses a regex to extract Role and Principal from SAML Assertion. This way it does not matter in what order the IDP adds the Role and Principle to the SAML Assertion.
24-
52+
2553
## 2016-apr-11 (v1.1)
2654
* Improved usability. No longer needed to manually specify PrincipalArn and RoleArn in options panel. Removed these options from the options panel. PrincipalArn and RoleArn is now parsed from the SAML Assertion itself.
2755

README.md

+62-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
11
# SAML to AWS STS Keys Conversion
2-
Google Chrome Extension which converts a SAML 2.0 assertion to AWS STS Keys (temporary credentials). Just log in to the AWS Web Management Console using your SAML IDP and the Chrome Extension will fetch the SAML Assertion from the HTTP request. The SAML Assertion is then used to call the assumeRoleWithSAML API to create the temporary credentials. (AccessKeyId, SecretAccessKey and SessionToken).
2+
Google Chrome Extension, which converts a SAML 2.0 assertion to AWS STS Keys (temporary credentials). Just log in to the AWS Web Management Console using your SAML IDP, and the Chrome Extension will fetch the SAML Assertion from the HTTP request. The SAML Assertion is then used to call the assumeRoleWithSAML API to create the temporary credentials. (AccessKeyId, SecretAccessKey and SessionToken).
33

4-
Now for Firefox!
5-
[Saml-to-AWS-STS Keys Conversion Releases](https://chrome.google.com/webstore/detail/ekniobabpcnfjgfbphhcolcinmnbehde/)
4+
The Chrome Extension can be downloaded here:
5+
[Google Chrome Web Store](https://chrome.google.com/webstore/detail/ekniobabpcnfjgfbphhcolcinmnbehde/)
6+
7+
> The source of this extension is also used as [extension](https://addons.mozilla.org/en-US/firefox/addon/saml-to-aws-sts-keys/) for Mozilla FireFox. For specific FireFox related questions you can get in touch with my awesome friend @gbvanrenswoude.
8+
9+
# Table of Contents
10+
* [Why this Chrome Extension?](#why)
11+
* [Getting Started from source](#gettingstarted)
12+
* [Plugin Development Notes](#development)
13+
* [Frequently Asked Question](#faq)
14+
15+
## <a name="why"></a>Why this Chrome Extension?
16+
If you don't have any user administration setup within AWS Identity & Access Management (IAM) but instead rely on your corporate user directory, i.e. Microsoft Active Directory. Your company uses a SAML 2.0 Identity Provider (IDP) to log in to the AWS Web Management Console (Single Sign On).
17+
Then this Chrome Extension is for you!
18+
19+
You run into trouble as soon as you want to execute some fancy scripts from your computer, which call the AWS API. When sending a request to the AWS API, you need credentials, meaning AccessKey and SecretKey. You can quickly generate these keys for each user in AWS IAM. However, since you don't have any users in AWS IAM and don't want to create users just for the sake of having an AccessKey and SecretKey, you are screwed. But there is a way to get temporary credentials specifically for your corporate identity.
20+
21+
The Security Token Service (STS) from AWS provides an API action assumeRoleWithSAML. Using the SAML Assertion given by your IDP, the Chrome Extension will call this API action to fetch temporary credentials. (AccessKeyId, SecretAccessKey and SessionToken). This way, there is no need to create some anonymous user in AWS IAM used for executing scripts. This would be an absolute security nightmare since it is impossible to audit who did what. This Chrome Extension, however, will make it super easy for you to use your corporate identity for executing scripts calling AWS API.
22+
23+
## <a name="gettingstarted"></a>Getting Started from source
24+
1. Clone this repository
25+
2. Open Chrome and go to `chrome://extensions/`
26+
3. Enable Developer Mode
27+
4. Click on "Load unpacked extension..."
28+
5. Select the folder where you cloned this repository
29+
6. Enjoy!
30+
31+
## <a name="development"></a>Plugin Development Notes
32+
Here are some important notes for development of this plugin.
33+
34+
### AWS SDK with webpack
35+
The AWS SDK for Javascript is packaged with webpack. npm and webpack configuration is located in `lib/aws-sdk/build`.
36+
37+
To install a specific version of an AWS SDK module, go into the build directory and run:
38+
```
39+
npm install --save --save-exact @aws-sdk/[email protected]
40+
```
41+
42+
To simply install the required node modules and build the sdk library required for the plugin:
43+
```
44+
npm install
45+
npm run build
46+
```
47+
48+
## <a name="faq"></a>FAQ: Frequently Asked Question
49+
1. How to check for errors in the extension?
50+
* Go to the options page of the extension
51+
* Set 'Enable DEBUG logs' to 'yes' and hit the 'Save' button below
52+
* Go to the Chrome Extensions page and look for the 'SAML to AWS STS Keys Conversion' extension
53+
* Click on the link where it says 'Inspect views'
54+
* A new Chrome DevTools window should pop up, with the 'Console' tab already selected. This is where you'll be able to view all logs.
55+
* Perform a new login and check the logs to see if there are any errors.
56+
57+
2. Why can I not save the credentials file somewhere else?
58+
With security in mind Google has limited the Chrome browser to only read and write to the Chrome Downloads directory. This way none of your Chrome extension will be able to steal data from your computer.
59+
60+
3. How long are the credentials valid?
61+
AWS calls this 'session duration'. The default session duration is 1 hour. The maximum session duration is configured in AWS IAM as an attribute of the IAM Role. Your IDP might be configured to pass along an additional SAML claim which requests to apply a custom session duration. This value can be configured to be higher than the default of 1 hour. However, this can never be higher than the configured maximum session duration on the IAM Role as this will result in an error.
62+
63+
4. Create a symlink to your .aws directory
64+
TODO

0 commit comments

Comments
 (0)