Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/administrator-manual/installation/remote_access.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ For information about administrative accounts, two-factor authentication (2FA),

## SSH

By default, the system accepts SSH connections on the standard port 22 from the internal network (LAN). Root access is enabled using the default password. To allow SSH access from the wider internet (WAN), a firewall input rule must be added for the server\'s listening port.
By default, the system accepts SSH connections on the standard port 22 from the internal network (LAN). Root access is enabled using the default password.
To allow SSH access from the wider internet (WAN), a firewall input rule must be added for the server\'s listening port.

Only `root` can log in through SSH: administrative users have no shell access. The SSH settings and keys in the NethSecurity UI can be changed only by `root`.

From a Linux machine, use the following command: :

Expand Down
15 changes: 12 additions & 3 deletions docs/administrator-manual/system/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ Access the `Backup & Restore` page under the `System` section, then click on the

The backup includes all relevant configuration files and also the list of extra packages installed by the user. The list is saved in the file `/etc/backup/installed_packages.txt`.

:::note

Only `root` can download a backup, restore a backup from a file and configure or remove the passphrase. Administrative users can run a cloud backup and restore a cloud backup. See [Roles and permissions](../users-objects/administrative_users.md#admin_roles-section).

:::

## Backup

NethSecurity allows the creation of both encrypted and unencrypted backups. Downloading an unencrypted backup is always possible by clicking the **Download unencrypted** button.
NethSecurity allows the creation of both encrypted and unencrypted backups.
Only `root` can download an unencrypted backup by clicking the **Download unencrypted** button.

To allow downloading an encrypted backup, first click on the **Configure passphrase** button and set a strong password. After that the **Download encrypted** button will become active.

Expand All @@ -27,7 +34,7 @@ To disable encrypted backups, click on the **Remove passphrase** button and **Do

## Restore {#automatic_backup-section}

The backup can be restored from the the `Restore` tab inside the page inside the `Backup & Restore` page. The user can initiate the restore process by clicking the **Restore backup** button and uploading the backup file. If the backup is encrypted, enter the passphrase, and finally, click the **Restore** button to complete the process.
Only `root` can restore a backup from a file. The backup can be restored from the `Restore` tab inside the page inside the `Backup & Restore` page. The user can initiate the restore process by clicking the **Restore backup** button and uploading the backup file. If the backup is encrypted, enter the passphrase, and finally, click the **Restore** button to complete the process.

After the restore the system will be rebooted.

Expand All @@ -49,12 +56,14 @@ This feature is available only if the firewall has a valid subscription.

Backups behave differently on devices with an active [subscription](./subscription.md).

Unencrypted backups can still be downloaded directly from the NethSecurity UI by clicking the **Download unencrypted** button.
`root` can still download unencrypted backups directly from the NethSecurity UI by clicking the **Download unencrypted** button.

Encrypted backups are stored in the cloud and integrated with Nethesis Operation Center: this approach simplifies backup management for subscription-based devices.

To restore a cloud backup, download it from my.nethesis.it or my.nethserver.com and upload it from the [Restore](#automatic_backup-section) tab. There's no need to get a new system key or register the machine again: the backup brings back the registration of the original system.

Administrative users cannot upload a backup file, but they can restore the cloud backups stored on my.nethesis.it or my.nethserver.com directly from the NethSecurity UI.

To enable encrypted cloud backups first, a passphrase must be configured by clicking the **Configure passphrase** button and setting a strong password. Once the passphrase is set you can either:

- Click the **Run cloud backup** button to create a backup immediately
Expand Down
3 changes: 2 additions & 1 deletion docs/administrator-manual/system/updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ This type of update will reboot the device (which will therefore not be reachabl

If a new version is available, the user interface will display an information banner and a dedicated button **Update System** that will allow you to perform the update.

Alternatively, it is always possible to manually upload a compatible image using the **Update with image file** button and proceed with the update.
Alternatively, `root` can manually upload a compatible image using the **Update with image file** button and proceed with the update.
Administrative users can still update the system from the Nethesis official repositories using the **Update System** button.

**Update from command line**

Expand Down
84 changes: 62 additions & 22 deletions docs/administrator-manual/users-objects/administrative_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,70 @@ sidebar_position: 2

# Administrative users {#administrative_users-section}

NethSecurity allows local users to be granted administrative access to the web interface. Administrative users should be personal accounts assigned to individual operators so that actions can be attributed to a specific user in the logs.
NethSecurity allows local users to be granted administrative access to the web interface.

## Administrative account types
Every operator must use a personal administrative user for daily work, so that each action can be attributed to a specific person in the logs. Do not share administrative accounts between operators.

NethSecurity uses the following administrative account types:
The `root` account is reserved for emergency and recovery operations, and for the few tasks that only `root` can perform, such as managing administrative users. Do not use it for ordinary administrative activity.

- `root`: local system account. It should be reserved for emergency or recovery operations whenever possible.
- **Administrative users**: local users with the **Administrator user** option enabled. They can access the NethSecurity UI and perform administrative operations.
## Roles and permissions {#admin_roles-section}

NethSecurity has three kinds of accounts:

- `root`: the local system account, with full control of the unit.
- **Administrative users**: local users with the **Administrator user** option enabled. They log in to the NethSecurity UI with a personal account and manage the firewall, but they cannot manage other administrators or perform operations that would give them the same power as `root`.
- **Non-administrative users**: local or remote users used for services such as VPN or authentication, without access to the NethSecurity UI.

:::note
The following operations are reserved to `root`:

| Operation | `root` | Administrative users |
|---|---|---|
| Create, edit or delete administrative users, or grant and remove the administrator role | Yes | No |
| Delete a local database that contains administrative users | Yes | No |
| Change the password of another account, including `root` | Yes | No, only their own |
| Change SSH settings and keys | Yes | No |
| Download a backup, encrypted or not | Yes | No |
| Restore a backup from a file | Yes | No |
| Set or remove the backup passphrase | Yes | No |
| Run a cloud backup and restore a cloud backup | Yes | Yes |
| Update the system from the Nethesis repositories | Yes | Yes |
| Install a manually uploaded image | Yes | No |
| Migrate from NethServer 7 | Yes | No |
| Manage non-administrative users and the rest of the configuration | Yes | Yes |

All actions, including denied ones, are logged: see [Administrative activity logging](#admin_logging-section).

Only `root` can log in through SSH. Administrative users have no system account, so they cannot access the shell.

The username `root` and the names of other system accounts are reserved and cannot be used for local users.

### Sessions and 2FA of removed administrators

When an administrative user is deleted, or the **Administrator user** option is disabled, all their active sessions are closed as soon as the changes are applied. The user is logged out immediately and cannot use the UI or the API anymore.

The 2FA configuration of the user is deleted at the same time: if the user becomes an administrator again, 2FA must be configured from scratch.

Changing the password of an administrative user does not close their active sessions. To log out an operator immediately, delete the user or disable the **Administrator user** option.

### Dashboard warnings

The dashboard warns `root` when:

Administrative access should be granted only to trusted operators.
- `root` still uses the default password;
- no administrative user exists besides `root`.

:::
Both warnings disappear as soon as the condition is fixed. Create a personal administrative account for each operator and keep `root` for recovery operations.

## Creating administrative users

Administrative users are created from the local users database.

To create an administrative user:
To create an administrative user, log in as `root`:

1. Create a local user.
2. Set a password for the user.
3. Enable the **Administrator user** option.
4. Save the configuration.
4. Save and apply the configuration.

For general information about local and remote user databases, see [Users databases](./users_databases.md).

Expand Down Expand Up @@ -80,18 +118,9 @@ printf '0' > "${SECRETS_DIR}/${USERNAME}/status"
```

After these commands the user can log in with just their password. 2FA can be re-enabled at any time from the web interface.
Only `root` can access the shell, so administrative users cannot recover their own account from SSH: `root` must run the commands above on their behalf.

:::note

Only the `root` account has SSH access by default. Non-root administrators cannot be recovered from SSH by the affected user themselves; an existing `root` session is required to run the commands above on their behalf.

:::

## Root and emergency access

The `root` account is the main local system account. It should be treated as an emergency or recovery account and not used for ordinary administrative activity when personal administrative users are available. Use personal administrative accounts for daily operations so that actions can be attributed to individual users in the logs.

## Administrative activity logging
## Administrative activity logging {#admin_logging-section}

NethSecurity logs administrative activity performed through the web interface in `/var/log/messages`. Administrative logs can support troubleshooting, incident analysis, and audit reconstruction.

Expand All @@ -111,6 +140,7 @@ Administrative logs allow answering questions such as:
- which configuration areas were changed;
- which values were submitted;
- whether a change was committed;
- whether an operation was denied;
- whether the action was followed by service errors or security events.

Example login event for user `goofy`:
Expand All @@ -132,6 +162,16 @@ Example of an action performed by user `goofy`:
Jun 21 09:43:19 NethSec nethsecurity-api[5376]: nethsecurity_api 2024/06/21 09:43:19 middleware.go:170: [INFO][AUTH] authorization success for user goofy. POST /api/ubus/call {"path":"ns.dashboard","method":"service-status","payload":{"service":"internet"}}
```

Example of an operation denied to user `goofy`, who tried to delete the administrative user `donald`:

```bash
Nov 24 14:35:55 NethSec nethsecurity-api[6091]: [AUTH] authorization success for user goofy. POST /api/ubus/call {"path":"ns.users","method":"delete-local-user","payload":{"name":"donald","database":"main"}}
Nov 24 14:35:55 NethSec nethsecurity-api[6091]: [UBUS][RESPONSE] ubus application error: Message='forbidden', Data='{"error":"forbidden"}'
```

The `forbidden` line does not contain the username: it refers to the request logged just before it.


## Audit and compliance recommendations

For audit-oriented deployments:
Expand All @@ -153,7 +193,7 @@ NethSecurity logs can support audit reconstruction and incident analysis. Organi

## Current limitations

- NethSecurity does not currently provide a full local RBAC model for web administrators.
- NethSecurity does not currently provide a full local RBAC model for web administrators: administrative users can change any part of the configuration except the operations reserved to `root`.
- A dedicated local read-only administrator role is not currently available.
- Administrative users should therefore be assigned only to trusted operators.
- Some log entries may require correlation with configuration commit logs or related service logs.
Expand Down
Loading