Skip to content

IVAAP Kerberos Studio Connector



IVAAP Deployment Operations Guide
Kerberos for the Studio Connector




IVAAP 2026.2

Introduction

The Studio connector (petrelstudiodbnode) reads Petrel Studio data from Microsoft SQL Server. In the IVAAP admin client (Home → Connectors → New → Petrel Studio), each connector chooses how it authenticates to SQL Server:

Authentication scheme Credentials Platform setup
Password (default for many deployments) A SQL Server login (service account) stored on the connector — same account for all users of that connector Enable petrelstudiodbnode, create the connector in the admin UI, enter host/port/database and the SQL username and password. No krb5.conf and no Kerberos guides below.
Kerberos Each user's Active Directory account (entered at connector test time or via secondary authentication) Enable petrelstudiodbnode, wire krb5.conf into the connector pod (this guide), then create the connector with authentication scheme Kerberos in the admin UI.

The database authentication scheme applies to both the connector's primary database credentials and secondary authentication when that is configured. Kerberos setup is optional — use it only when you need AD-backed SQL access rather than a shared SQL service account.

When a Studio data source uses the Kerberos authentication scheme, the connector JVM authenticates that user's AD credentials to SQL Server through Kerberos. IVAAP delivers a krb5.conf client configuration to the connector pod so the JVM knows which realm and domain controllers (KDCs) to use.

Kerberos is not IVAAP login

Kerberos in IVAAP applies only to the Studio connector's connection to SQL Server. It does not replace or configure how users sign in to the IVAAP web application itself. IVAAP login remains local authentication (default after install) or external OIDC (Cognito / Entra ID) as described in IVAAP Authentication and Post-Deployment Advanced Configuration.

No IVAAP service keytab or SPN is created — the connector uses each end user's own AD password (or cached ticket context) when they use a Kerberos-configured Studio connector.

Skip this guide if your Studio connectors use Password authentication with a SQL service account. Configure those connectors entirely in the admin client after ivaap enable petrelstudiodbnode.

Admin Quick Start (on your deployment)

Once IVAAP is installed and reachable, the bundled quickstart walks through Studio connector setup — Password vs Kerberos authentication, Test Connector, seismic path mappings, and related admin tasks. Open it in your browser (replace <IVAAP_FQDN> with the FQDN from install):

https://<IVAAP_FQDN>/admin/usermanual/gettingstarted/quickstart.html

Use http:// instead of https:// only during HTTP bootstrap before TLS is configured.

This guide is split into three parts:

Document When to use
Kerberos setup with the ivaap binary Installer-managed single-node k3s hosts (ivaap install completed) when connectors use the Kerberos scheme. Runs ivaap kerberos setup to validate AD credentials, generate krb5.conf, apply Helm values, and optionally enable the self-service registration page.
Manual Kerberos configuration GitOps-managed clusters, bring-your-own Kubernetes, or operators who prefer hand-editing ivaap.values.yaml and configmaps. Uses generate-krb5-conf.sh from ivaap-helpers.
This page Shared prerequisites, verification concepts, and troubleshooting.

Kerberos and SQL Server TLS are separate concerns. If Test Connector reports a certificate (PKIX) error rather than an authentication error, see Studio connector — Test Connector certificate error.

Prerequisites

Collect and confirm the following before starting either path. Most items need an answer from the AD or SQL Server administrator.

  • AD DNS domain
    The DNS name of the Active Directory domain the SQL Server and the IVAAP users belong to, e.g. ad.example.com.
  • Kerberos realm
    Usually the domain in upper case (AD.EXAMPLE.COM), but it can differ. Confirm with the AD administrator; a wrong realm fails with Cannot get kdc for realm or Client not found in Kerberos database.
  • Domain controller (KDC) hostnames
    Fully-qualified hostnames of at least one, preferably two, domain controllers. If the IVAAP host can resolve the domain's DNS SRV records (_kerberos._tcp.<domain> or _ldap._tcp.<domain>) the helper script discovers them; otherwise obtain them from the AD administrator.
  • DNS resolution from the IVAAP host and from inside the pod
    Both the host and the backend pod must resolve the KDC hostnames and the SQL Server hostname. Pod DNS forwards to the host resolver, so per-interface or VPN-only DNS on the host may not reach the pod — see Troubleshooting.
  • Network access
    TCP and UDP port 88 from the cluster nodes to every KDC. TCP 1433 (or the configured SQL port) to SQL Server.
  • Time synchronisation
    Kerberos tolerates 5 minutes of clock skew. Cluster nodes must run NTP/chrony against the same time source as the domain controllers.
  • SQL Server SPN
    SQL Server must have a Service Principal Name registered for the account it runs as (MSSQLSvc/<sqlhost.fqdn>:1433). Without it Kerberos cannot be negotiated and the connector fails with Server not found in Kerberos database — this is an AD/SQL configuration task, not an IVAAP one. Two details matter: the SPN must be registered to the same account the SQL Server service runs as, and the port in the SPN must be the port the connector connects to. A named instance listening on 1431 needs MSSQLSvc/<sqlhost.fqdn>:1431. A mismatch on either produces AP_REP token id does not match rather than a missing-SPN error — see SPN registered to the wrong account.
  • AD accounts and SQL logins
    Each IVAAP user who will use the Studio connector needs a SQL Server login mapped to their AD account. If the domain restricts encryption types, the accounts must allow AES128/AES256 (the "This account supports Kerberos AES ... encryption" options).
  • petrelstudiodbnode enabled
    The Studio connector must be deployed. On k3s: ivaap enable petrelstudiodbnode. On other clusters: ivaapBackendNodes.dataNodes.petrelstudiodbnode.enabled: true in your values file.
  • Tooling on the machine that generates krb5.conf (manual path only)
    For manual Kerberos configuration with generate-krb5-conf.sh: bash 4 or later, and dig, host or nslookup for DNS SRV discovery (not needed when KDCs are passed with -k). On installer-managed k3s hosts, ivaap kerberos setup generates krb5.conf internally — you do not need these tools on the operator workstation.
  • Access to the deployment
    kubectl and helm access to the IVAAP namespace, for the configmap and values changes either setup path makes.

