|
|
Subscribe / Log in / New account

Two FOSDEM talks on Samba 4

February 13, 2018

This article was contributed by Tom Yates


FOSDEM

Much as some of us would love never to have to deal with Windows, it exists. It wants to authenticate its users and share resources like files and printers over the network. Although many enterprises use Microsoft tools to do this, there is a free alternative, in the form of Samba. While Samba 3 has been happily providing authentication along with file and print sharing to Windows clients for many years, the Microsoft world has been slowly moving toward Active Directory (AD). Meanwhile, Samba 4, which adds a free reimplementation of AD on Linux, has been increasingly ready for deployment. Three short talks at FOSDEM 2018 provided three different views of Samba 4, also known as Samba-AD, and left behind a pretty clear picture that Samba 4 is truly ready for use. I will cover the first two talks in this article, and the third in a later one.

War stories

The first talk, "SaMBa-AD, it works", was given by Denis Cardon from the French system integrator Tranquil IT. He specializes in deploying Samba 4, and was keen to tell of his field experiences in doing so. Samba has been big in France for some time, which Cardon attributes variously to the "free-as-in-beer syndrome" (because there are no per-seat client license costs with Samba), the "free-as-in-speech syndrome" (a general love of liberty), and "the General de Gaulle syndrome" (a dislike of American products being forced down French throats).

[Denis Cardon]

Samba 3 (which he referred to as "Samba-NT") has allowed some sites to stay clear of AD for much longer than a Microsoft NT-based domain controller infrastructure would have permitted; LDAP, SMB 2 and SMB 3 can all be used on a Samba 3 domain. But it's getting increasingly difficult to keep those sites running with newer client operating systems on the desktop; Windows 10 clients, for example, can only authenticate if you force the use of older protocols on the domain controller (DC). So over the past few years much of Cardon's business has been upgrading sites from Samba 3 to Samba 4. Of late, however, more and more sites are paying his company to come and migrate existing Microsoft AD deployments to Samba 4; word is spreading that Samba 4 is ready for production.

He has deployed Samba (both 3 and 4) in the French central government, in regional and city administrations, the French defense sector, schools, and universities. His clients include Samba 4 sites with five thousand desktops and ten thousand users, and sites with dozens of domain controllers; one site has 80. One client has asked about a 120,000 user deployment, but apparently Andrew Tridgell Bartlett, when asked, advised waiting for Samba 4.9, due out later in 2018.

