apache / apache/gravitino

Enable Kerberos. The _HOST part in the SPN HTTP/_HOST account was not replaced with the actual hostname, resulting in an authentication error

Open
#8,873 2 comments 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### Version

0.9.0

### Describe what's wrong

I have integrated the gravitino 0.9.0 version into ambari 2.7.8. My cluster has enabled Kerberos authentication. My service's kerberos.json configuration is:
{
"services": [
{
"name": "GRAVITINO",
"identities": [
{
"name": "gravitino_smokeuser",
"reference": "/smokeuser"
},
{
"name": "gravitino_user",
"principal": {
"value": "HTTP/_HOST@${realm}",
"type" : "user",
"local_username" : "${gravitino-env/gravitino_user}",
"configuration": "gravitino-conf/gravitino.authenticator.kerberos.principal"
},
"keytab": {
"file": "${keytab_dir}/spnego.headless.keytab",
"owner": {
"name": "${gravitino-env/gravitino_user}",
"access": "r"
},
"group": {
"name": "${cluster-env/user_group}",
"access": "r"
},
"configuration": "gravitino-conf/gravitino.authenticator.kerberos.keytab"
}
}
],
"configurations": [
{
"gravitino-conf": {
"gravitino.authenticators": "kerberos"
}
}
],
"components": [
{
"name": "GRAVITINO_SERVER"
}
]
}
]
}

The corresponding authentication configuration in gravitino.conf is as follows:

Image

The host names of my three hosts are: kk1, kk2, and kk3.

I used a regular account for authentication: kinit testaa, and then operated the API using curl --negotiate -u : http://xxx:8090/xxx. However, the backend log reported a Kerberos authentication error.

### Error message and/or stacktrace

No screenshots were provided for the specific error. The error occurred during the authentication process when the _HOST part of the principal "HTTP/_HOST@${realm}" was not replaced with the actual hostname "kk1". For example: HTTP/kk1@${realm}

### How to reproduce

Please refer to the description I provided earlier.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the Kerberos settings in gravitino.conf and the kerberos.json principal configuration, then reproduce the request with kinit testaa and curl --negotiate. Trace where the HTTP/_HOST principal is consumed during authentication. Done means _HOST resolves to the actual host, such as kk1, and the authenticated API request succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.