-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfederation-example.template.yaml
54 lines (50 loc) · 1.78 KB
/
federation-example.template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
AWSTemplateFormatVersion: 2010-09-09
Description: Janus integration for login federation
# !! This template is provided as an example and is not intended for production use !!
--!! This line invalidates the template and will need to be removed before creating a stack !!--
Parameters:
JanusInstanceRoleArn:
Description: ARN of Janus' IAM role
Type: String
AllowedPattern: "arn:aws:iam::[0-9]{12}:.+"
ConstraintDescription: Should be an AWS IAM role
Resources:
# Janus uses `assumeRole` to do login federation and needs a role in each target account
# https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison
FederationRole:
Type: AWS::IAM::Role
Properties:
Path: /federation/
MaxSessionDuration: 36000
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
AWS:
- !Ref JanusInstanceRoleArn
Action:
- sts:AssumeRole
Policies:
- PolicyName: login-federation
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: '*'
Resource: '*'
# this policy will be updated by Janus to create revocations
# (Note: the policy name needs to match the string in Federation.scala's disableFederation function)
- PolicyName: janus-role-revocation-policy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Deny
Action: "*"
Resource: "*"
Condition:
DateLessThan:
aws:TokenIssueTime: 1970-01-01T00:00:00.000Z
Outputs:
FederationRoleARN:
Value: !GetAtt FederationRole.Arn
Description: ARN of the role Janus will use to log users into this account