Alessio Treglia: Handling identities in distributed Linux cloud instances
I ve many distributed Linux instances across several clouds, be them global, such as Amazon or Digital Ocean, or regional clouds such as TeutoStack or Enter.
Probably many of you are facing the same issue: having a consistent UNIX identity across all multiple instances. While in an ideal world LDAP would be a perfect choice, letting LDAP open to the wild Internet is not a great idea.
So, how to solve this issue, while being secure? The trick is to use the new NSS module for SecurePass.
While SecurePass has been traditionally used into the operating system just as a two factor authentication, the new beta release is capable of holding extended attributes , i.e. arbitrary information for each user profile.
We will use SecurePass to authenticate users and store Unix information with this new capability. In detail, we will:
- Use PAM to authenticate the user via RADIUS
- Use the new NSS module for SecurePass to have a consistent UID/GID/ .
# apt-get install securepass-tools
ERRATA CORRIGE: securepass-tools hasn t been uploaded to Debian yet, Alessio is working hard to make the package available in time for Jessie though.For other distributions or previous releases, there s a python package (PIP) available. Make sure that you have pycurl installed and then:
# pip install securepass-toolsWhile SecurePass tools allow local configuration file, we highly recommend for this tutorial to create a global /etc/securepass.conf, so that it will be useful for the NSS module. The configuration file looks like:
[default] app_id = xxxxx app_secret = xxxx endpoint = https://beta.secure-pass.net/Where app_id and app_secrets are valid API keys to access SecurePass beta. Through the command line, we will be able to set UID, GID and all the required Unix attributes for each user:
# sp-user-xattrs user@domain.net set posixuid 1000While posixuid is the bare minimum attribute to have a Unix login, the following attributes are valid:
- posixuid UID of the user
- posixgid GID of the user
- posixhomedir Home directory
- posixshell Desired shell
- posixgecos Gecos (defaults to username)
# apt-get install libnss-securepassFor previous releases of Debian and Ubuntu can still run the NSS module, as well as CentOS and RHEL. Download the sources from: https://github.com/garlsecurity/nss_securepass Then:
./configure make make install (Debian/Ubuntu Only)For CentOS/RHEL/Fedora you will need to copy files in the right place:
/usr/bin/install -c -o root -g root libnss_sp.so.2 /usr/lib64/libnss_sp.so.2 ln -sf libnss_sp.so.2 /usr/lib64/libnss_sp.soThe /etc/securepass.conf configuration file should be extended to hold defaults for NSS by creating an [nss] section as follows:
[nss] realm = company.net default_gid = 100 default_home = "/home" default_shell = "/bin/bash"This will create defaults in case values other than posixuid are not being used. We need to configure the Name Service Switch (NSS) to use SecurePass. We will change the /etc/nsswitch.conf by adding sp to the passwd entry as follows:
$ grep sp /etc/nsswitch.conf passwd: files spDouble check that NSS is picking up our new SecurePass configuration by querying the passwd entries as follows:
$ getent passwd user user:x:1000:100:My User:/home/user:/bin/bash
$ id user uid=1000(user) gid=100(users) groups=100(users)Using this setup by itself wouldn t allow users to login to a system because the password is missing. We will use SecurePass authentication to access the remote machine. Configure PAM for SecurePass On Debian/Ubuntu, install the RADIUS PAM module with:
# apt-get install libpam-radius-authIf you are using CentOS or RHEL, you need to have the EPEL repository configured. In order to activate EPEL, follow the instructions on http://fedoraproject.org/wiki/EPEL Be aware that this has not being tested with SE-Linux enabled (check off or permissive). On CentOS/RHEL, install the RADIUS PAM module with:
# yum -y install pam_radiusNote: as per the time of writing, EPEL 7 is still in beta and does not contain the Radius PAM module. A request has been filed through RedHat s Bugzilla to include this package also in EPEL 7 Configure SecurePass with your RADIUS device. We only need to set the public IP Address of the server, a fully qualified domain name (FQDN), and the secret password for the radius authentication. In case of the server being under NAT, specify the public IP address that will be translated into it. After completion we get a small recap of the already created device. For the sake of example, we use secret as our secret password. Configure the RADIUS PAM module accordingly, i.e. open /etc/pam_radius.conf and add the following lines:
radius1.secure-pass.net secret 3 radius2.secure-pass.net secret 3Of course the secret is the same we have set up on the SecurePass administration interface. Beyond this point we need to configure the PAM to correct manage the authentication. In CentOS, open the configuration file /etc/pam.d/password-auth-ac; in Debian/Ubuntu open the /etc/pam.d/common-auth configuration and make sure that pam_radius_auth.so is in the list.
auth required pam_env.so auth sufficient pam_radius_auth.so try_first_pass auth sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 500 quiet auth required pam_deny.soConclusions Handling many distributed Linux poses several challenges, from software updates to identity management and central logging. In a cloud scenario, it is not always applicable to use traditional enterprise solutions, but new tools might become very handy. To freely subscribe to securepass beta, join SecurePass on: http://www.secure-pass.net/open
And then send an e-mail to info@garl.ch requesting beta access.
If you have users behind NAT, you ll also need a TURN server for relay:
In both cases, setup is not too difficult, particularly if using
Glamor Cleanup
Before I start really digging in to reworking the Render support in
Glamor, I wanted to take a stab at cleaning up some cruft which has
accumulated in Glamor over the years. Here's what I've done so far.
Get rid of the Intel fallback paths
I think it's my fault, and I'm sorry.
The original Intel Glamor code has Glamor implement accelerated
operations using GL, and when those fail, the Intel driver would fall
back to its existing code, either UXA acceleration or software. Note
that it wasn't Glamor doing these fallbacks, instead the Intel
driver had a complete wrapper around every rendering API, calling
special Glamor entry points which would return FALSE if GL couldn't
accelerate the specified operation.
The thinking was that when GL couldn't do something, it would be far
faster to take advantage of the existing UXA paths than to have Glamor
fall back to pulling the bits out of GL, drawing to temporary images
with software, and pushing the bits back to GL.
And, that may well be true, but what we've managed to prove is that
there really aren't any interesting rendering paths which GL can't
do directly. For core X, the only fallbacks we have today are for
operations using a weird planemask, and some CopyPlane operations. For
Render, essentially everything can be accelerated with the GPU.
At this point, the old Intel Glamor implementation is a lot of ugly
code in Glamor without any use. I posted patches to the Intel driver
several months ago which fix the Glamor bits there, but they haven't
seen any review yet and so they haven't been merged, although I've
been running them since 1.16 was released...
Getting rid of this support let me eliminate all of the _nf functions
exported from Glamor, along with the GLAMOR_USE_SCREEN and
GLAMOR_USE_PICTURE_SCREEN parameters, along with the
GLAMOR_SEPARATE_TEXTURE pixmap type.
Force all pixmaps to have exact allocations
Glamor has a cache of recently used textures that it uses to avoid
allocating and de-allocating GL textures rapidly. For pixmaps small
enough to fit in a single texture, Glamor would use a cache texture
that was larger than the pixmap.
I disabled this when I rewrote the Glamor rendering code for core X;
that code used texture repeat modes for tiles and stipples; if the
texture wasn't the same size as the pixmap, then texturing would fail.
On the Render side, Glamor would actually reallocate pixmaps used as
repeating texture sources. I could have fixed up the core rendering
code to use this, but I decided instead to just simplify things and
eliminate the ability to use larger textures for pixmaps everywhere.
Remove redundant pixmap and screen private pointers
Every Glamor pixmap private structure had a pointer back to the pixmap
it was allocated for, along with a pointer to the the Glamor screen
private structure for the related screen. There's no particularly good
reason for this, other than making it possible to pass just the Glamor
pixmap private around a lot of places. So, I removed those pointers
and fixed up the functions to take the necessary extra or replaced
parameters.
Similarly, every Glamor fbo had a pointer back to the Glamor screen
private too; I removed that and now pass the Glamor screen private
parameter as needed.
Reducing pixmap private complexity
Glamor had three separate kinds of pixmap private structures, one for
'normal' pixmaps (those allocated by them selves in a single FBO), one
for 'large' pixmaps, where the pixmap was tiled across many FBOs, and
a third for 'atlas' pixmaps, which presumably would be a single FBO
holding multiple pixmaps.
The 'atlas' form was never actually implemented, so it was pretty easy
to get rid of that.
For large vs normal pixmaps, the solution was to move the extra data
needed by large pixmaps into the same structure as that used by normal
pixmaps and simply initialize those elements correctly in all
cases. Now, most code can ignore the difference and simply walk the
array of FBOs as necessary.
The other thing I did was to shrink the number of possible pixmap
types from 8 down to three. Glamor now exposes just these possible
pixmap types:
I joined the board of directors of the
If someone would have told me that I would visit three feminist events this year I would have slowly nodded at them and responded with "yeah, sure..." not believing it. But sometimes things take their own turns.
It all started with the
I've spent the past thirty minutes installing FreeBSD as a KVM guest. This mostly involved fetching the ISO (I chose the latest stable release 10.0), and accepting all the defaults. A pleasant experience.
As I'm running KVM inside



















The
it's this time of the year^Wrelease cycle again almost. in ten days
(& roughly two hours), the freeze for the next debian release, codenamed
jessie, will start. by this time packages must be in testing in
order to be candidates for the release, as explained in the release team's
detailed
Recently I was trying some statistics on the qtbase-module (where QtCore, QtGui, QtWidgets and so on lives) and was wondering who made them.
I have just made an eleventh hour upload of tuxpaint, tuxpaint-config and tuxpaint-stamps. With luck, this will make it in time for the Nov. 5 Jessie freeze deadline so it goes in as an unassisted migration. Coming soon to a mirror near you!
Even though the