Verification

After either setup path, confirm the wiring inside the petrelstudiodbnode container:

# k3s with ivaap-helpers aliases:
ki exec ivaap backend petrelstudiodbnode

# otherwise:
kubectl -n ivaap exec deploy/ivaap-backend-deployment -c petrelstudiodbnode -- bash
cat /etc/krb5.conf
printenv IVAAP_NODE_JAVA_OPTS
getent hosts <kdc-hostname>
getent hosts <sql-server-hostname>

Command-line connection tester

The connector image includes com.interactive.ivaap.data.petrelstudiodb.PetrelStudioDbTester. It performs the same Kerberos login and SQL connection the connector makes at runtime. Use a test AD account; the tester echoes its configuration, including the password, to the terminal.

java -cp "/opt/ivaap/ivaap-playserver/deployment/ivaapnode/lib/*" \
  com.interactive.ivaap.data.petrelstudiodb.PetrelStudioDbTester \
  --dbName=master --dbHost=sql01.example.com --dbPort=1433 \
  --dbUsername='jdoe' --dbPassword='<password>'

Use the plain AD account name (jdoe), not a UPN (jdoe@ad.example.com), as --dbUsername. The Petrel Studio JDBC driver uses this value as the Kerberos principal for password-based pre-authentication; UPN form often fails with Message stream modified (41) even when the same password works for LDAP.

A successful run prints [ OK ] Connection successful.

Admin client — Test Connector

In the IVAAP admin client, open the Studio connector data source, set the authentication scheme to Kerberos, enter an AD user's credentials, and run Test Connector. A successful test confirms DNS, KDC, SPN, and SQL login for that user. For the full admin workflow (connector creation, property fields, path mappings), see the quickstart on your deployment: https://<IVAAP_FQDN>/admin/usermanual/gettingstarted/quickstart.html.

Troubleshooting

Enable Kerberos debug output

Append the JDK Kerberos and GSS debug flags to the connector's JVM options, upgrade, recreate the backend pod, and read the petrelstudiodbnode container log:

nodeEnvConfigMaps:
  petrelstudiodbnode:
    IVAAP_NODE_JAVA_OPTS: "-Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=true -Dsun.security.jgss.debug=true"
ki ivaap logs deploy/ivaap-backend-deployment -c petrelstudiodbnode -f
# or: kubectl -n ivaap logs deploy/ivaap-backend-deployment -c petrelstudiodbnode -f

The output shows the realm and KDCs the JVM read from krb5.conf, each KDC it contacts, the encryption types negotiated, and the service principal it requests for SQL Server. That last line is the one to compare against the registered SPN when diagnosing AP_REP token id does not match.

Remove the debug flags once the problem is resolved.

Common errors

