sec: realm import sem usuario, paridade piloto, redirect HTTPS

This commit is contained in:
ATM Platform
2026-06-15 23:38:11 +00:00
parent 138994084d
commit 9a57709d69
7 changed files with 70 additions and 13 deletions
+1
View File
@@ -184,6 +184,7 @@ metadata:
namespace: demo-prod
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.middlewares: demo-prod-redirect-https@kubernetescrd
spec:
ingressClassName: traefik
tls:
-12
View File
@@ -31,18 +31,6 @@ data:
"post.logout.redirect.uris": "https://demo.187.77.37.184.nip.io/*"
}
}
],
"users": [
{
"username": "atleta1",
"enabled": true,
"emailVerified": true,
"email": "atleta1@demo.local",
"firstName": "Atleta",
"lastName": "Um",
"credentials": [{ "type": "password", "value": "Teste@123", "temporary": false }],
"realmRoles": ["atm_athlete"]
}
]
}
kind: ConfigMap
+10
View File
@@ -0,0 +1,10 @@
# Redirect HTTP->HTTPS (Traefik). Aplicado por-ingress (nao afeta o desafio ACME do cert-manager).
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: redirect-https
namespace: demo-prod
spec:
redirectScheme:
scheme: https
permanent: true
+9 -1
View File
@@ -17,7 +17,7 @@ spec:
containers:
- name: keycloak
image: quay.io/keycloak/keycloak:26.0
args: ["start-dev"]
args: ["start-dev", "--import-realm"]
env:
- name: KC_DB
value: postgres
@@ -64,6 +64,14 @@ spec:
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 40
volumeMounts:
- name: realm-import
mountPath: /opt/keycloak/data/import
readOnly: true
volumes:
- name: realm-import
configMap:
name: kc-realm-import
---
apiVersion: v1
kind: Service
+1
View File
@@ -187,6 +187,7 @@ metadata:
namespace: piloto-prod
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.middlewares: piloto-prod-redirect-https@kubernetescrd
spec:
ingressClassName: traefik
tls:
+39
View File
@@ -0,0 +1,39 @@
apiVersion: v1
data:
athleticmap-realm.json: |
{
"realm": "athleticmap",
"enabled": true,
"displayName": "Athletic Map",
"loginWithEmailAllowed": true,
"roles": {
"realm": [
{ "name": "admin" },
{ "name": "atm_athlete" },
{ "name": "atm_trainer" },
{ "name": "atm_team_admin" },
{ "name": "atm_fed_admin" }
]
},
"clients": [
{
"clientId": "spa",
"name": "Athletic Map SPA",
"publicClient": true,
"protocol": "openid-connect",
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": false,
"redirectUris": ["https://piloto.187.77.37.184.nip.io/*"],
"webOrigins": ["https://piloto.187.77.37.184.nip.io"],
"attributes": {
"pkce.code.challenge.method": "S256",
"post.logout.redirect.uris": "https://piloto.187.77.37.184.nip.io/*"
}
}
]
}
kind: ConfigMap
metadata:
name: kc-realm-import
namespace: piloto-prod
+10
View File
@@ -0,0 +1,10 @@
# Redirect HTTP->HTTPS (Traefik). Aplicado por-ingress (nao afeta o desafio ACME do cert-manager).
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: redirect-https
namespace: piloto-prod
spec:
redirectScheme:
scheme: https
permanent: true