Git Product home page Git Product logo

aws_ping_saml's Introduction

SAML Authenticator for Ping Federate

Acquire temporary CLI credentials via SAML federation.

Installation

$ pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements.txt
$ pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements.txt

More info: Boto config tutorial

Update with Ping Federate URL and if MFA is needed there are several lines to adjust. 

If MITM proxy used, add the ca_bundle.crt to the folder and adjust the script.
Ping Federate will parse AD groups and create assertion for role switcher.  

The OGNL file can be adjusted accordingly to parse the groups for the assertion.  

The current format for the AD groups is 
AWS-SSO-<AWS ROLE>-<AWS ACCOUNT NUMBER> 
and will populate the assertion to provide the role switcher.

Usage

$ python saml_ping.py
usage: saml_ping.py [-h] [-d DURATION] [-p PROFILE]

Availity AWS SAML Role Selector

optional arguments:
  -h, --help   show this help message and exit
  -d DURATION  Session Token duration in seconds default 3600 or 1 hour,
               max=14400
  -p PROFILE   Credential profile to be utilized for this credential,
               default is [default].

Compatibility

Should be compatible with python 2.x or 3.x.

AWS Cli usage

$ aws [option] <command> 

TODO

  • Make installation cleaner
  • Create profiles for all roles with single logon.

Attribute Contract Fulfillment

https://aws.amazon.com/SAML/Attributes/SessionDuration	14400 (Text)
https://aws.amazon.com/SAML/Attributes/RoleSessionName	username (Adapter)
https://aws.amazon.com/SAML/Attributes/Role	#roleName = new java.util.ArrayList(), #groups = #this.get("ds.memberOf")!=null?#this.get("ds.memberOf").getValues():{}, #groups.{ #group = #this, #group = new javax.naming.ldap.LdapName(#group), #rdn = #group.getRdn(#group.size() - 1).getValue().toString(), #rdn.matches("(?i).*AWS-SSO-.*")?#roleName.add("arn:aws:iam::" + #group.getRdn(#group.size() - 1).getValue().toString().split("-")[3] + ":role/AWS_SSO_" + #group.getRdn(#group.size() - 1).getValue().toString().split("-")[2] + ",arn:aws:iam::" + #group.getRdn(#group.size() - 1).getValue().toString().split("-")[3] + ":saml-provider/pingfederate") : null }, new org.sourceid.saml20.adapter.attribute.AttributeValue(#roleName) (Expression)
SAML_SUBJECT	mail (LDAP)

aws_ping_saml's People

Watchers

Roy Sprague avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.