Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run liquibase in Docker with Integrated Security #339

Open
mkucharsky opened this issue Oct 15, 2024 · 1 comment
Open

Run liquibase in Docker with Integrated Security #339

mkucharsky opened this issue Oct 15, 2024 · 1 comment

Comments

@mkucharsky
Copy link

mkucharsky commented Oct 15, 2024

I would like to run liquibase and connect to SQL Server with Integrated Security. I have checked documentation ms-sql-server-windows-integrated-security and prepared command:

liquibase --log-level=FINE status --verbose --changelog-file=sql/changelog.xml --driver=com.microsoft.sqlserver.jdbc.SQLServerDriver --url="jdbc:sqlserver://$HOST:1433;IntegratedSecurity=true;databaseName=$DB;trustServerCertificate=true;encrypt=true" --username=$USER --password=$PASS

I use official docker image: liquibase/liquibase:4.29 Unfortunately I get an error:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:edae05fd-1aa8-4120-91d8-7cc60a2d4cbf
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:4266)
        at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<init>(AuthenticationJNI.java:78)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:5345)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$300(SQLServerConnection.java:94)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:5334)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7739)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4384)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3823)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:3348)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:3179)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1953)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1263)
        at liquibase.database.jvm.JdbcConnection.open(JdbcConnection.java:42)
        ... 32 more
Caused by: java.lang.UnsatisfiedLinkError: Unable to load authentication DLL mssql-jdbc_auth-12.6.1.x64
        at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(AuthenticationJNI.java:67)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:5344)
        ... 42 more

I don’t understand this log, how can I load dll to linux machine and where I should copy this file mssql-jdbc_auth-12.6.1.x64.dll ?
How to connect within docker container to mssql server using Integrated Security?

@mkucharsky mkucharsky changed the title Run liquibase in Docker with Integreted Security Run liquibase in Docker with Integrated Security Oct 15, 2024
@jnewton03
Copy link
Contributor

hi @mkucharsky , since the liquibase docker container is based on linux, it won't natively support Windows Integrated Security. Instead you would need to extend the liquibase docker image using Kerberos Authentication. This would involve doing the following:

  • Extend the liquibase image to install Kerberos Client Libraries
  • provide a krb5.conf that contains your Kerberos realm and KDC configurations. Include (or mount) that into the container
  • Obtain a kerberos ticket or use a Keytab file and include (or mount) that into the container
  • Update the JDBC url with the correct parameters

You can find more detail about this here:
https://docs.liquibase.com/start/tutorials/ms-sql-server-integrated-security-kerberos-authentication.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants