Skip to content

Commit

Permalink
#344 unauthorized paged improved on gatekeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Jan 19, 2022
1 parent f81f0ee commit c61cf5a
Showing 1 changed file with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ metadata:
app: "{{ .app.harness.service.name }}-gk"
data:
proxy.yml: |-
verbose: true
verbose: {{ .root.Values.debug }}
discovery-url: {{ ternary "https" "http" $tls}}://{{ .root.Values.apps.accounts.harness.subdomain }}.{{ .root.Values.domain }}/auth/realms/{{ .root.Values.namespace }}
client-id: {{ .root.Values.apps.accounts.webclient.id | quote }}
client-secret: {{ .root.Values.apps.accounts.webclient.secret }}
secure-cookie: {{ $tls }}
forbidden-page: /templates/access-denied.html.tmpl
listen: 0.0.0.0:8080
enable-refresh-tokens: true
tls-cert:
Expand All @@ -31,6 +32,43 @@ data:
skip-openid-provider-tls-verify: true
{{- end }}
cacert.crt: {{ .files.Get "resources/certs/cacert.crt" | quote }}
access-denied.html.tmpl: |-
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>403 - Access Forbidden</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style>
.oops {
font-size: 9em;
letter-spacing: 2px;
}
.message {
font-size: 3em;
}
</style>
</head>
<body>
<div class="container text-center">
<div class="row vcenter" style="margin-top: 20%;">
<div class="col-md-12">
<div class="error-template">
<h1 class="oops">Oops!</h1>
<h2 class="message">403 Permission Denied</h2>
<div class="error-details">
Sorry, you do not have access to this page, please contact your administrator.
If you have been assigned new authorizations try to <a href="/oauth/logout?redirect=/">login again</a>.
</div>
</div>
</div>
</div>
</div>
</body>
</html>
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -82,6 +120,9 @@ spec:
- name: "{{ .app.harness.service.name }}-gk-proxy-config"
mountPath: /etc/pki/ca-trust/source/anchors/cacert.crt
subPath: cacert.crt
- name: "{{ .app.harness.service.name }}-gk-proxy-config"
mountPath: /templates/access-denied.html.tmpl
subPath: access-denied.html.tmpl
ports:
- name: http
containerPort: 8080
Expand Down

0 comments on commit c61cf5a

Please sign in to comment.