Much of the rest of Cardon's talk was made up of amusing war stories: the site where the only working domain controller was a thirteen-year old NT 4 system the interior spaces of which, when opened, were entirely filled with dust. Deployments that had to be hastily finished before hurricanes took the power down, and those held up by coups d'état (though in one latter case, local representatives advised that the usual delay caused by a coup d'état was a week, so eight days later they reconvened and completed the migration). There was another migration where every system was successfully migrated except the computer that ran the door-entry-card system, so the following morning Cardon had to negotiate with security to break him into the site so he could fix it. Entertaining as these all were, the important lesson of the talk was that Samba 4 is ready to take on authentication duties for very large sites with complex requirements.

But Samba 4, as it ships with some modern server distributions, does not quite reflect this reality. CentOS 7, for example, released more than two years after Samba 4, does have a samba-dc package. But this package contains precisely one file, /usr/share/doc/samba-dc-4.6.2/README.dc, which explains that AD support is not available in Samba 4 as supplied by Red Hat. One can, of course, build Samba 4 from source, but this is not an approach favored by many production system administrators.

Vendor Samba

The second talk, "Samba AD in Fedora", given by the Red Hat Samba maintainer Andreas Schneider, explained the historical context behind the current state of vendor-provided Samba, and how things are changing. AD depends fundamentally on Kerberos, a network security protocol developed at MIT in the late 1980s. MIT Kerberos was for many years the reference implementation. Enterprise distributions, noted Schneider, are required to ship with MIT Kerberos if they want to do business with governments, and in particular with the US government. Everything in the distribution that is "Kerberized" will be integrated with MIT Kerberos. There is another implementation, Heimdal, but it is unwise to mix both implementations on a given system because the on-disk representation differs, and because there are symbol clashes if you try to load both libraries into a single application; the presence of one effectively excludes the other.

Samba, however, is built against Heimdal Kerberos. In response to a later question, Schneider said he did not ascribe this to US export restrictions on crypto. It was primarily because at the time the AD implementation was being developed, MIT Kerberos development was moribund. Heimdal, meanwhile, had an active community, which was open to implementing features that Samba needed. Volker Lendecke, who also spoke on Samba, noted from the audience that a similar situation had happened with LDAP: Samba needed an implementation, but the OpenLDAP community was resistant to accepting Samba-related patches, so Samba developed its own LDAP server. Thus, Samba went with Heimdal Kerberos. Meanwhile, Heimdal development had slowed dramatically (though it is now recovering), possibly because the lead developer went to Apple. MIT Kerberos development, however, has had a resurgence.

[Andreas Schneider]

Those changes made for an auspicious time to try to make Samba work with MIT Kerberos. The first step, said Schneider, was to develop a test harness. Samba has an extensive test suite; Schneider noted some 15,000 tests in 2,000 test suites that take him about three-and-a-half hours to run. If code refactored to work with MIT Kerberos couldn't pass those tests, it wasn't going to get into upstream.

So, in February 2013, he started writing cwrap, "a set of tools to create a fully isolated network environment to test client/server components on a single host, complete with synthetic account information, hostname resolution, and privilege separation support". Or as he then put it more pithily, an equivalent of the Matrix for applications: a way to run applications while telling them lies about the environment in which they are running.

A year later, the team was ready to run Samba with cwrap, and started working on the refactoring. The developers also started finding, reporting, and, in some cases, fixing bugs, both in Samba and in MIT Kerberos. By April 2015, the patch set to Samba had grown to 140 patches. Rebasing had become a painful daily activity, not least because the team's branch of the code was generally ignored by other Samba developers, so the team had to keep up with everyone else's development as well. Most of the test suites were passing at this time, but 69 were still failing. Nevertheless, they started to push their patches upstream.

In April 2016, work was stalled for four months by the discovery of the Badlock bug. Just as that was fixed, MIT Kerberos 1.15 was released, and Schneider and colleagues discovered that the developers had removed the API function which allowed memory management for KDB modules, thus giving their refactoring a nice big memory leak. Hasty conversations with the developers about putting it back ensued.

By January 2017 they were down to a single test failing, and a couple of extant issues. These were fixed and, on 30 April 2017, the code hit the Samba Git master branch. Five months later, Samba 4.7.0, the first version with official MIT Kerberos support, was released. Work on the correct way to package this ensued, and on 14 November 2017 Fedora 27 was released—with Samba AD. No particular timeline was given for the move into RHEL, but that is how technology generally percolates through the Red Hat environment. Should you wish to run the Fedora 27 version, Schneider said, all the important stuff works (single domain controller, forest, and external trust relationships). Installation and provisioning is now just three lines:

    # dnf install samba-dc
    # samba-tool domain provision
    # systemctl start samba.service
The second command starts a dialog that asks for information specific to your site.

More advice on running Samba followed. Samba requires DNS, because AD does. It has its own internal DNS server, but it also provides a module to work with BIND, called samba-dc-bind-dlz. Schneider feels that the module is a horrible hack that directly manipulates the AD databases and thus has write access to them. His strong advice is not to use it, and to use the Samba internal DNS server instead.

AD administration in Samba is still fairly painful; Windows ADUC tools are probably the easiest way to do it. samba-tool is still fairly painful to use, and its error messages tend to consist of Python stack traces, but it is improving all the time. Lendecke was kind enough to demonstrate to me, there and then, the new "samba-tool user edit foo" functionality, which allows all of a user's information in AD to be seen and edited in one screen; new objects can be added and the tool complains properly if you try to add an object that is not in the schema. A limited but functional module for Cockpit has recently been written, which will at least allow you to provision and interrogate an AD domain. Patches are encouraged.

Some things are still not working. Audit logging is a work in progress, and should come in Samba 4.9. Smartcard support might still be missing; he thought it probably would work, but there are no tests for it, so he can't be certain ("we normally say at Samba ... untested code is broken code"). Read-only domain controllers are unsupported in MIT Kerberos and so in Samba, and quite a lot of work inside Kerberos would be needed to support that. That brought his talk to a conclusion, eliciting some well-deserved applause.

Schneider's talk can be seen in its entirety here and, for those who like system administration war stories, Cardon's talk can be seen here.

[We would like to thank LWN's travel sponsor, the Linux Foundation, for travel assistance to Brussels for FOSDEM.]

Index entries for this article
GuestArticlesYates, Tom
ConferenceFOSDEM/2018


to post comments

Two FOSDEM talks on Samba 4

Posted Feb 13, 2018 20:27 UTC (Tue) by kiko (subscriber, #69905) [Link]

> But Samba 4, as it ships with some modern server distributions, does not quite reflect this reality.

FWIW, Ubuntu 18.04 LTS will ship with 4.7; 4.7.4 is pretty recent* and is the currently packaged version: https://launchpad.net/ubuntu/bionic/+source/samba

It's a main package, which means it'll receive security updates for the lifetime of 18.04 LTS.

[*] 4.7.5 is the latest in https://download.samba.org/pub/samba/

Two FOSDEM talks on Samba 4

Posted Feb 14, 2018 1:48 UTC (Wed) by gerdesj (subscriber, #5446) [Link]

Samba is an absolute belter. You might find this useful: https://www.mediawiki.org/wiki/Intranet (try 1.) the recipes there are pretty hard won.

I live in a Windows world and use Arch on my desktops/laptops. I stopped dual booting well over ten years ago. I have no loss of utility, quite the opposite - I get all the extras. I update everything via "yaourt -Syu" (pacman doesn't quite cut it) and job done in a few minutes. A Windows 10 update takes rather longer and of course Server 2016 (so last year +2) is just as odd.

Cripes, it turns out I can run PowerShell Core and run things like this: https://github.com/arielsanchezmora/vDocumentation without straying too far from my package manager.

I quite like systems that give me choice.

Two FOSDEM talks on Samba 4

Posted Feb 14, 2018 3:03 UTC (Wed) by jra (subscriber, #55261) [Link] (1 responses)

Minor correction. I was in Dennis's talk, and I think he was referring to Andrew Bartlett, not tridge in this case:

"but apparently Andrew Tridgell, when asked, advised waiting for Samba 4.9, due out later in 2018"

tridge is now running the Ardupilot project, which deserves its own articles ! :-).

Two FOSDEM talks on Samba 4

Posted Feb 14, 2018 7:09 UTC (Wed) by madhatter (subscriber, #4665) [Link]

Thank you for that clarification!

Two FOSDEM talks on Samba 4

Posted Feb 14, 2018 21:55 UTC (Wed) by Trou.fr (subscriber, #26289) [Link] (1 responses)

Interesting article. While Samba seems to have made great progress, I'd be very interested in some comparisons of the current state of /protocol/ security in Samba.

Recently Microsoft has evolved to allow disabling the most problematic insecure protocols from Windows, and the defaults (not when upgrading) are now saner.

Is it feasible to deploy samba as an AD in a Kerberos only environment (no NTLM ?) ? What are the default options for SMB, authentication, etc.

Securing a Microsoft AD is something that is fairly well understood now (even if not done correctly), but Samba could use security as a selling point.

Two FOSDEM talks on Samba 4

Posted Feb 15, 2018 1:45 UTC (Thu) by abartlet (subscriber, #3928) [Link]

Samba 4.7 and above supports operation with 'ntlm auth = disabled' set. However many networks have difficultly avoiding NTLM entirely.

Two FOSDEM talks on Samba 4

Posted Feb 17, 2018 15:54 UTC (Sat) by AndyBurns (guest, #27521) [Link] (3 responses)

I find it a little strange to read "the Microsoft world has been slowly moving toward Active Directory" when it seems to me that the majority of the Microsoft world arrived at Active Directory nearly two decades ago. Always interesting to hear samba news though ...

Two FOSDEM talks on Samba 4

Posted Feb 25, 2018 17:29 UTC (Sun) by jrwren (subscriber, #97799) [Link] (2 responses)

I came to make this same comment. I don't understand the world in which this is a truth in 2018. It would have been a stretch even in 2008. If anything, even the "Microsoft world" (if it exists) is moving away from AD given that printing and file sharing happens via cloud services and Microsoft's own Office system does cloud file sharing.

Two FOSDEM talks on Samba 4

Posted Feb 26, 2018 11:06 UTC (Mon) by madhatter (subscriber, #4665) [Link] (1 responses)

I hear you, but there is a huge gulf between MS best practice and what some people actually do out there. More than half my clients who have significant Windows on the desktop either still use old-style DCs or have no centralised authentication at all. Those who only have a little bit of Windows around the edge of the enterprise (ie, for the marketing laptops) also often have no centralised authentication.

I would agree that it's much less true for larger clients; I don't remember when I last saw a large business that had not already had a tried-and-trusted AD infrastructure for many years. But remember that something like 97% of all business are technically small (sub-50 employees) and 85% are downright tiny (less than ten). That's a lot of enterprises that don't really want to think about this stuff at all, and certainly aren't willing to pony up big bucks for a redundant pair of dedicated AD servers and associated licences. Finally having something free that can be deployed on cheap hardware and will work with the latest versions of Windows is a big step forward for servicing this market.

Two FOSDEM talks on Samba 4

Posted Feb 28, 2018 4:45 UTC (Wed) by bogdanbartos000 (guest, #122797) [Link]

I serviced one company that I geared to a Samba 4 domain controller over the years. It was easy taking into account 2 things: 1 - they did not have AD integration before; 2 - my wife worked for the company. When I left there, their servers were running samba 4.6 just fine. I had a few shortcomings over the years by deploying a backup domain controller that did not work well and sync failed, so it had to be removed, rather than fixed. Also administering the domain with Windows tools was not the right way, but since I was the admin, it did not matter as much. File sharing worked nicely, but print sharing had some issues. After I left, another IT company took over and plans to overhaul the things and get them to Windows Server as they think it is easier to administer and understand. I want to mention this - VERY few IT companies will deploy Samba4. They will do this if they have the proper personnel to maintain it, but there's little work available if you're a Linux guy in North America. Cost is not important at all there. Also, most companies can get a Windows Server hacked in seconds and they can go the "tried and true" way. In my vision, Samba4 is ready for corporate deployment, but I don't think many will do so. It is good that it's out there for people to use - it bridges a huge gap.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds