Skip to content

Commit

Permalink
Add documentation for security config upgrade feature (opensearch-pro…
Browse files Browse the repository at this point in the history
…ject#6634)

* Add documentation for security config upgrade feature

Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>

* Fix vale annotations

Signed-off-by: Peter Nied <[email protected]>

* Feedback round 1

Signed-off-by: Peter Nied <[email protected]>

* Resolve OpenSearch.SpacingPunctuation

Signed-off-by: Peter Nied <[email protected]>

* Fix vale error

Signed-off-by: Peter Nied <[email protected]>

* Clean up rendering of list of options for upgrade

Signed-off-by: Peter Nied <[email protected]>

* Clean up formatting around example a little

Signed-off-by: Peter Nied <[email protected]>

* PR Feedback 2

Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>

* Update api.md

* Apply suggestions from code review

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>

* Apply suggestions from code review

Signed-off-by: Naarcha-AWS <[email protected]>

* Update _security/access-control/api.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>

* Update _security/access-control/api.md

Signed-off-by: Naarcha-AWS <[email protected]>

---------

Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
  • Loading branch information
3 people authored Mar 27, 2024
1 parent f99c17a commit 6f862fa
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions _security/access-control/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,91 @@ PATCH _plugins/_security/api/securityconfig
}
```

### Configuration upgrade check

Introduced 2.13
{: .label .label-purple }

Checks the current configuration bundled with the host's Security plugin and compares it to the version of the OpenSearch Security plugin the user downloaded. Then, the API responds indicating whether or not an upgrade can be performed and what resources can be updated.

With each new OpenSearch version, there are changes to the default security configuration. This endpoint helps cluster operators determine whether the cluster is missing defaults or has stale definitions of defaults.
{: .note}

#### Request

```json
GET _plugins/_security/api/_upgrade_check
```
{% include copy-curl.html %}

#### Example response

```json
{
"status" : "OK",
"upgradeAvailable" : true,
"upgradeActions" : {
"roles" : {
"add" : [ "flow_framework_full_access" ]
}
}
}
```

#### Response fields

| Field | Data type | Description |
|:---------|:-----------|:------------------------------|
| `upgradeAvailable` | Boolean | Responds with `true` when an upgrade to the security configuration is available. |
| `upgradeActions` | Object list | A list of security objects that would be modified when upgrading the host's Security plugin. |

### Configuration upgrade

Introduced 2.13
{: .label .label-purple }

Adds and updates resources on a host's existing security configuration from the configuration bundled with the latest version of the Security plugin.

These bundled configuration files can be found in the `<OPENSEARCH_HOME>/security/config` directory. Default configuration files are updated when OpenSearch is upgraded, whereas the cluster configuration is only updated by the cluster operators. This endpoint helps cluster operator upgrade missing defaults and stale default definitions.


#### Request

```json
POST _plugins/_security/api/_upgrade_perform
{
"configs" : [ "roles" ]
}
```
{% include copy-curl.html %}

#### Request fields

| Field | Data type | Description | Required |
|:----------------|:-----------|:------------------------------------------------------------------------------------------------------------------|:---------|
| `configs` | Array | Specifies the configurations to be upgraded. This field can include any combination of the following configurations: `actiongroups`,`allowlist`, `audit`, `internalusers`, `nodesdn`, `roles`, `rolesmappings`, `tenants`.<br> Default is all supported configurations. | No |


#### Example response

```json
{
"status" : "OK",
"upgrades" : {
"roles" : {
"add" : [ "flow_framework_full_access" ]
}
}
}
```

#### Response fields

| Field | Data type | Description |
|:---------|:-----------|:------------------------------|
| `upgrades` | Object | A container for the upgrade results, organized by configuration type, such as `roles`. Each changed configuration type will be represented as a key in this object. |
| `roles` | Object | Contains a list of role-based action keys of objects modified by the upgrade. |

---

## Distinguished names
Expand Down

0 comments on commit 6f862fa

Please sign in to comment.