Skip to main content

Other operations

Challenge Response

Advanced authentication operation for use with token or disk encryption systems.

Signature: def challengeresponse(cinfo)

Parameters:

  • cinfo['acctid'] - The account the operation should be performed for

  • cinfo['attributes'] - Attributes for defining options in the operation

  • cinfo['challenge'] - Challenge code for the system

  • cinfocinfo['response'] - Response code for the system

Return Value:

  • ACSuccess 0

  • ACUnknownError 1

  • ACVerifyFailed 14

Remarks:

Depending on the use case for the operation, either for token authentication or for disk encryption, both the expected input and output will vary for this operation.

For disk encryption targets generally a challenge string will be provided which will be validated by the target system to receive a response string, which should be output and provided to the end user to unlock the encrypted disk.

For token authentication targets one or more challenge response operations are passed to the target system to authenticate conditions. The challenge string contains the state across the multiple operations while the response is the string to validate. The next challenge state and response should be returned until all conditions are validated.

The agent.addChallenge and agent.addResponse callbacks should be used to return information from this operation. See the callback section for full details on the individual callbacks.

Custom operation

Performs a custom operation.

Signature: custom_<functionName>(cinfo)

Return Value:

  • ACSuccess 0

  • ACUnknownError 1

Remarks:

This operation lets you define your own operations that should be run. The definition of this function will vary as you can define your own operations. The format of your function definition should be "custom_" followed by whatever your custom function name is, so for example something like custom_hello_world(cinfo).

To invoke these custom defined operations, the agent should be called with "custom" as the operation and the "customop" input set to the value of the custom function name that should be invoked. For example, to call a custom_hello_world(cinfo) function the "customop" input should be set to the value "hello_world".

Due to the nature of this operation a hard-coded list of expected parameters that would be used or return values that might be returned cannot be defined, as they will vary depending on your custom definition.

The agent.addCustomAttrs and the agent.listAttribute callbacks should be used to return information from this operation. See the callback section for full details on the individual callbacks.

Run Command

Runs a specified command

Signature: def runcommand(cinfo)

Parameters:

  • cinfo['command'] - The command that should be run

  • cinfo['commandFile'] - The file the command's output should be stored in

Return Value:

  • ACSuccess 0

  • ACUnknownError 1

Remarks:

The agent.commandOutput should be used to return the command's output from the agent. See the callback section for full details on the callback.

Update Resource

Updates the password on a subscriber resource.

Signature: def updateresource(cinfo)

Parameters:

  • cinfo['resourceaddress'] - Address of the subscriber resource

  • cinfo['resourcetype'] - Type of subscriber resource

  • cinfo['newpw'] - The password that should be set

  • cinfo['restart'] - Bool flag for If the resource should be restarted as part of the password update

  • cinfo['position'] - Indicates if the restart should be done before or after the password update

Return Value:

  • ACSuccess 0

  • ACUnknownError 1

Remarks:

If a restart should be done as part of the operation, the position parameter indicates if it should be done before or after the password update. It's value will either be "pre" for before the update, or "post" if it should be done after.