• This repository has been archived on 02/May/2024
  • Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Go
  • License
    GNU Lesser Genera...
  • Created over 2 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Azure AD authentication module for Ubuntu

Azure Active Directory Authentication for Ubuntu

Code quality Code coverage Go Reference License CLI License libraries

Azure AD User Authentication is only included in Ubuntu 23.04 and 23.10.

This project allows users to sign in an Ubuntu machine using Azure Active Directory credentials. It relies on Microsoft Authentication Library to communicate with Microsoft service.

The following components are distributed:

  1. A PAM module for authentication.
  2. An NSS module to query the password, group and shadow databases.
  3. A command line tool to manage the local cache for offline authentication and the system's configuration.

Ubuntu AAD Authentication supports offline authentication. Once signed in online, you are entitled to offline login.

Offline login, meaning login in without Azure Active Directory being reachable, is allowed for a period of 90 days. Once this time has passed, the user won't be able to authenticate without having access to Azure Active Directory and reset the offline grace period.

This period can be modified in aad configuration file. See the related section below.

Installation

Package installation

AAD authentication module for Ubuntu is published as a debian package. To install it from the command line, open a terminal and run the following command:

sudo apt install libpam-aad libnss-aad

This command will install the required modules for PAM and NSS.

For NSS it'll update the file /etc/nsswitch.conf and add the service aad for the databases password, group and shadow.

For PAM it'll update the file /etc/pam.d/common-auth and add the following line after pam_unix and pam_sss if it is configured:

auth [success=1 default=ignore] pam_aad.so

Automatic home directory creation

In order to get a home directory when network users login, pam_mkhomedir must be enabled. It will automatically create a home directory on first login. This step can be done by running the following command:

sudo pam-auth-update --enable mkhomedir

Setting up the Azure Application

Ubuntu Azure Active Directory requires the creation of an application in Azure. See Use the portal to create an Azure AD application and service principal that can access resources for instructions to create an application that can access resources and retrieve the tenant and application ID required for authentication.

System configuration

Finally the system must be configured to point to the Azure tenant that hosts the directory. This is done with the file /etc/aad.conf.

The default template distributed with the package details the possible settings.

### required values
## See https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal
## for more information on how to set up an Azure AD app.
# tenant_id = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
# app_id = yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy

### optional values (defaults)
# offline_credentials_expiration = 90 ; duration in days a user can log in without online verification
                                      ; set to 0 to prevent old users from being cleaned and allow offline authentication for an undetermined amount of time
                                      ; set to a negative value to prevent offline authentication
# homedir = /home/%f ; home directory pattern for the user, the following mapping applies:
#                    ; %f - full username
#                    ; %U - UID
#                    ; %l - first char of username
#                    ; %u - username without domain
#                    ; %d - domain
# shell = /bin/bash ; default shell for the user

### overriding values for a specific domain, every value inside a section is optional
# [domain.com]
# tenant_id = aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
# app_id = bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb
# offline_credentials_expiration = 30
# homedir = /home/domain.com/%u
# shell = /bin/zsh

aad-cli - AAD Authentication management tool

aad-cli is a command line tool which purpose is to help manage the configuration of the system and update the shell and home directory of a user.

See aad-cli --help for detailed usage.

Troubleshooting

Logging

Logging is done through the standard journal facility of the system which can be monitored and queried with journalctl.

Debugging can be enabled:

  • For PAM: by adding debug to the line containing the module pam_aad in /etc/pam.d/common-auth.
auth [success=1 default=ignore] pam_aad.so debug
  • For NSS: by adding the line NSS_AAD_DEBUG=1 to /etc/environment. Then reboot the machine to make it effective to the entire system.

After the previous steps, you can try logging in again and check the logs with the commands: Remember that the logs will be printed on the system logs, so you will need sudo privileges.

# You can use the -b flag to control how many boots the log will show (e.g. -b 0 will show the current boot only)
journalctl -b0 | grep pam_aad # this will show the PAM module logs

journalctl -b0 | grep nss_aad # this will show the NSS module logs

journalctl -b0 | grep _aad # this will show both logs

Offline Cache

