ClearPass Configuration API Guide
ClearPass Configuration API Guide
ClearPass Policy
Manager
Copyright Information
Copyright 2014 Aruba Networks, Inc. Aruba Networks trademarks include the Aruba Networks logo, Aruba Networks,
Aruba Wireless Networks, the registered Aruba the Mobile Edge Company logo, Aruba Mobility Management System,
Mobile Edge Architecture, People Move. Networks Must Follow, RFProtect, Green Island. All rights reserved. All other
trademarks are the property of their respective owners.
Legal Notice
The use of Aruba Networks, Inc. switching platforms and software, by all individuals or corporations, to terminate other
vendors VPN client devices constitutes complete acceptance of liability by that individual or corporation for this action and
indemnifies, in full, Aruba Networks, Inc. from any and all legal actions that might be taken against it with respect to
infringement of copyright on behalf of those vendors.
Warranty
This hardware product is protected by an Aruba warranty. For details, see the Aruba Networks standard warranty terms
and conditions.
Contents
Overview
Filter Elements
API Methods
Authentication
API Examples
10
10
11
12
Error Handling
12
15
NameList
15
Reorder
15
Status Change
16
17
Best Practices
18
18
19
19
|3
Chapter 1
Overview
The ClearPass Configuration Application Programming Interface (API) is used to read and write a number of
configuration elements (Known as Entities) either programmatically or using a script. ClearPass configuration API
allows you to configure or modify the entities in ClearPass without logging into the Admin User Interface (UI). For
example, when you create a new user in database, you may want to create a guest user automatically. You can use
ClearPass configuration API to automate this task. The API is made available through an HTTP POST based
mechanism. The API request is in the form of an XML snippet that is posted to a URL hosted by an Admin server on
the ClearPass Policy Manager. The API response received also in the form of an XML snippet. Both the XML request
and the XML response are structurally defined in an XSD format file.
The Read, Write (handles additions and updates), and Delete operations (known as Methods) are supported in
ClearPass Configuration API. You can use these methods to perform the following name-list based operations:
l
NameList This method returns the list of names for all objects created for an Entity type.
Reorder This method receives a list of names of objects of the Entity type and applies the new order to the list of
objects.
Status Change - This method gets the name-list of disabled and enabled entities of a specific type and changes the
status of the entities appropriately.
Every XML request must conform to the ClearPass Configuration API XML schema.
Root: The root element is <TipsApiRequest> for a request and <TipsApiResponse> for a response.
Sub-element: <TipsHeader> describes the version of ClearPass Policy Manager (major version followed by the
minor version, for example, 3.0.1). The Sub-element is the container object that can be controlled by adding and
modifying attributes. The sub-element in the XML request contains only the version number and the sub-element in
the XML response contains the Version number, Time of execution (exportTime), and Entity types.
Body: describes the child elements of XML data that is known as body. The body contains the Filter elements in
the XML request and a list of Entity objects in the XML response.
The following figure describes the structure of XML data in an XML response:
Overview | 4
Filter Elements
Use the Filter element to fetch a list of objects of a specific entity. You can use a filter to perform the Read and
Delete operations. A filter contains a Criteria element that includes the following:
l
fieldname Specifies the name of the field present in XML that needs to be filtered.
filterString Specifies the string that is used to match the filter during a match of the filter.
match Specifies the operator to be used. For example, the match operator equals/matches the value of the
fieldname field in the Entity object using filterString.
The following is the example of an XML request contains a filter on Guest user with a Criteria that initiates requests
to fetch Guest users that match the name kang:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0" source="Guest"/>
<Filter entity="GuestUser">
<Criteria fieldName="name" filterString="kang" match="equals"/>
</Filter>
</TipsApiRequest>
5 | Overview
Chapter 2
API Methods
The ClearPass Configuration API is modeled similar to a Representational State Transfer (REST) API, where each
method is represented by a URL. For each operation, XML request is posted to a different URL identified by the
following methods:
l
Read The Read method gets one or more filter elements and returns a unified list of Entity objects. The URL for
the Read method is https://<server>/tipsapi/config/read/<Entity>.
Write - The Write method gets a list of Entity objects to save. The operation either adds a new object or updates
an existing one. The URL for the Write method is https://<server>/tipsapi/config/write/<Entity>.
Initially, the deleteConfirm method returns a list of identifiers for each object that needs to be deleted. The
URL for the deleteConfirm method is https://<server>/tipsapi/config/deleteConfirm/<Entity>.
Creates a second request that contains the list of identifiers to delete. The URL for the Delete method is
https://<server>/tipsapi/config/delete/<Entity>.
Description
Service
AuthMethod
AuthSource
Specifies the identity store (Active Directory, LDAP Directory, SQL DB, and Token
Server) against which users and devices are authenticated.
LocalUser
Endpoint
StaticHostList
Role
RoleMapping
PostureInternal
Specifies the Internal Posture Policy that tests requests against Internal Posture rules to
assess health.
PostureExternal
API Methods | 6
Description
AuditPosture
EnforcementPolicy
Specifies the Enforcement Policy that applies Conditions (roles, health, and time
attributes) against specific values associated with those attributes to determine the
Enforcement Profile.
EnforcementProfile
Specifies the Enforcement Profiles contain attributes that define a client's scope of
access for the session.
NadClient
NadGroup
ProxyTarget
Specifies the RADIUS request that needs to be proxied to another RADIUS server.
Simulation
Specifies the Policy simulations that allow policies to be verified before they are
deployed.
AdminUser
AdminPrivileges
ServerConfig
SnmpTrapConfig
ExtSyslog
Specifies the session data, audit records, and event records that can be sent to one or
more syslog targets (servers).
DataFilter
Specifies the Data Filters used to filter records in Access Tracker and Syslog messages.
SyslogExportData
Specifies the Syslog Export Filters to notify Policy Manager where to send this
information and what type of information should be sent through Data Filters.
ContextServer
ContextServerAction
Specifies the Endpoint Context Server Actions dictionary to configure actions that are
performed on endpoints.
RADIUS Dictionary
PostureDictionary
TacacsServiceDictionary
TagDictionary
7 | API Methods
Description
TagDefinition
GuestUser
OnboardDevice
The source attribute with the value Guest must be used for the GuestUser and OnboardDevice entity types. For other
entity types, do not need to include the source attribute.
Authentication
The API Methods require authorization, which is performed using HTTP Basic authentication. The username and
password are not passed in the XML request, however, they are part of the HTTP call. If the authentication is
unsuccessful, the 401 Unauthorized http error message appears. The ClearPass Policy Manager Administrator
credentials must be used for authentication. If the administrator does not have the permissions to perform the read,
write, and delete operations, the 401 Unauthorized http error message appears.
API Methods | 8
Chapter 3
API Examples
This section provides the examples of XML request and response used to perform the following tasks:
l
The following is an example of the XML response that retrieves all Guest users with the name kang:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Thu Sep 30 10:47:26 IST 2010" version="3.0"/>
<StatusCode>Success</StatusCode>
<EntityMaxRecordCount>1</EntityMaxRecordCount>
<GuestUsers>
<GuestUser enabled="true" expiryTime="2010-12-29 12:24:37.0"
ClearPass Policy Manager | Configuration APIGuide
API Examples | 9
10 | API Examples
The following is an example of the XML response with some objects added and updated:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Thu Sep 30 10:51:27 IST 2010" version="3.0"/>
<StatusCode>Success</StatusCode>
<LogMessages>
<Message>Added 2 guest user(s)</Message>
<Message>Updated 3 guest user(s)</Message>
</LogMessages>
</TipsApiResponse>
API Examples | 11
</GuestUser>
</GuestUsers>
</TipsApiResponse>
2. Extract the element-Ids and post the XML request to the URL
https://<server>/tipsapi/config/delete/<GuestUser> as described in the following example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0" source="Guest"/>
<Delete>
<Element-Id>GuestUser_kang_MCw</Element-Id>
</Delete>
</TipsApiRequest>
With the examples provided in this section, you can retrieve, add, update, and remove the Guest User value and the
Local User value.
Error Handling
When there is an error or failure during a request, the StatusCode is set to Failure. A TipsApiError element is set with
an ErrorCode and a list of messages. The following error codes are defined in Admin API:
l
BadRequest: This error occurs when the method described in the URL
https://<server>/tipsapi/config/<method>/<Entity> is not supported or is invalid.
InvalidXml: This error occurs when XML has an invalid structure and contains some additional or missing
elements.
IllegalArgument: This error occurs when the Entity type is invalid or does not exist.
InvalidFetchCriteria: This error occurs when a field name specified does not exist for an entity type or the
specified filter operation is invalid.
ServiceFailure: This error occurs in case of an internal error occurs in API services.
DependencyBreak: This error occurs when the Entity object is an element of some other Entity and is requested for
deletion.
The following is an example of the error message occurs when a field name specified does not exist for an entity type
or the specified filter operation is invalid:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
12 | API Examples
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Wed May 28 15:31:41 IST 2014" version="6.3"/>
<StatusCode>Failure</StatusCode>
<TipsApiError>
<ErrorCode>InvalidFetchCriteria</ErrorCode>
<Message>Invalid FieldName. 'macaddress' is not a field of Endpoint entity</Message>
</TipsApiError>
</TipsApiResponse>
The source attribute with the value Guest must be used for the GuestUser and OnboardDevice entity types. For other
entity types, do not need to include the source attribute.
API Examples | 13
14 | API Examples
Chapter 4
Other API Methods
The following other API methods are available in the ClearPass Configuration API:
l
NameList
Reorder
Status Change
NameList
The NameList method returns the list of names for all objects created for an Entity type. The XML request contains an
EntityNameList request passed in the entity-type. Multiple EntityNameList requests can be passed for different Entity
types. In the XML response, EntityNameList is populated with the entity-names. The list of names in the XML
response is not displayed in a specific order. However, for the entities that have a specific order (for example,
Services), the names are populated in the order as specified in the EntityNameList.
The URL for the NameList method is https://<server>/tipsapi/config/namelist/<Entity>. The following is an example
of the XML request for the NameList method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<EntityNameList entity="Service"/>
</TipsApiRequest>
The following is an example of the XML response for the NameList method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0"><TipsHeader
exportTime="Wed May 28 15:39:01 IST 2014" version="6.3"/>
<StatusCode>Success</StatusCode>
<EntityNameList entity="Service"><Name>[Policy Manager Admin Network Login Service]
</Name><Name>[AirGroup Authorization Service]</Name><Name>[Aruba Device Access Service]
</Name><Name>[Guest Operator Logins]</Name><Name>test 802.1X Wireless</Name>
</EntityNameList>
</TipsApiResponse>
Reorder
The Reorder method receives a list of names of objects of the Entity type and applies the new order to the list of
objects. The XML request contains an EntityOrderList that should specify the entity-type and a list of names. This list
should contain the names of all elements of the entity-type. The new order is returned in the XML response. Multiple
EntityOrderList for different entity-types can be passed in the request. The Reorder method is available for the
Services entity-type.
The URL for the Reorder method is https://<server>/tipsapi/config/reorder/<Entity>. The following is an example of
the XML request for the Reorder method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="6.3"/>
<EntityOrderList entity="Service"><Name>[Aruba Device Access Service]</Name>
<Name>[Guest Operator Logins]</Name><Name>test 802.1X Wireless</Name>
<Name>[Policy Manager Admin Network Login Service]</Name>
<Name>[AirGroup Authorization Service]</Name></EntityOrderList>
</TipsApiRequest>
The following is an example of the XML response for the Reorder method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Wed May 28 15:45:24 IST 2014" version="6.3"/>
<StatusCode>Success</StatusCode>
<LogMessages><Message>Services have been reordered successfully</Message></LogMessages>
<EntityOrderList entity="Service"><Name>[Aruba Device Access Service]</Name>
<Name>[Guest Operator Logins]</Name><Name>test 802.1X Wireless</Name>
<Name>[Policy Manager Admin Network Login Service]</Name>
<Name>[AirGroup Authorization Service]</Name>
</EntityOrderList>
</TipsApiResponse>
Status Change
The Status Change method gets the name-list of disabled and enabled entities of a specific type and changes the status
of the entities appropriately. The XML request contains an EntityStatusList that includes the entity-type and a namelist. You must specify the Enabled elements first and then the Disabled elements within the name-list. The status list
of the entity is returned in the XML response.
Multiple EntityStatusList for different entity types are supported.
The URL for the Status Change method is https://<server>/tipsapi/config/status/<Entity>. The following is an
example of the XML request for the Status Change method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="6.3"/>
<EntityStatusList entity="Service">
<Enabled>[Aruba Device Access Service]</Enabled>
<Enabled>[Guest Operator Logins]</Enabled>
<Disabled>test 802.1X Wireless</Disabled>
<Disabled>[Policy Manager Admin Network Login Service]</Disabled>
</EntityStatusList>
</TipsApiRequest>
The following is an example of the XML response for the Status Change method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Wed May 28 16:08:13 IST 2014" version="6.3"/>
<StatusCode>Success</StatusCode>
<LogMessages><Message>Status successfully changed</Message></LogMessages>
<EntityStatusList entity="Service">
<Enabled>[AirGroup Authorization Service]</Enabled>
<Enabled>[Aruba Device Access Service]</Enabled>
<Enabled>[Guest Operator Logins]</Enabled>
<Disabled>[Policy Manager Admin Network Login Service]</Disabled>
<Disabled>test 802.1X Wireless</Disabled>
</EntityStatusList>
</TipsApiResponse>
Endpoint
Device
LocalUser
GuestUser
To filter based on the tag attributes, include an additional attribute called dataType=ATTRIBUTE for that filter
condition as described in the following example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<Filter entity="NadClient">
<Criteria fieldName="ipAddress" filterString="192.168.16." match="contains">
<MoreFilterConditions fieldName="TagName" fieldValue="TagValue" match="equals"
dataType="ATTRIBUTE"/>
</Criteria>
</Filter>
</TipsApiRequest>
notequals: the value of fieldname does not match the filterString exactly.
contains: the value of fieldname partially matches with the filterString, which is case sensitive
belongsto: the value of fieldname is one of the values specified in the filterString, which can be comma separated
in this case.
With the XML request and response examples given in this section, you can use the Advanced Match operation to
fetch all objects of an Entity type.
Chapter 5
Best Practices
This chapter describes the best practices to be followed to use the ClearPass Configuration API. Presently, the support
for paged results for the Entities is not available. This can impact the system when the API query for entities with more
than 50 entries. For example, a bulk query to get all Endpoints or ClearPass Guest accounts when there are hundreds of
entries present in the system is challenging. To manage ClearPass Guest accounts, Onboard certificates, ClearPass
Guest, and Onboard application features, it is recommended to use the Guest APIs supported by ClearPass Guest.
Entities such as Endpoints and ClearPass Guest users can grow in thousands depend on the deployment. These entities
support tag attributes which are custom key-value pairs added by the system or Administrator that provides more
context to the entity. A bulk query to fetch all the details of the endpoints or ClearPass Guest users in the system can
impact on the system performance. Alternatively, you can primarily use the NameList query followed by the query on
individual details for each name present in the NameList response depends on the specific endpoint.
1. Use the following command to fetch the list of MAC addresses for the endpoints present in the system:
wget --no-check-certificate --http-user=<USER> --http-password=<PASSWORD> --post-file=in.xm
l https://CPPM-Server/tipsapi/config/namelist/Endpoint
The following is an example of the XML request for the Namelist method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<EntityNameList entity="Endpoint"/>
</TipsApiRequest>
The following is an example of the XML response for the Namelist method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Mon Jul 21 13:37:13 IST 2014" version="6.4"/>
<StatusCode>Success</StatusCode>
<EntityNameList entity="Endpoint">
<Name>000c29eff62f</Name>
<Name>001122aabbcc</Name>
</EntityNameList>
</TipsApiResponse>
2. Use the following command to fetch the list of endpoints for a specific MAC address:
wget --no-check-certificate --http-user=<USER> --http-password=<PASSWORD> https://CPPM-Serv
er/tipsapi/config/read/Endpoint/equals?macAddress=000c29eff62f
The following is an example of the XML response for the Namelist method:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Mon Jul 21 14:50:09 IST 2014" version="6.4"/>
<StatusCode>Success</StatusCode>
<EntityMaxRecordCount>1</EntityMaxRecordCount>
<Endpoints>
<Endpoint macAddress="000c29eff62f" status="Known"/>
Best Practices | 18
The number of entities and the associated tag attributes with each entity can impact the performance. You can use the
API to query based on tag attributes when the queries are not repeated.
19 | Best Practices