• This repository has been archived on 02/May/2024
  • Stars
    star
    143
  • Rank 251,551 (Top 6 %)
  • Language
    Go
  • License
    GNU Lesser Genera...
  • Created about 2 years ago
  • Updated about 2 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,300
star
2

ubuntu-make

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

gnome-shell-extension-appindicator

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

app-center

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

archive_yaru.dart

Ubuntu Yaru Flutter Theme
Dart
336
star
6

zsys

ZSys daemon and client for zfs systems
Go
300
star
7

adsys

Active Directory bridging tool suite
Go
179
star
8

snappy-playpen

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

yaru.dart

Ubuntu Yaru Flutter widgets and themes for building desktop and web applications
Dart
176
star
10

gnome-shell-communitheme

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

WSL

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

snapcraft-desktop-helpers

Various launchers for snapcraft wiki parts
C
73
star
13

ubuntu-report

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

libreoffice-style-yaru-fullcolor

A fullcolor icon pack for Libreoffice of the awesome Yaru theme
Shell
62
star
15

face-detection-demo

Code for face detection demo snap
Go
36
star
16

authd

Authentication daemon for external Brokers
Go
36
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
28
star
19

handy_window.dart

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

codelabs

Ubuntu codelabs offline website
HTML
24
star
21

yaru_colors.dart

Yaru Colors for Flutter
Dart
23
star
22

user_manager

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

yaru_window.dart

Provides API for interacting with top-level Flutter windows.
Dart
20
star
24

font-ubuntu

Polymer imports for ubuntu fonts.
HTML
18
star
25

libreoffice

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

zsys-install

Zfs experiment on ubuntu system
Shell
18
star
27

gnome-sdk

GNOME SDK/Platform snap
Python
16
star
28

codelabs-source

HTML
16
star
29

wsl-setup

WSL setup starts the setup and reconfigure GUI or TUI
15
star
30

ubuntu-wsl-splash

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

desktop-snaps

Snap automation tools
Python
12
star
32

docker-snapcraft

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

zfs

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

tutorial-deployment

Tutorial deployment tools
Go
11
star
35

gnome-boxes

GNOME Boxes
Shell
9
star
36

thunderbird

Python
9
star
37

GoWSL

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

ubuntu-proxy-manager

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

gnome-calculator

GNOME Calculator Snap Package
8
star
40

microk8s-website

HTML
8
star
41

communitheme-sounds

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

communitheme-snap-helpers

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

grubzfs-testsuite

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

snow-on-me-snap

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

homebrew-microk8s

Homebrew MicroK8s repo for the MacOS installer
Ruby
6
star
46

cheese

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

gtk-common-themes

Shell
6
star
48

ubuntu-release-metrics

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

uupgrade-web

Ubuntu Upgrade checker web frontend
Python
6
star
50

face-detection-web

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

gnome-system-monitor

System Monitor
5
star
52

yaru_test.dart

Extensions for testing Yaru Flutter applications
Dart
5
star
53

simple-webserver-part

Snapcraft simple webserver part
Go
5
star
54

gedit

Edit text files
5
star
55

dev-scripts-ubuntu

Random scripts for doing Ubuntu work
Python
5
star
56

communitheme-set-default

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

desktop-devel-feedback

Shell
5
star
58

snap-tools

Tools useful for snap maintenance by the ~ubuntu-desktop team
Shell
5
star
59

christmas-music-carousel-snap

Snap for a christmas music carousel
Go
5
star
60

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
61

wsl-actions-example

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

uupgrade-docker

Docker containers for upgrade jobs
Shell
4
star
63

kstore

Key store
C
4
star
64

booth-demo-websites

Demo websites configuration for Ubuntu Demo manager
4
star
65

community-fosdem-2022-content

4
star
66

gnome-text-editor

GNOME Text Editor
4
star
67

app-center-ratings

Rust
4
star
68

booth-demo-manager

Display snap for events
Go
4
star
69

gnome-chess

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

ubuntu-core-slides

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

community-fosdem-2022-static

4
star
72

gnome-mines

Clear hidden mines from a minefield
4
star
73

gnome-shell-ubuntu-extensions

The ubuntu gnome-shell-extensions
4
star
74

snaps-demo-manager

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

simple-scan

Document Scanning Application
3
star
76

go-i18n

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

uupgrade-worker

3
star
78

tali

Roll dice and score points
3
star
79

gnome-sudoku

3
star
80

gnome-font-viewer

3
star
81

evince

Document viewer for popular document formats
3
star
82

decorate

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

quadrapassel

Quadrapassel Snap Package
3
star
84

gtk-theme-pop

Shell
3
star
85

snap-theme-examples

Experimenting some snap themes possible syntax
3
star
86

gnome-mahjongg

Match tiles and clear the board
3
star
87

gnome-2048

GNOME 2048 Snap Package
3
star
88

test-contributions-review

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

gnome-contacts

snap packaging for gnome-contacts
2
star
90

gnome-taquin

2
star
91

gnome-info-collect

A simple utility to collect system information.
2
star
92

community-events-assets

2
star
93

gnome-dictionary

2
star
94

gnome-recipes

Snap packaging for gnome-recipes
2
star
95

gnome-characters

A character map application
2
star
96

gnome-weather

2
star
97

gnome-logs

Log viewer for the systemd journal
2
star
98

drawing

2
star
99

epiphany

snap packaging for epiphany (GNOME Web)
2
star
100

community-events-celery

2
star