A local cache is used to allow offline authentication. This cache is located in /var/lib/aad/cache/. It is entirely managed by the PAM and NSS modules. Users who didn't authenticate against AAD for a certain period of time are automatically deleted from the cache and won't be able to login even offline.

More Repositories

1

yaru

All Ubuntu Yaru GNOME themes
SCSS
1,354
star
2

ubuntu-make

Easy setup of common tools for developers on Ubuntu.
HTML
1,197
star
3

gnome-shell-extension-appindicator

Adds KStatusNotifierItem support to the Shell
JavaScript
1,196
star
4

app-center

App Store for Ubuntu made with Flutter 🧡 💙
Dart
644
star
5

archive_yaru.dart

Ubuntu Yaru Flutter Theme
Dart
336
star
6

zsys

ZSys daemon and client for zfs systems
Go
302
star
7

yaru.dart

Ubuntu Yaru Flutter widgets and themes for building desktop and web applications
Dart
206
star
8

adsys

Active Directory bridging tool suite
Go
199
star
9

snappy-playpen

ARCHIVED. Preserved for posterity, but these examples are no longer maintained here. Please take discussion to the snapcraft forum.
Shell
179
star
10

gnome-shell-communitheme

GNOME Shell Ubuntu community theme "communitheme"
CSS
147
star
11

WSL

Ubuntu WSL image build and launcher code.
Go
143
star
12

authd

Authentication daemon for external Brokers
Go
108
star
13

snapcraft-desktop-helpers

Various launchers for snapcraft wiki parts
C
73
star
14

ubuntu-report

Report hardware and other collected metrics like installer or upgrade information
Go
68
star
15

libreoffice-style-yaru-fullcolor

A fullcolor icon pack for Libreoffice of the awesome Yaru theme
Shell
65
star
16

face-detection-demo

Code for face detection demo snap
Go
37
star
17

snap-tutorials-code

Code and examples used in snap related tutorials
QML
34
star
18

archive_yaru_icons.dart

Ubuntu Yaru Flutter Icon Theme
Dart
27
star
19

user_manager

A tutorial for creating an Ubuntu Linux Flutter app, using the yaru theme
Dart
26
star
20

handy_window.dart

Provides modern-looking Handy windows with rounded bottom corners for Flutter applications on Linux
C
26
star
21

codelabs

Ubuntu codelabs offline website
HTML
25
star
22

yaru_colors.dart

Yaru Colors for Flutter
Dart
23
star
23

gnome-sdk

GNOME SDK/Platform snap
Python
22
star
24

yaru_window.dart

Provides API for interacting with top-level Flutter windows.
Dart
22
star
25

libreoffice

This repository hosts the snap info to package up the Libreoffice snap.
Python
21
star
26

font-ubuntu

Polymer imports for ubuntu fonts.
HTML
17
star
27

codelabs-source

HTML
16
star
28

zsys-install

Zfs experiment on ubuntu system
Shell
16
star
29

desktop-snaps

Snap automation tools
Python
15
star
30

wsl-setup

WSL setup starts the setup and reconfigure GUI or TUI
Shell
15
star
31

ubuntu-wsl-splash

A graphical application to enhance user experience with Ubuntu on WSL during the distro installation process.
Dart
14
star
32

docker-snapcraft

Docker image autobuild for latests snapcraft on latest ubuntu LTS version
12
star
33

GoWSL

GoWSL is a package that wraps around the wslApi.dll for safe and idiomatic use within Go projects.
Go
12
star
34

tutorial-deployment

Tutorial deployment tools
Go
11
star
35

gnome-boxes

GNOME Boxes
Shell
10
star
36

zfs

Temporary fork of ZOL (manually pushed to have it in github dashboard)
C
10
star
37

thunderbird

Python
10
star
38

ubuntu-proxy-manager

D-Bus service to manage system proxy settings on Ubuntu Desktop
Go
9
star
39

gnome-calculator

GNOME Calculator Snap Package
9
star
40

authd-oidc-brokers

OpenID Connect Authd brokers
Go
9
star
41

communitheme-sounds

The Ubuntu community sound theme "Communitheme"
Meson
8
star
42

homebrew-microk8s

Homebrew MicroK8s repo for the MacOS installer
Ruby
7
star
43