Message in log or tester output Cause Resolution
Cannot locate KDC / Cannot get kdc for realm KDC hostnames do not resolve from the pod, or the realm in krb5.conf is wrong Check getent hosts <kdc> inside the container; confirm the realm with the AD administrator
Receive timed out Port 88 blocked between the cluster nodes and the KDC Open TCP and UDP 88; use generate-krb5-conf.sh --check from the host
Clock skew too great Cluster node time differs from the domain controllers by more than 5 minutes Fix NTP/chrony on the nodes
Pre-authentication information was invalid Wrong password, or the account does not allow the encryption type offered Verify the credentials; check the account's AES options in AD
Message stream modified (41) Wrong password, encryption-type mismatch, or UPN used where sAMAccountName is required Use the plain AD account name (jdoe), not jdoe@ad.example.com; align default_tkt_enctypes in krb5.conf with domain policy
Client not found in Kerberos database Wrong username or realm Confirm the account exists; use plain account name or DOMAIN\user; verify default_realm in krb5.conf
Server not found in Kerberos database No SPN registered for the SQL Server service account on the port the connector uses Ask the SQL/AD administrator to register MSSQLSvc/<sqlhost.fqdn>:<port> (default instance is often :1433; named instances use their listener port)
Defective token detected (Mechanism level: AP_REP token id does not match!) An SPN exists, but it is registered to an account other than the one the SQL Server service runs as, or it is duplicated across accounts See SPN registered to the wrong account
KDC has no support for encryption type / Integrity check on decrypted field failed Encryption type mismatch between krb5.conf, the account and the domain policy Align default_tkt_enctypes / default_tgs_enctypes with what the domain allows; drop rc4-hmac if RC4 is disabled
Illegal config file / KrbException: ... krb5.conf Carriage returns or a syntax error in the file Strip CRs (tr -d '\r'), re-check the file, recreate the configmap and recreate the backend pod
Kerberos Login Failed with no further detail Debug output not enabled Add the debug flags above and retry
PKIX / unable to find valid certification path SQL Server TLS certificate is not trusted — not a Kerberos problem See Studio connector — Test Connector certificate error

SPN registered to the wrong account (AP_REP token id does not match)

GSSException: Defective token detected
  (Mechanism level: AP_REP token id does not match!)

This failure happens after a ticket has been issued, so the realm, the KDCs and the user's AD credentials are all correct. The connector could not decrypt SQL Server's reply, which means the service ticket was encrypted with a key that does not belong to the account SQL Server actually runs as. In practice the MSSQLSvc SPN is registered to the wrong Active Directory account, registered on the wrong port, or duplicated across two accounts. The fix is on the AD/SQL side.

Run the commands below on the SQL Server host, or from a domain-joined administrative workstation, in an elevated prompt. Substitute the service name and the port the instance actually listens on:

Instance Windows service name Example sc target
Default MSSQLSERVER sc \\<studio-server> qc MSSQLSERVER
Named MSSQL$<INSTANCE> sc \\<studio-server> qc MSSQL$MYINSTANCE

1. Identify the account running the SQL Server instance.

rem Default instance:
sc \\<studio-server> qc MSSQLSERVER

rem Named instance (example MYINSTANCE):
sc \\<studio-server> qc MSSQL$MYINSTANCE

Read the SERVICE_START_NAME line, for example SERVICE_START_NAME : DOMAIN\StudioAdmin. Every step below refers to that account.

2. Check the existing SPN.

setspn -Q MSSQLSvc/<studio-server.fqdn>:<port>

The SPN must resolve to the account from SERVICE_START_NAME, and the port must match the port the connector connects to — a named instance on 1431 needs MSSQLSvc/<studio-server.fqdn>:1431, not :1433. If the query returns nothing, the symptom is normally Server not found in Kerberos database instead.

3. Register the SPN on the service account.

setspn -S MSSQLSvc/<studio-server.fqdn>:<port> DOMAIN\StudioAdmin

Use -S rather than -A. It checks the domain for a duplicate registration before writing.

4. Verify, and rule out duplicates.

setspn -Q MSSQLSvc/<studio-server.fqdn>:<port>
setspn -X

setspn -X lists duplicate SPNs across the domain. A duplicate causes the same decryption failure even after step 3, because the KDC may pick either account's key. Remove the stale registration with setspn -D <spn> <account>.

5. Restart the instance, then re-run Test Connector or PetrelStudioDbTester.

rem Default instance:
sc \\<studio-server> stop MSSQLSERVER
sc \\<studio-server> start MSSQLSERVER

rem Named instance (example MYINSTANCE):
sc \\<studio-server> stop MSSQL$MYINSTANCE
sc \\<studio-server> start MSSQL$MYINSTANCE

Keeping the registration in place

An SPN is an attribute of the Active Directory account, not something Group Policy stores directly. If a GPO startup script or a configuration-management process enforces SPNs in your environment, have it use setspn -S against the account from SERVICE_START_NAME, and confirm no later policy moves or removes the registration.

Pod cannot resolve AD names but the host can

K3s CoreDNS forwards unknown names to the host's /etc/resolv.conf. If the host reaches the AD DNS servers only through a VPN interface or a systemd-resolved per-link domain, that path may be invisible to the pod. Either add the AD DNS servers to the host's global resolver configuration, or add a CoreDNS forward rule for the AD domain. Confirm with getent hosts <kdc> inside the petrelstudiodbnode container.

Changes not taking effect

A subPath configmap mount does not update in a running pod, and environment variable changes do not restart it. After every configmap or values change, run helm upgrade and then recreate the backend pod (ki ivaap delete pod -l app=ivaap-backend or equivalent).