PUT Security Roles

The PUT /Security/Roles operation updates a security role in Keyfactor Command including the permissions set for the role and the security identities mapped to the role. On success, the operation returns HTTP 200 OK with  the details of the security role.

Tip:  The following permissions (see Security Roles and Claims) are required to use this feature:

/security/modify/

The user must hold a role containing this permission in the Global Permission Set (see Permission Sets).

Important:  This operation replaces the entire record. Any fields not included in the request are cleared or set to their default values.

To avoid unintended data loss, first perform a GET to retrieve the existing record, update only the required fields, and then submit the full set of values in the PUT request.

This operation has two available versions. Keyfactor strongly recommends using the newer operation when possible. The v1 operation has been deprecated since it supports Active Directory identities only. The v2 operation has been redesigned to provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. This version of the operation supports both Active Directory and other identity providers. For more information, see Endpoint Definition Versioning.

Version 2 of the PUT /Security/Roles operation has been redesigned to provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. All new development should use this version.

Table 818: PUT Security Roles v2 Input Parameters

Name

In

Description

Id Body

Required. An integer containing the Keyfactor Command identifier for the security role.

Use the GET Security Roles operation to retrieve a list of all the security roles to determine the role's ID.

Name Body Required. A string containing the short reference name for the security role.
Description Body Required. A string containing the description for the security role.
EmailAddress Body A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated)
Permission SetId Body

A string containing the Keyfactor Command reference GUID of the permission set to which the role is assigned (see Permission Sets).

Tip:  For details of the permissions associated with the role, use the GET Security Roles ID operation for the desired role. For details of the permissions associated withe the permission set to which the role belongs, use the GET Permission Sets ID operation with this permission set GUID. A role may be only granted a subset of the permissions available in a permission set.
Enable Cert Ownership Body A Boolean indicating if the role can be assigned as a certificate owner (True or False). If this security role is expected to be an owner of any certificate, this flag must be True. If this value is set to False, this role will not appear when trying to assign an owner to a certificate.
Permissions Body

An array of strings containing the permissions assigned to the role in a comma-separated list of Name:Value pairs. See Security Structure for an overview of the possible permissions.

For example:

Copy
"Permissions": [  
   "/portal/read/",
   "/dashboard/read/",
   "/certificates/collections/metadata/modify/6/",
   "/certificates/collections/private_key/read/6/"
],
Claims Body

An array of objects containing the claims associated with the role. ClosedShow claim details.

Table 819: PUT Security Roles v2 Response Data

Name

Description

Id

An integer containing the Keyfactor Command identifier for the security role.

Name A string containing the short reference name for the security role.
Description A string containing the description for the security role.
EmailAddress A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated)
Immutable A Boolean indicating if the role is immutable or not. Only the built-in Administrators role is considered immutable. The value of this parameter cannot be changed.
Permission SetId

A string containing the Keyfactor Command reference GUID of the permission set to which the role is assigned (see Permission Sets).

Tip:  For details of the permissions associated with the role, use the GET Security Roles ID operation for the desired role. For details of the permissions associated withe the permission set to which the role belongs, use the GET Permission Sets ID operation with this permission set GUID. A role may be only granted a subset of the permissions available in a permission set.
Enable Cert Ownership A Boolean indicating if the role can be assigned as a certificate owner (True or False). If this security role is expected to be an owner of any certificate, this flag must be True. If this value is set to False, this role will not appear when trying to assign an owner to a certificate.
Permissions

An array of strings containing the permissions assigned to the role in a comma-separated list of Name:Value pairs. See Security Structure for an overview of the possible permissions.

For example:

Copy
"Permissions": [  
   "/portal/read/",
   "/dashboard/read/",
   "/certificates/collections/metadata/modify/6/",
   "/certificates/collections/private_key/read/6/"
],
Claims

An array of objects containing the claims associated with the role. ClosedShow claim details.

Version 1 of the PUT /Security/Roles operation includes the same capabilities as version 2, but offers support for managing legacy formatted Active Directory identities only.

Important:  This version has been deprecated since it supports Active Directory identities only. It is retained for backwards compatibility, but all new development should use operations that provide support for alternate identity providers and the newer claims-based authentication model that accompanies this. These newer operations support both Active Directory and other identity providers. See version 2 of this operation.

Table 820: PUT Security Roles v1 Input Parameters

Name In

Description

Id Body

Required. An integer containing the Keyfactor Command identifier for the security role.

Use the GET Security Roles operation to retrieve a list of all the security roles to determine the role's ID.

Name Body Required. A string containing the short reference name for the security role.
Description Body Required. A string containing the description for the security role.
EmailAddress Body A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated).
Enabled Body

A Boolean that indicates whether the security role is active (True or False). Security roles that have been deactivated cannot be assigned to security identities. The default is True.

This is considered deprecated and may be removed in a future release.

Private Body

A Boolean that indicates whether the security role has been marked private (True or False). The default is False.

This is considered deprecated and may be removed in a future release.

Permission SetId Body A string indicating the Keyfactor Command reference GUID of the permission set associated with the role (see Permission Sets).
Permissions Body

An array of strings containing the permissions assigned to the role in a comma-separated list of Name:Value pairs. See Legacy Security Structure for an overview of the possible permissions.

For example:

Copy
"Permissions": [
   "AdminPortal:Read",
   "Dashboard:Read"
],
Identities Body

An array of objects containing one or more identifiers for each security identity to associate with the role. ClosedShow identifier information.

For example:

Copy
"Identities": [
   {
      "AccountName": "KEYEXAMPLE\\jsmith"
   },
   {
      "AccountName": "KEYEXAMPLE\\mjones"
   }
]

Table 821: PUT Security Roles v1 Response Data

Name

Description

Id

An integer containing the Keyfactor Command identifier for the security role.

Name A string containing the short reference name for the security role.
Description A string containing the description for the security role.
EmailAddress A string containing an email address for the role. This address can be used from workflows to direct email messages to the owner of certificates for uses such as certificate expiration alerts (assuming the certificate owner for the certificates, a security role, has been populated).
Enabled

A Boolean that indicates whether the security role is active (True or False). Security roles that have been deactivated cannot be assigned to security identities. The default is True.

This is considered deprecated and may be removed in a future release.

Immutable A Boolean that indicates whether the security role has been marked as editable (False) or (True). Internal Keyfactor Command roles are not editable. This setting is reserved for Keyfactor Command internal use.
Valid A Boolean that indicates whether the security role's audit XML is valid (True or False). A security role may become invalid if Keyfactor Command determines that it appears to have been tampered with. This setting is not end-user configurable.
Private

A Boolean that indicates whether the security role has been marked private (True or False). The default is False.

This is considered deprecated and may be removed in a future release.

Permission SetId A string indicating the Keyfactor Command reference GUID of the permission set associated with the role (see Permission Sets).
Identities

An array of objects containing information about the security identities assigned to the security role. ClosedShow identity details.

Permissions

An array of strings containing the permissions assigned to the role in a comma-separated list of Name:Value pairs. See Legacy Security Structure for an overview of the possible permissions.

For example:

Copy
"Permissions": [
   "AdminPortal:Read",
   "Dashboard:Read"
],