microk8s-website

HTML
7
star
44

grubzfs-testsuite

Test for zfs (zsys/non zsys) grub menu generation
Go
7
star
45

snow-on-me-snap

A simple nodejs webserver serving christmas snow on demand and showing up configure snap options
JavaScript
7
star
46

communitheme-snap-helpers

Various build and run helper for communitheme snap
Shell
7
star
47

snap-tools

Tools useful for snap maintenance by the ~ubuntu-desktop team
Shell
6
star
48

cheese

Take photos and videos with your webcam, with fun graphical effects
6
star
49

gtk-common-themes

Shell
6
star
50

app-center-ratings

Rust
6
star
51

dev-scripts-ubuntu

Random scripts for doing Ubuntu work
Python
6
star
52

ubuntu-release-metrics

Code to fetch data to display on https://ubuntu-release.kpi.ubuntu.com/
Python
6
star
53

uupgrade-web

Ubuntu Upgrade checker web frontend
Python
6
star
54

face-detection-web

Single page website for face detection (using face-detection-demo backend) using Polymer
JavaScript
6
star
55

gnome-system-monitor

System Monitor
5
star
56

simple-webserver-part

Snapcraft simple webserver part
Go
5
star
57

yaru_test.dart

Extensions for testing Yaru Flutter applications
Dart
5
star
58

gedit

Edit text files
5
star
59

flutter_project_template

5
star
60

simple-scan

Document Scanning Application
5
star
61

communitheme-set-default

Tools to help end user resetting communitheme settings
Shell
5
star
62

christmas-music-carousel-snap

Snap for a christmas music carousel
Go
5
star
63

desktop-cve-import

Build reports of the Ubuntu Desktop Snaps which could benefit from a rebuild to fix CVE issues in their staged packages
Python
5
star
64

wsl-actions-example

A small demonstration on how to use our Github actions to run your CI on WSL
Python
5
star
65

uupgrade-docker

Docker containers for upgrade jobs
Shell
4
star
66

kstore

Key store
C
4
star
67

booth-demo-websites

Demo websites configuration for Ubuntu Demo manager
4
star
68

community-fosdem-2022-content

4
star
69

gnome-text-editor

GNOME Text Editor
4
star
70

booth-demo-manager

Display snap for events
Go
4
star
71

desktop-devel-feedback

Shell
4
star
72

gnome-chess

This repository is the snap data that grabs the upstream gnome-chess and packages it as a snap.
4
star
73

community-fosdem-2022-static

4
star
74

gnome-mines

Clear hidden mines from a minefield
4
star
75

ubuntu-core-slides

Web version of ubuntu-core-slides exported.
4
star
76

gnome-shell-ubuntu-extensions

The ubuntu gnome-shell-extensions
4
star
77

snaps-demo-manager

Manage snaps used in our demo by autoinstalling, autoremoving and such
Go
3
star
78

go-i18n

i18n wrapper joining gettext support for Linux and Windows
Go
3
star
79

deb-ci

3
star
80

gnome-2048

GNOME 2048 Snap Package
3
star
81

uupgrade-worker

3
star
82

tali

Roll dice and score points
3
star
83

gnome-sudoku

3
star
84

gnome-font-viewer

3
star
85

evince

Document viewer for popular document formats
3
star
86

decorate

Go package containing various helpers to decorate errors with fewer lines of code in functions.
Go
3
star
87

quadrapassel

Quadrapassel Snap Package
3
star
88

gtk-theme-pop

Shell
3
star
89

snap-theme-examples

Experimenting some snap themes possible syntax
3
star
90

gnome-mahjongg

Match tiles and clear the board
3
star
91

test-contributions-review

This is just a project to test contribution review solutions
C++
3
star
92

gnome-contacts

snap packaging for gnome-contacts
2
star
93

gnome-taquin

2
star
94

gnome-info-collect

A simple utility to collect system information.
2
star
95

community-events-assets

2
star
96

gnome-dictionary

2
star
97

gnome-recipes

Snap packaging for gnome-recipes
2
star
98

gnome-weather

2
star
99

gnome-logs

Log viewer for the systemd journal
2
star
100

drawing

2
star