Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1064.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adding API remediation feature to support API dispatchers.
26 changes: 24 additions & 2 deletions docs/user/app_feature_remediation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Navigating Configuration Remediation

Automated network configuration remediation is a systematic approach that leverages technology and processes to address and rectify configuration issues in network devices.
Automated network configuration remediation is a systematic approach that leverages technology and processes to address and rectify configuration issues in network devices.
It involves the use of the Golden Configuration app to understand the current configuration state, compare it against the intended configuration state, and automatically generate remediation data.
Automated network configuration remediation improves efficiency by eliminating manual efforts and reducing the risk of human errors. It enables rapid response to security vulnerabilities, minimizes downtime, and enhances compliance with regulatory and industry standards.

Expand Down Expand Up @@ -48,6 +48,28 @@ Default Hier config options can be used or customized on a per platform basis, a
For additional information on how to customize Hier Config options, please refer to the Hierarchical Configuration development guide:
https://hier-config.readthedocs.io/en/latest/

### API Remediation Type

You can use the TYPE_API option to enable a device to use the API type of remediation. To use this, you would need to pass the settings
that the API request would use as config context. Here is an example using Cisco Meraki platform.

```json
org_remediation:
- endpoint: "/organizations/{{ obj.get_config_context().get('organization_id', '')}}"
method: "PUT"
query: []
fields:
- "name"
```

The way to create this is like this:

- The high level key should be '**feature-name**\_remediation', in this case the feature is **org**
- endpoint: This is the endpoint you should call. You could pass jinja to the endpoint to dynamically create the endpoint.
- method: This is the HTTP method to use for the call.
- query: You add strings here, used as a filter if the endpoint supports it, like for example '?user=NTC' if you would like to filter a response searching for the NTC user.
- fields: This is also a list of strings, and it should hold the key names of the response you got from the device, to include that in the payload you will send to the device when you execute the Config Plan. In this example, we only want the "name" field from the response.

### Custom Config Remediation Type

When a Network Operating System delivers configuration data in a format that is not CLI/Hierarchical, we can still perform remediation by using the Custom Remediation options. Custom Remediation is defined within a Python function that takes as input a Configuration Compliance object and returns a Remediation Field.
Expand All @@ -66,4 +88,4 @@ Once remediation settings are configured for a particular platform, remediation

Once remediation is configured for a particular Platform/Feature pair, it is possible to validate remediation operations by running a compliance job. Navigate to **Jobs -> Perform Configuration Compliance** and run a compliance job for a device that has remediation enabled. Verify that remediation data has been generated by navigating to **Golden Config -> Config Compliance**, select the device and check the compliance status for the feature with remediation enabled and the "Remediating Configuration" field, as shown below:

![Validate Configuration Remediation](../images/remediation_validate_feature.png)
![Validate Configuration Remediation](../images/remediation_validate_feature.png)
2 changes: 2 additions & 0 deletions nautobot_golden_config/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ class RemediationTypeChoice(ChoiceSet):
"""Choiceset used by RemediationSetting."""

TYPE_HIERCONFIG = "hierconfig"
TYPE_API = "api"
TYPE_CUSTOM = "custom_remediation"

CHOICES = (
(TYPE_HIERCONFIG, "HIERCONFIG"),
(TYPE_API, "API"),
(TYPE_CUSTOM, "CUSTOM_REMEDIATION"),
)

Expand Down
Loading
Loading