Ubuntu Ubuntu: Users

Summary

This module contains actions for auditing & managing users on an Ubuntu server.

The following files will be used to audit user accounts & UID ranges:

  • /etc/passwd
  • /etc/login.defs

Actions

ubuntu.users.

get_all

Get all users (including system users).

Minimum Plugin Version: 1.0.0

Input
Output

A list of User Dictionaries.

Example
1
2
3
4
- ubuntu.users.get_all:
  load:
    ubuntu_server: ubuntu_server
  save: all_users

ubuntu.users.

get_regular

Get all regular user accounts.

Minimum Plugin Version: 1.0.0

Input
Output

A list of User Dictionaries.

Example
1
2
3
4
- ubuntu.users.get_regular:
  load:
    ubuntu_server: ubuntu_server
  save: regular_users

ubuntu.users.

get_regular_uid_range

Get the UID range for regular user accounts.

Minimum Plugin Version: 1.0.0

Input
Output

A dictionary containing the following keys & values:

  • min: the start of the UID range
  • max: the end of the UID range
Example
1
2
3
4
- ubuntu.users.get_regular_uid_range:
  load:
    ubuntu_server: ubuntu_server
  save: uid_range

ubuntu.users.

get_system

Get all system user accounts.

Minimum Plugin Version: 1.0.0

Input
Output

A list of User Dictionaries.

Example
1
2
3
4
- ubuntu.users.get_system:
  load:
    ubuntu_server: ubuntu_server
  save: system_users

ubuntu.users.

output_tabbed_table

Display a users table with multiple tabs.

This action can be used to display user lists from multiple servers.

The table will have the following columns:

  • Username
  • UID
  • GID
  • Description
  • Home Directory
  • Login Shell

Minimum Plugin Version: 1.1.0

Input
  • text: the title of the table

  • tabs: a dictionary where each key is a tab name & each value is a list of User dictionaries

Output

Nothing is outputted by this action.

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
- set:
    name: tabbed_table
    value: {}

- ubuntu.users.get_all:
  load:
    ubuntu_server: ubuntu_server
  save: all_users

- ppa_tools.dictionaries.insert:
    name: My Server
  load:
    value: all_users
    dictionary: tabbed_table
  save: tabbed_table

- ubuntu.users.output_tabbed_table:
    text: All Local Users
  load:
    tabs: tabbed_table

ubuntu.users.

output_table

Display a list of users in a table.

The table will have the following columns:

  • Username
  • UID
  • GID
  • Description
  • Home Directory
  • Login Shell

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • users: a list of User Dictionaries to display in the table

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
8
9
- ubuntu.users.get_regular:
  load:
    ubuntu_server: ubuntu_server
  save: regular_users

- ubuntu.users.output_table:
    text: Regular User Accounts
  load:
    users: regular_users