Skip to content

Commit

Permalink
Add discrete change-password rules
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Oct 27, 2023
1 parent 0ca78ef commit 0611eb7
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
25 changes: 23 additions & 2 deletions spire/templates/apps/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ Conditions:
IsProduction: !Equals [!Ref EnvironmentType, Production]

Resources:
ChangePasswordListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Actions:
- RedirectConfig:
Host: !Ref IdHostname
Port: "443"
Path: /.well-known/change-password
Protocol: HTTPS
Query: ""
StatusCode: HTTP_302
Type: redirect
Conditions:
- Field: host-header
Values:
- metrics.dovetail.*
- Field: path-pattern
Values:
- /.well-known/change-password
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "10"]]
HostHeaderListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Expand All @@ -44,7 +65,7 @@ Resources:
Values:
- metrics.dovetail.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "00"]]
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "20"]]
RedirectHostHeaderListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Expand All @@ -62,7 +83,7 @@ Resources:
Values:
- metrics.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "02"]]
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "30"]]

TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Expand Down
23 changes: 22 additions & 1 deletion spire/templates/apps/networks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,27 @@ Resources:

# INTERNET-FACING WEB SERVER #################################################

PublicWebHostChangePasswordListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Actions:
- RedirectConfig:
Host: !Ref IdHostname
Port: "443"
Path: /.well-known/change-password
Protocol: HTTPS
Query: ""
StatusCode: HTTP_302
Type: redirect
Conditions:
- Field: host-header
Values:
- networks.*
- Field: path-pattern
Values:
- /.well-known/change-password
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "10"]]
PublicWebHostHeaderSharedAlbListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Expand All @@ -151,7 +172,7 @@ Resources:
Values:
- networks.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "01"]]
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "20"]]

PublicWebTargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Expand Down
23 changes: 22 additions & 1 deletion spire/templates/apps/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ Conditions:
IsProduction: !Equals [!Ref EnvironmentType, Production]

Resources:
ChangePasswordListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Actions:
- RedirectConfig:
Host: !Ref IdHostname
Port: "443"
Path: /.well-known/change-password
Protocol: HTTPS
Query: ""
StatusCode: HTTP_302
Type: redirect
Conditions:
- Field: host-header
Values:
- publish.*
- Field: path-pattern
Values:
- /.well-known/change-password
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "10"]]
HostHeaderListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Expand All @@ -52,7 +73,7 @@ Resources:
Values:
- publish.*
ListenerArn: !Ref AlbHttpsListenerArn
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "01"]]
Priority: !Join ["", [!Ref AlbListenerRulePriorityPrefix, "20"]]

TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Expand Down

0 comments on commit 0611eb7

Please sign in to comment.