-
Notifications
You must be signed in to change notification settings - Fork 1
REL-850418: Add rotate-api-key user guide for Environment Watch #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amithshet
wants to merge
12
commits into
main
Choose a base branch
from
REL-850418-cli-rotate-api-key
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
970112f
REL-850418: Add rotate-api-key user guide for Environment Watch
amithshet 1054acd
REL-850418: Update rotate-api-key screenshots with latest feedback ev…
amithshet 031b50b
REL-850418: Replace CLI screenshots with code blocks
amithshet 39e1fb8
REL-850418: Address PR feedback from code review
amithshet ed48c9d
REL-850418: Address code review feedback from JSP Code-Reviewer and C…
amithshet 75b92b0
REL-850418: Add API key rotation guidance and DataGrid/EW troubleshoo…
amithshet 47d5415
REL-850418: Add Secret Store read command to Secret Store verificatio…
amithshet 779ee2f
REL-850418: Updated a link
amithshet a2068c2
REL-850418: Generalise datagrid-audit-troubleshooting page and update…
amithshet 601c190
REL-850418: Add troubleshooting screenshots to datagrid-audit-trouble…
amithshet b915eec
REL-850418: Update datagrid-audit-troubleshooting section title and r…
amithshet c5d6d26
REL-850418: Remove browser URL from verification screenshots
amithshet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
243 changes: 243 additions & 0 deletions
243
...ck-setup-02-environment-watch/elastic-stack-rotate-api-key-environment-watch.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,243 @@ | ||
| # Rotate an Elasticsearch API Key using the Relativity Server CLI | ||
|
|
||
| The `rotate-api-key` command creates a new Elasticsearch API key for the specified cluster, persists it to the Relativity Secret Store, and invalidates the old key. Run this command periodically to rotate expiring keys or as part of a scheduled security practice. | ||
|
|
||
| > [!NOTE] | ||
| > It is recommended to run the CLI from the Primary SQL Server. | ||
|
|
||
| > This guide assumes the Relativity Server bundle was extracted to `C:\Server.Bundle.x.y.z` or a similar directory chosen by the user. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - The Server-bundle zip file has been downloaded and extracted to `C:\Server.Bundle.x.y.z` | ||
| - Access to the Relativity Secret Store (Whitelisted for Secret Store access. Please see [here](https://help.relativity.com/Server2025/Content/System_Guides/Secret_Store/Secret_Store.htm#Configuringclients) for information on whitelisting.) | ||
| - Elasticsearch is running and accessible | ||
| - The initial Environment Watch setup has been completed. See [Set up Environment Watch using the Relativity Server CLI](./elastic-stack-setup-02-environment-watch.md) | ||
|
|
||
| ## Options | ||
|
|
||
| | Flag | Short alias | Description | Default | | ||
| |------|-------------|-------------|---------| | ||
| | `--cluster <value>` | `-c` | Target Elasticsearch cluster. Valid values: `rel-cluster-infrawatch`, `rel-cluster-datagrid` | Prompted interactively | | ||
| | `--quiet` | | Suppress confirmation and expiry prompts; auto-confirms with the default 180-day expiry. Use together with `--cluster` for fully unattended execution | `false` | | ||
| | `--dryrun` | | Preview what would happen without making any changes to Elasticsearch or the Secret Store | `false` | | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Interactive | ||
|
|
||
| Running `rotate-api-key` without any flags launches an interactive session. The CLI prompts you to select a target cluster. | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Select the Elasticsearch cluster to rotate the API key for: | ||
|
|
||
| > rel-cluster-infrawatch | ||
| rel-cluster-datagrid | ||
| ``` | ||
|
|
||
| After selecting a cluster, the CLI displays the current API key ID and the number of days remaining before expiry, then asks you to confirm the rotation. Entering `n` aborts with no changes made: | ||
|
|
||
| ``` | ||
| Key rotation aborted. No changes were made. | ||
| ``` | ||
|
|
||
| Entering `y` continues to prompt for a validity period in days, then performs the rotation. | ||
|
|
||
| **InfraWatch cluster:** | ||
|
|
||
| ``` | ||
| Current API key ID: g9tMUp8BVmBEyCHxvRon (name: rel-infrawatch) | ||
| Days remaining before expiry: 179 | ||
| Rotate API key for cluster 'rel-cluster-infrawatch'? This will invalidate the current key. [y/n] (n): y | ||
| How many days should the new key be valid? (180): 180 | ||
|
|
||
| API key rotation completed ----------------------------------------- 100% | ||
|
|
||
| Successfully rotated the Elasticsearch API key and persisted the new key to the Secret Store. | ||
| ``` | ||
|
|
||
| **DataGrid cluster:** | ||
|
|
||
| ``` | ||
| Current API key ID: idtNUp8BVmBEyCHxYC02 (name: rel-datagrid) | ||
| Days remaining before expiry: 179 | ||
| Rotate API key for cluster 'rel-cluster-datagrid'? This will invalidate the current key. [y/n] (n): y | ||
| How many days should the new key be valid? (180): 180 | ||
|
|
||
| API key rotation completed ----------------------------------------- 100% | ||
|
|
||
| Successfully rotated the Elasticsearch API key and persisted the new key to the Secret Store. | ||
| ``` | ||
|
|
||
| ### Rotate with a pre-selected cluster | ||
|
|
||
| Use `--cluster` to target a specific cluster directly, skipping the cluster selection menu. The CLI still displays the current key information and asks for confirmation before rotating. | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key --cluster rel-cluster-infrawatch | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Current API key ID: GUgcV58BbZgP437js08h (name: rel-infrawatch) | ||
| Days remaining before expiry: 179 | ||
| Rotate API key for cluster 'rel-cluster-infrawatch'? This will invalidate the current key. [y/n] (n): y | ||
| How many days should the new key be valid? (180): 180 | ||
|
|
||
| API key rotation completed ----------------------------------------- 100% | ||
|
|
||
| Successfully rotated the Elasticsearch API key and persisted the new key to the Secret Store. | ||
| ``` | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key --cluster rel-cluster-datagrid | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Current API key ID: gUkdV58BbZgP437jHQNQ (name: rel-datagrid) | ||
| Days remaining before expiry: 179 | ||
| Rotate API key for cluster 'rel-cluster-datagrid'? This will invalidate the current key. [y/n] (n): y | ||
| How many days should the new key be valid? (180): 180 | ||
|
|
||
| API key rotation completed ----------------------------------------- 100% | ||
|
|
||
| Successfully rotated the Elasticsearch API key and persisted the new key to the Secret Store. | ||
| ``` | ||
|
|
||
| Use the `-c` short alias to achieve the same result: | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key -c rel-cluster-infrawatch | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Current API key ID: GUgcV58BbZgP437js08h (name: rel-infrawatch) | ||
| Days remaining before expiry: 179 | ||
| Rotate API key for cluster 'rel-cluster-infrawatch'? This will invalidate the current key. [y/n] (n): y | ||
| How many days should the new key be valid? (180): 180 | ||
|
|
||
| API key rotation completed ----------------------------------------- 100% | ||
|
|
||
| Successfully rotated the Elasticsearch API key and persisted the new key to the Secret Store. | ||
| ``` | ||
|
|
||
| ### Quiet mode (automated / scripted rotation) | ||
|
|
||
| Combining `--quiet` with `--cluster` suppresses all prompts, auto-confirms the rotation, and uses the default 180-day expiry. This is suitable for scheduled or unattended scripts. | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key --quiet --cluster rel-cluster-infrawatch | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Current API key ID: 5UkeV58BbZgP437jfiJ8 (name: rel-infrawatch) | ||
| Days remaining before expiry: 179 | ||
|
|
||
| API key rotation completed ----------------------------------------- 100% | ||
|
|
||
| Successfully rotated the Elasticsearch API key and persisted the new key to the Secret Store. | ||
| ``` | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key --quiet --cluster rel-cluster-datagrid | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Current API key ID: gUkdV58BbZgP437jHQNQ (name: rel-datagrid) | ||
| Days remaining before expiry: 179 | ||
|
|
||
| API key rotation completed ----------------------------------------- 100% | ||
|
|
||
| Successfully rotated the Elasticsearch API key and persisted the new key to the Secret Store. | ||
| ``` | ||
|
|
||
| ### Dry run | ||
|
|
||
| Use `--dryrun` to simulate the rotation without making any changes. The CLI displays the current key information, accepts the same prompts as a normal rotation, then confirms the simulation without writing to Elasticsearch or the Secret Store. | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key --cluster rel-cluster-infrawatch --dryrun | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Current API key ID: 5UkeV58BbZgP437jfiJ8 (name: rel-infrawatch) | ||
| Days remaining before expiry: 179 | ||
| Rotate API key for cluster 'rel-cluster-infrawatch'? This will invalidate the current key. [y/n] (n): y | ||
| How many days should the new key be valid? (180): 180 | ||
| DryRun mode: No changes were committed. The API key rotation was simulated successfully. | ||
| ``` | ||
|
|
||
| ### Invalid cluster value | ||
|
|
||
| If an unrecognized value is passed to `--cluster`, the CLI rejects it immediately and lists the valid options. | ||
|
|
||
| ``` | ||
| C:\Server.Bundle.x.y.z\relsvr.exe rotate-api-key --cluster infrawatch | ||
|
|
||
| Relativity Server CLI - 102.1.18 | ||
| Copyright (c) 2026, Relativity ODA LLC | ||
|
|
||
| Invalid --cluster value 'infrawatch'. Valid values are: rel-cluster-infrawatch, rel-cluster-datagrid | ||
| ``` | ||
|
|
||
| ## Verify the rotation | ||
|
|
||
| ### Kibana API keys | ||
|
|
||
| 1. In Kibana, navigate to **Stack Management** > **Security** > **API keys**. | ||
| 2. Confirm a new key for the rotated cluster appears at the top of the list with a recent creation timestamp and an expiry approximately 180 days in the future. | ||
|
|
||
|  | ||
|
|
||
| ### Secret Store | ||
|
|
||
| To confirm the new API key was persisted, use the Secret Store CLI to read the secret for the rotated cluster. To compare values, read the secret both before and after running `rotate-api-key` — the `api-key` value should differ between the two reads. | ||
|
|
||
| From an elevated PowerShell on the Secret Store server, navigate to `C:\Program Files\Relativity Secret Store\Client\` and run the read command for the rotated cluster: | ||
|
|
||
| **InfraWatch:** | ||
|
|
||
| ``` | ||
| .\secretstore.exe secret read /database/elasticsearch/clusters/rel-cluster-infrawatch/security/api-keys/rel-infrawatch | ||
| ``` | ||
|
|
||
| **DataGrid:** | ||
|
|
||
| ``` | ||
| .\secretstore.exe secret read /database/elasticsearch/clusters/rel-cluster-datagrid/security/api-keys/rel-datagrid | ||
| ``` | ||
|
|
||
| ### Elasticsearch Dev Tools (optional) | ||
|
|
||
| To confirm that the old key has been invalidated and the new key is active, query the Elasticsearch security API in Kibana Dev Tools using the key ID. | ||
|
|
||
| 1. In Kibana, navigate to **Dev Tools** > **Console**. | ||
| 2. Run the following query, replacing `<key_id>` with the ID of the key to inspect: | ||
|
|
||
| ``` | ||
| GET /_security/api_key?id=<key_id> | ||
| ``` | ||
|
|
||
| 3. Verify the results: | ||
| - The old key shows `"invalidated": true`. | ||
| - The new key shows `"invalidated": false`. | ||
|
|
||
| **Old key — invalidated:** | ||
|
|
||
|  | ||
|
amithshet marked this conversation as resolved.
|
||
|
|
||
| **New key — active:** | ||
|
|
||
|  | ||
|
amithshet marked this conversation as resolved.
|
||
|
|
||
| If the Audit tab does not load after rotating the DataGrid API key, refer to [Data Grid Audit Troubleshooting](../troubleshooting/datagrid-audit-troubleshooting.md). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
elastic-stack-setup/troubleshooting/datagrid-audit-troubleshooting.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Data Grid Audit Troubleshooting | ||
|
|
||
|
amithshet marked this conversation as resolved.
|
||
| This document provides troubleshooting guidance for common issues that cause the Data Grid Audit tab in Relativity to fail or display errors. These issues can occur after initial setup, following an API key rotation, or when an existing API key has expired. | ||
|
|
||
| ## Audit Tab Shows Authentication Error | ||
|
|
||
| ### Symptoms | ||
|
|
||
| The Audit tab may display one of the following errors: | ||
|
|
||
| - **"Authentication failed for user to access Elasticsearch. Please check the permissions for the user."** — Relativity cannot authenticate against Elasticsearch with the current API key. | ||
|
|
||
|  | ||
|
|
||
| - **"This chart did not return any results."** — Relativity can reach Elasticsearch but data has not loaded, typically seen after services have been restarted but Elasticsearch is still initialising. | ||
|
|
||
|  | ||
|
|
||
| These errors can be caused by: | ||
| - An Elasticsearch API key that has **expired** or been **invalidated** | ||
| - Relativity services not yet restarted after an API key rotation | ||
|
|
||
| --- | ||
|
|
||
| ## Step 1: Check the Elasticsearch Logs | ||
|
|
||
| On the Elasticsearch server, open the log file at: | ||
|
|
||
| ``` | ||
| C:\elastic\elasticsearch\logs\elasticsearch.log | ||
| ``` | ||
|
|
||
| Look for repeated `WARN` entries matching this pattern: | ||
|
|
||
| ``` | ||
| [WARN ][o.e.x.s.a.ApiKeyAuthenticator] [<node>] Authentication using apikey failed - api key [<key_id>] has been invalidated | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| - **If this warning is present** — the API key Relativity uses to connect to the DataGrid Elasticsearch cluster has expired or been invalidated. Proceed to [Step 2: Rotate the Expired API Key](#step-2-rotate-the-expired-api-key). | ||
| - **If this warning is not present** — the key is valid but services may need a restart. Proceed to [Step 3: Restart Services](#step-3-restart-services). | ||
|
|
||
| --- | ||
|
|
||
| ## Step 2: Rotate the Expired API Key | ||
|
|
||
| When Elasticsearch logs confirm the API key has been invalidated, issue a new key using the Relativity Server CLI. | ||
|
|
||
| Follow the [Rotate an Elasticsearch API Key using the Relativity Server CLI](../elastic-stack-setup-02-environment-watch/elastic-stack-rotate-api-key-environment-watch.md) guide, targeting `rel-cluster-datagrid`. | ||
|
|
||
| After the rotation completes, continue with [Step 3: Restart Services](#step-3-restart-services) to restore the Audit tab. | ||
|
|
||
| --- | ||
|
|
||
| ## Step 3: Restart Services | ||
|
|
||
| Restarting Relativity services forces them to re-read the API key from the Secret Store. In some cases, the Elasticsearch service also requires a restart. | ||
|
|
||
| 1. Open **Services** (`services.msc`) and restart the following Relativity services on **all servers** in the Relativity instance: | ||
| - `kCura Edds Agent Manager` | ||
| - `kCura Edds Web Processing Manager` | ||
| - `kCura Service Host Manager` | ||
|
|
||
| 2. Navigate to **Audit** > **Audit** in Relativity and refresh the page. | ||
|
|
||
| The error may change to *"This chart did not return any results."* — this indicates Relativity can now reach Elasticsearch but data has not yet loaded. | ||
|
|
||
| 3. On the Elasticsearch server, open **Services** and restart the **Elasticsearch** service. | ||
|
|
||
| 4. Wait **1–5 minutes** for Elasticsearch to fully restart and for Relativity to re-establish the connection. | ||
|
|
||
| 5. Reload the Relativity UI and navigate back to the **Audit** tab. Audit data should now display correctly. | ||
|
|
||
| > [!NOTE] | ||
| > If the Audit tab still does not load after following these steps, verify that the new API key was successfully persisted to the Secret Store. See [Rotate an Elasticsearch API Key using the Relativity Server CLI](../elastic-stack-setup-02-environment-watch/elastic-stack-rotate-api-key-environment-watch.md#verify-the-rotation) for Secret Store and Kibana verification steps. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.