API host job access plugin

API host job access plugin#

How it works#

This Bacularis Web plugin can help administrators with managing Bacularis user access to Bacula resources. It automatically assigns jobs to API hosts using job name criterias for that.

This can be useful in Bacula environments where some users have restricted access to Bacula resources via API hosts and where administrators use consistent job name nomenclature with fixed job name format. This fixed format is needed to correctly working the plugin job selection.

As this is the action type plugin, after configuring, it needs to be assigned to the Job action plugin with proper action type. Usually a good time to assign a new job to API host is a moment when job is created, so a natural action type to run this plugin is the post-create job action.

../../_images/bacularis_plugin_api_host_job_access.png

Configuration#

The plugin has two option categories:

  • Job criteria - they are the job include and job exclude fields that use the regular expressions.

  • Destination - API host(s) to which the job will be assigned if job name fulfills the Job criteria expressions.

Job criteria are the following:

  • Job name include regex - defines regular expression. If a job name fulfills th expression, the job will be added to the selected API host(s).

  • Job name exclude regex - defines regular expression. If a job name fulfills it, the job will not be added to the selected API host(s). This job will be just skipped.

The plugin settings window:

../../_images/bacularis_plugin_api_host_job_access_configuration_window.png

Example#

Bacularis administrator created an user account for an employee to give him in Bacularis access to restore files from selected hosts only. These hosts are backed up by jobs with prefix Server_Room_XYZ.

The administrator sets access to this new user account to the restore wizard page only and only to jobs with prefix Server_Room_XYZ. The user account works fine and user can restore only assigned to his account jobs. However since now the administrator every time when he/she creates new job with prefix Server_Room_XYZ has to remember to give access to this job for that user.

This API host job access plugin can help this administrator to not forget to assign new jobs to that user account. This can be done by configuring this plugin in the following way:

Job name include regex: ^Server_Room_XYZ

API host: USER_ACCOUNT_API_HOST

where:

  • ^Server_Room_XYZ is the regular expression

  • USER_ACCOUNT_API_HOST is the API host used by the restricted user account.

Once the plugin is configured, now is time to use it in the Job action plugin and assign it to the Post-create action type. To do this, the administator needs to configure the Job action plugin with the Post-create action type.

Since now when the administrator will create a new job with Server_Room_XYZ prefix, this job will be automatically assigned to the API host used in the user account.