Issue
A user would like to implement Automation in Red Canary that can automatically reinstate a decommissioned endpoint that checks in.
Environment
Red Canary Portal
Automation
Resolution
While the Red Canary Portal does not currently have a Reinstate playbook action, you can workaround this using the Invoke Webhook or API playbook action and Red Canary's Reinstate API endpoint. Before getting started, you will need to generate an API Key, if you have not already.
How to Generate an API Key
- Click your user icon at the top right in your Red Canary Portal, and select View profile
- Scroll to Generate API Authentication Token in the Security Settings section
- Click Generate
To configure this automation, follow the steps below.
- Navigate to Automation > Playbooks, then click Create New Playbook
- Click Add Action then add the Invoke Webhook or API action
- Configure playbook action fields as follows, replacing the <angled bracket> values with your own, and the brackets removed
- HTTP Method: POST
-
URL:
https://<MySubdomain>.my.redcanary.co/openapi/v3/endpoints/reinstate?ids=$Endpoint.id - Allow Untrusted Connections: No
-
HTTP Headers: See code block below
x-api-key=<MyApiKey> content-type=application/json
- Payload: All Attributes as JSON
- Provide the playbook a name and/or description, then click Save to finalize changes
- Navigate to Automation > Triggers, then click Configure New Trigger
- From the list of triggers, select When an Endpoint Status Changes
- Under the newly created trigger, click Add Condition and add the following triggers
- Endpoint > Decommissioned? > Is > true > Save
- Endpoint > Endpoint Status > Is > online > Save
- Click Connect Playbook and connect your new Invoke Webhook or API playbook
- The final set of automation should look similar to the following
For troubleshooting API errors, see How to Authenticate to the Red Canary API
Key Concepts
- The
$Endpoint.idobject attribute in the URL passes the endpoint record ID of hosts matching your trigger conditions as a parameter to the Reinstate endpoint - Endpoints will only meet the trigger conditions when Endpoint Status changes from
suspendedtoonline(i.e. endpoint is offline for more than 3 hours, then checks in) - Decommissioned endpoints actively in
onlinestatus at the time this automation is created, or those decommissioned while inonlinestatus, will not meet the trigger conditions until Endpoint Status next changes fromsuspendedtoonline
Cause
Red Canary does not currently offer a built-in playbook action for reinstating endpoints. However, the Red Canary API has a Reinstate endpoint that can be used in conjunction with the Invoke Webhook or API playbook action to automate the recommissioning process.
Tags
automatically reinstate endpoints, automate reinstate, automatically recommission, automate recommissioning, reinstate automation, recommission automation, reinstate via API, reinstate via playbook, reinstate using API, reinstate using playbooks