Skip to content

Update a sudo command bundle

Request

OPA roles:
  • resource_admin

Updates a specified sudo command bundle. You cannot modify a sudo command bundle that's referenced by an Okta Privileged Access security policy.

Security
bearerAuth
Path
team_namestringrequired

The name of your team

sudo_command_bundle_idstringrequired

The UUID of a sudo command bundle

Bodyapplication/jsonrequired
add_envArray of strings or null, <= 32 items

A list of environment variables to include when running sudo commands. See the sudo documentation.

descriptionstring, [ 1 .. 255 ] characters

A description of the sudo command bundle

namestring, (regex), [ 1 .. 255 ] characters^[\w\-_.]+$required

The name of the sudo command bundle. This controls the ordering of all bundles within your team. See Sudo Command Bundle.

no_execboolean or null

Whether to allow commands to execute child processes

no_passwdboolean or null

Whether to require a password when sudo is run. This should generally not be used as users don't require a password.

Default:true
run_asstring or null, (regex), [ 1 .. 64 ] characters^([%]{0,1})((([#])(\d+))|([\w\-_.]+)|((?i)[A-...

A non-root user account used to run the command

set_envboolean or null

Whether to allow overriding environment variables to commands

structured_commandsArray of objects or null, [ 0 .. 64 ] items

A list of commands to allow

sub_envArray of strings or null, <= 32 items

A list of environment variables to ignore when running the commands. See the sudo documentation.

curl -i -X PUT \
  'https://{org_name}.pam.okta.com/v1/teams/{team_name}/sudo_command_bundles/{sudo_command_bundle_id}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "create_directories",
    "description": "can be empty",
    "structured_commands": [
      {
        "command_type": "executable",
        "command": "/bin/mkdir",
        "args_type": "any"
      }
    ],
    "no_passwd": true,
    "no_exec": false,
    "set_env": false,
    "add_env": null,
    "sub_env": null
  }'

Responses

No Content