Highlighted
Super Contributor.
Super Contributor.
179 views

Adding command control rule via REST with 3.5

How do you add a command control rule in 3.5 with the REST API? According to the REST API documentation, the POST URL is "/rest/cmdctrl/rule/{name}".  However, regardless of what I use for {name}, I get back:

{
  "vrm": "3.5.0-3",
  "status": 400,
  "message": "REST ERROR, REFER MANUAL"
}

Or are we to use PUT on "/rest/cmdctrl/Policies" to add a new rule? Seems doubtful.

And, what if your have a hierarchy of rules (e.g. Rules->UNIX (ssh)->Test Servers)? How do you add the new rule under "Test Servers" in this hierarchy?

0 Likes
1 Reply
Highlighted
Super Contributor.
Super Contributor.

Re: Adding command control rule via REST with 3.5

I now have a Python 3 script that can successfully create a Vault entry for a server and a corresponding Command Control SSH Rule. This makes it easier for us to deploy PAM. This is all against 3.6.

However, I am unable to create the Command Control SSH Rule. Consider the following:

clipboard_image_1.png

How would I add a rule under Rules->UNIX (ssh)->Test Servers? I thought I should perform a GET of "/cmdctrl/Policies", modify the resulting JSON to move the recently-added Command Control SSH Rule from Rules->[new rule] to Rules->UNIX (ssh)->Test Servers->[new rule] and then perform a PUT of "/cmdctrl/Policies" with the updated JSON but that didn't work. Should it have?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.