Security
Describes how to identify and debug issues related to security.
Internal Network Connection Issue
SPIRE is currently implemented to rotate the certificates that secure mTLS traffic internally. An internal network connection issue can arise if SPIRE elements go down.
kubectl -n spire logs spire-server-0 -c spire-controller-manager
kubectl -n spire logs spire-server-1 -c spire-controller-manager
Oauth2-Proxy Pod in CrashLoopBackOff Error State
The container in the oauth2-proxy
pod started, but crashes and repeatedly
restarts incorrectly. To resolve this issue, update the DNS A record with the node IP
address where the Istio Ingress gateway pod was deployed. You can get the node IPs on the
Status page of the HPE Ezmeral Unified Analytics Software installer.
Authentication
If authentication is not working, check to see if pods are running and check pod logs. You may just need to kill a pod and restart it on a healthy node. For more complicated issues, you may need to collect some logs and talk to HPE support.
Component | Information |
---|---|
Internal OpenLDAP server | The server runs the ldap-0 pod in the
hpe-ldap namespace. You can access the ldap-0
pod with the following internal service DNS
name:
If you
need to bind it to read some users, use the following DN and
password:
Search from the following
base:
You
can also |
Oauth-2 proxy |
HPE Ezmeral Unified Analytics Software
uses Oauth2 proxy for authentication. Oauth2 runs in the
oauth2-proxy namespace.To get the pod logs, run the following command:
|
Keycloak | HPE Ezmeral Unified Analytics Software
uses a local instance of Keycloak as its OIDC provider. Keycloak runs in the
keycloak namespace in the keycloak-0 pod.
There is also a PostgreSQL pod running in the namespace that stores the
configuration and current known user information. Keycloak pod logs show login
attempts and any AD/LDAP integration errors.To view the Keycloak logs,
run:
|
Keycloak/LDAP User Authentication Test
Use a direct grant endpoint to see if a user can authenticate to Keycloak. Run this test on the command line to verify that the AD/LDAP integration is working for a particular user and that the password is correct. This test hits a client in Keycloak that allows the direct grant on the authentication flow. This test is not doing a web-based redirect flow; it is just saying give me your credentials for a token in return.
USER=<username>
PASS=<password>
DOMAIN=<your-domain>.com
RESULT=$(curl -k --data "username=$USER&password=$PASS&grant_type=password&client_id=ua-grant" https://keycloak.$DOMAIN/realms/UA/protocol/openid-connect/token)
ACCESS_TOKEN=$(echo $RESULT | sed 's/.*access_token":"//g' | sed 's/".*//g')
You can also use the direct grant endpoint for REST API endpoints that must accept and validate username and password credentials. The direct grant endpoint can validate the incoming username and password and get an access token. The remainder of the flow inside HPE Ezmeral Unified Analytics Software is based on the access token.
Keycloak Admin Web Console
The Keycloak Admin Web Console is useful for finding and resolving issues. To access the
Keycloak Admin Web Console, you will need the system master's kubectl
privileges that you got when you first installed and created the HPE Ezmeral Unified Analytics Software cluster. This is
required to get the password for the keycloak administrator.
To access the Keycloak Admin Web Console:
- Go to
keycloak.<your-UA-domain>
. - Enter
admin
as the user. - Enter the password. You can get the password with
kubectl
andkube.config
:kubectl -n keycloak get secret admin-pass -o jsonpath="{.data.password}" | base64 -D
NOTEFor Linux, usebase64 -d
. For Mac, usebase64 -D
. - In the left navigation bar of the Keycloak UI, switch over to the UA realm.
To find all users:
- In the left navigation bar, select Users.
- On the User list tab, enter * in the search field to see all known users.
- On the Users page, search for the user and click on the username.
- Select the username in the User list.
- On the user's page, select Role Mapping.
- Select the role that you want to assign to the user.
To change how users sign in (email vs username):
- In the left navigation bar, go to Realm Settings > Login tab.
- On the Login tab, select the Login with email switch.
Duplicate emails turns off automatically when you do this. This is safe to do for external AD/LDAP servers. For internal AD/LDAP servers, you can also turn this on, but there are no guard rails on the internal user management to prevent duplicate emails. If this happens, one of the users will not be able to log in.
ua-enabled
role:ua-enabled
role is the internal role that grants access to HPE Ezmeral Unified Analytics Software. If the user object
does not have this role in Keycloak, they cannot authenticate and get access to HPE Ezmeral Unified Analytics Software applications.
However, this does not do all the user onboarding and offboarding that the user management
operator does; it merely prevents access to HPE Ezmeral Unified Analytics Software. Setting this role in Keycloak should only be used
in special or emergency circumstances.- In the left navigation bar, select Users.
- Search for the user and select the user.
- On the user's page, select the Role Mapping tab.
- Select ua-enabled.
- In the left navigation bar, select User federation.
- On the LDAP page, select the Settings tab.
You can change the following settings:
- How Keycloak batch requests to the remote server.
- How often Keycloak synchs users from the server; the default is hourly.NOTEYou should not modify the settings you entered through the HPE Ezmeral Unified Analytics Software installer, such as the server address. Changing those settings here can have negative consequences because this is not the only place that those settings are stored. Keycloak uses the LDAP information, but so do some of the other HPE Ezmeral Unified Analytics Software applications. Currently, it is best not to change LDAP settings because it can break applications that depend on them.
Bad HTTP Request
400 Bad Request - The plain HTTP request was sent to HTTPS port.
To
resolve this issue, add a DestinationRule in addition to the VirtualService, as shown in the
following examples.apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: {{ include "test-app.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "test-app.labels" . | nindent 4 }}
#The URL should point to the corresponding service.
#Kubernetes provides an internal DNS mapping for services using the format <ServiceName>.<ServiceNamespace>.svc.cluster.local.
spec:
host: {{ include "test-app.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
trafficPolicy:
tls:
mode: SIMPLE
VirtualService
ExampleapiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: {{ include "test-app.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "test-app.labels" . | nindent 4 }}
spec:
gateways:
- {{ .Values.ezua.VirtualService.istioGateway }}
hosts:
- {{ .Values.ezua.VirtualService.endpoint }}
#The following VirtualService options are specific and depend on the application implementation.
#This example is a simple application with single service and simple match routes.
#The URL should point to the corresponding service.
#Kubernetes provides an internal DNS mapping for services using the format <ServiceName>.<ServiceNamespace>.svc.cluster.local.
http:
- match:
- uri:
prefix: /
rewrite:
uri: /
route:
- destination:
host: {{ include "test-app.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
port:
number: {{ .Values.service.port }}