security-settings

Security-settings

The security-settings command manages the SqlBak Agent policy for running scripts from jobs.

Use this command to export, update, or reset the permissions that control whether job scripts can run on the agent machine.

Syntax

sqlbak security-settings <command> [options]

Subcommands

get      Export the current application security settings.
set      Load application security settings from a file.
reset    Reset the application security settings to defaults.

The current CLI also supports short aliases:

get, g
set, s
reset, r

Export current settings

Use get with --save-to-file to write the current security settings to a JSON file.

sqlbak security-settings get --save-to-file=/tmp/security-settings.json --confirm

Options:

--save-to-file, -sf    Save the application security settings to a file.
--confirm, -rc         Confirm file overwriting.

Update settings from a file

Create or edit a JSON file:

{
  "allow_exec_system_scripts": true,
  "allow_exec_source_scripts": true
}

Apply the settings:

sqlbak security-settings set --load-from-file=/tmp/security-settings.json

Options:

--load-from-file, -lf    Load the application security settings from a file.

Reset settings

Use reset to restore the default security settings.

sqlbak security-settings reset --confirm

Options:

--confirm, -rc    Confirm the reset operation.

JSON fields

allow_exec_system_scripts

Controls whether system scripts can be executed by jobs on this agent. System scripts include batch, command-line, PowerShell, or shell scripts.

allow_exec_source_scripts

Controls whether source/database scripts can be executed by jobs on this agent.

Related article

For background and UI instructions, see Script Execution Restrictions.