-
Notifications
You must be signed in to change notification settings - Fork 760
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
Add support for Kerberos/Active Directory/"windows" authentication #165
Comments
AFAIK it is not possible to use AD authentication with Linux containers. There is a mechanism for using global managed service accounts for Windows containers, but we havent specifically tested that scenario yet. |
Even with workaround like linking to openldap container or something like that ? |
We havent tried it. Seems unlikely, but if you do give it a go, please let us know the results. I'm going to check into what it would take to get this lit up in Docker Engine in general with the Docker folks. |
So if I want to use AD authentication I cannot use the MSSQL docker image, but have to setup MSSQL on an Ubuntu/Redhat/Opensuse server like described here: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-active-directory-authentication?view=sql-server-linux-2017 |
We are investigating how to do Kerberos/AD in a container, but yes, for now our recommendation is to not use containers if you need AD auth and to install directly on the host or VM OS using the docs you linked to above. |
This was opened 7 months ago. Any news or progress? |
We are starting to work on this in the next couple of weeks. We will update as we have information or bits to share. |
Is this possible now? We have a Sql Server instance on a Windows host we'd like to access from a Linux Docker container via Windows Authentication. |
It may be useful to clarify that there are two, fundamentally-different issues at play here.
In the first case, SQL Server needs to function with a SPN in a context where networking is ephemeral. I think that's what the Microsoft folks are working on with this issue. Ultimately, a facility within Docker which allows apps within containers to use a SPN via host membership in a domain might answer both of these issues, but that's an upstream topic. |
So, no, it's not possible yet? |
Still working on it... |
Hey, sorry for bothering with the same question, but do you have any kind of timeline for when this issue might be resolved? Are we talking weeks, months or a longer time? |
@twright-msft I want to install SSAS model on a docker container. And that container has to be domain joined and AD authenticated. Is it possible yet in windows or linux container image? Any update on Kerberos/Active Directory/"windows" authentication ? |
Not yet. Working on it... |
Is there any timescale to supporting this? Struggling with 3rd party apps using hardcoded Integrated Security in connection DB connection string. |
I know everybody is excited about this one. Just to set expectations... we are working on it. It is planned to show up in SQL Server 2019 big data clusters first and then in SQL Server 2019 on Linux in general during the preview cycles. AD on Windows containers is further down the priority list as it is part of the overall effort to get SQL on Windows containers to production level quality. Once we have things working on SQL Server 2019, we will evaluate the demand vs effort required to take this down level to SQL Server 2017. In other words, production ready AD auth for containers is on the order of months out from now if not longer depending on whether or not you are willing to deploy SQL Server 2019 into production on Linux containers prior to general availability as part of the Early Adoption Program or not. |
Not sure if this is helpful, but I was able to get sssd working with containers by binding to the host's ssd config. In my case I was converting an old freeradius google auth server to a docker container. After enrolling the Amazon Linux 2 instance into AD using sssd, I then mounted /var/lib/sss into the centos 7 container I was building. I want to start using the Linux container, but AD auth would be a requirement to keep the business analyst happy. |
is there any workaround to use SASS with container ? |
@twright-msft is there any documentation on how to set this up for the 2019 containers? |
@esauser - Assuming you mean the SQL Server 2019 on Linux container images, please see here: https://hub.docker.com/r/microsoft/mssql-server The pull/run/configure is all basically the same as SQL Server 2017 containers with two exceptions:
i.e. your pull command should look like this: Other than that the env vars, etc. are all the same between the 2017 and 2019 images. |
@twright-msft I meant documentation specifically related to this issue. You had noted above that this would be possible in the 2019 docker images, but I can't find any documentation on how to go about the setup. |
@esauser - Ah, understood. It's not ready for testing just yet. We'll come back around and update this issue when it is ready. |
Since BDC on Openshift now supports Windows Auth, has there been any progress on this? |
Hi everyone, I think I managed to get a working solution where we dont need a domain joined container or host to use Windows Authentication. The solution is far from automated-> You'll need to create a keytab, TLS cert and configure mssql.conf outside the build, or at least that's how I did it.. Anyway.. My setup: Docker Swarm with 3 nodes (none of them are domain joined or have krb5/sssd/third-party-tools installed) This how I did it: Thx to @jovton I managed to use his hack to get SSSD up & running inside the container. I did not mount any files/dirs from the host, instead I create necessary directories during build and execute SSSD from "run_script" during boot. Result: [sssd[be[VICREM]]] [simple_bind_send] (0x0100): Executing simple bind as: CN=ldap-bind-user,OU=users,DC=vicrem,DC=se My AD user can login using Windows Auth :) Repo: https://github.com/vicrem/mssql.git //Victor |
@vicrem wow! Thanks Victor. I will have to give this a try. |
@jovton tell me if there something you need help with :) |
Authentication and authorization is now working |
I have a new setup where I create the keytab during build. Can someone return with feedback? Recommendation is to try it with a test AD. |
I would like to see the configuration of the SQL server for authentication from Kerberos (keytab file). |
@mrlioncub have a look in here -> https://github.com/vicrem/mssql.git The only configuration I have for SQL is found in initialization.sh (line 148-155) the rest is made by krb and sssd |
MS also has some documentation on the process here: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-containers-ad-auth-adutil-tutorial?view=sql-server-ver15 |
Hi All, Myself and some of my colleagues have been trying to get AD auth for mssql working inside docker for about 3 days now. We seem frustratingly close but cannot quite get it. Firstly, following the MS documentation to install MSSQL directly onto Linux and connect it to AD works fine in our environment. I followed these instructions: Our goal is to ultimately get this working in Kubernetes. Before complicating things with K8S though we tried to get it working in Docker. This is where the fun begins! We can get it to connect to AD and we can add users. However the users must be added using the long domain name. For example BARF1.COM/user1. The problem is when using SSMS or
The steps we followed to get to this point were:
This resulted in a keytab as follows
We then map this into the container @ The krb5.conf file looks as follows:
and finally we have the
It is so frustrating because
Any help would be GREATLY appreciated. We have looked far and deep over the interwebz and this thread is the most promising thing I have found. I have tried @jovton suggestion of mapping in sssd content from the host machine with no success, and I have also tried the docker-compose from @vicrem but also no luck. I see errors about LDAP bind issues and failure to create keytabs. I also tried the manual create option too. I'm about ready to give up on this and just call it impossible. The documentation from Microsoft, while on the surface looks detailed, just does not work for me at all! @vin-yu Any updates on the docs? Fingers crossed one of the gurus here can help :) Thanks, |
Hi @hopoffbaby, have a look on re_expression in SSSD, it might help you. |
Hi @hopoffbaby, we have been hitting the exact same issues as you and follow the exact same procedures. We just got it to work by adding -u 0 to the podman container create command to force sql server to run as root. So this looks more like a bug with running sql server as non-root. I believe that SQL Server 2017 ran as root. Guessing that MS haven't quite got the rootless working right in 2019 yet. |
I'm not sure about podman and rootless, but I did manage to get this solved with a support ticket to Microsoft. The issue in the end for me was permissions on the mapped in krb5 and keytab files etc, and the most surprising was having to add COM to the search path in resolv.conf. After that I was able to add the users with the short domain name and integrated Auth from ssms and sqlcmd worked as expected. Cheers |
There is a new documentation to configure AD Auth for containers and you can all do it from Linux machines using adutil, please follow the link documented here: |
@amvin87 this is the guide I followed. It might be worth adding the info about adding COM into resolv.conf as this is what fixed the problem for me and was what was advised by Microsoft premier support |
thank you for the feedback. I will edit this document or will work on creating a troubleshooting document that will have this documented and other steps to follow when configuring AD auth for SQL containers. |
Hello everyone, I can see that this topic is still active, I would like to ask. My question is: I've tried many things but I feel like I'm in endless loop. Thank you in advance! |
Hi @DukaJ here the question was specific to SQL Server running on Linux containers to support AD auth, for a .net application running on container supporting AD auth, I am not aware of the answer. |
I'd like to know that too. Although not sure it's related to this topic. From what I understand you need to use gMSA. I have several iis website that need as Auth too |
@amvin87, @hopoffbaby |
yes, you can use AD enabled servers on docker / k8s without gMSA (including SQL server on linux). You just need to setup the keytabs and spns for your service correctly. |
You can refer to this documentation https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-containers-ad-auth-adutil-tutorial?view=sql-server-ver15 and this video for a demo https://www.youtube.com/watch?v=A0mn9928N48 to configure AD auth for SQL on Linux containers. |
Here is my scenario, need some help configuring AD authentication for SQL Server Host Machine: Windows - Domain Joined How do I enable AD authentication for SQL Server? |
@wsaeed you need a few things
This is it. |
How to use windows authentication? Will assigning linux host to windows domain be enough for container to work with domain user authentication ? What can i do to achieve this ? I have windows server 2012 as active directory domain controller and debian 9 for docker.
The text was updated successfully, but these errors were encountered: