Skip to content

Commit

Permalink
Make agents and commands indexes visible
Browse files Browse the repository at this point in the history
Rename commands and agents indexes templates to wazuh-agents and wazuh-commands accordingly

Update ECS documents

Update .commands and .agents references
  • Loading branch information
QU3B1M committed Jan 23, 2025
1 parent 12195a7 commit e2eb3ab
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ecs/agent/event-generator/event_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
GENERATED_DATA_FILE = 'generatedData.json'
DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
# Default values
INDEX_NAME = ".agents"
INDEX_NAME = "wazuh-agents"
USERNAME = "admin"
PASSWORD = "admin"
IP = "127.0.0.1"
Expand Down
5 changes: 2 additions & 3 deletions ecs/agent/fields/template-settings-legacy.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"index_patterns": [
".agents*"
"wazuh-agents*"
],
"order": 1,
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
Expand All @@ -20,4 +19,4 @@
]
}
}
}
}
5 changes: 2 additions & 3 deletions ecs/agent/fields/template-settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"index_patterns": [
".agents*"
"wazuh-agents*"
],
"priority": 1,
"template": {
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
Expand All @@ -22,4 +21,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion ecs/command/event-generator/event_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
GENERATED_DATA_FILE = 'generatedData.json'
DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
# Default values
INDEX_NAME = ".commands"
INDEX_NAME = "wazuh-commands"
USERNAME = "admin"
PASSWORD = "admin"
IP = "127.0.0.1"
Expand Down
5 changes: 2 additions & 3 deletions ecs/command/fields/template-settings-legacy.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"index_patterns": [
".commands*"
"wazuh-commands*"
],
"order": 1,
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
Expand All @@ -17,4 +16,4 @@
]
}
}
}
}
5 changes: 2 additions & 3 deletions ecs/command/fields/template-settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"index_patterns": [
".commands*"
"wazuh-commands*"
],
"priority": 1,
"template": {
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
Expand All @@ -19,4 +18,4 @@
}
}
}
}
}
3 changes: 1 addition & 2 deletions ecs/docs/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ fields:
```json
{
"index_patterns": [".agents*"],
"index_patterns": ["wazuh-agents*"],
"priority": 1,
"template": {
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
Expand Down
5 changes: 2 additions & 3 deletions ecs/docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
> rev 0.2 - September 30th, 2024: Change type of `request_id`, `order_id` and `id` to keyword.
> rev 0.3 - October 3rd, 2024: Change descriptions for `command.type`, `command.action.type`, `command.request_id`, `command.order_id`.
> rev 0.4 - October 9th, 2024: Apply changes described in https://github.com/wazuh/wazuh-indexer-plugins/issues/96#issue-2576028654.
> rev 0.5 - December 3rd, 2024: Added `@timestamp` and `delivery_timestamp` date fields.
> rev 0.5 - December 3rd, 2024: Added `@timestamp` and `delivery_timestamp` date fields.
### Fields summary

Expand Down Expand Up @@ -146,12 +146,11 @@ fields:
```json
{
"index_patterns": [".commands*"],
"index_patterns": ["wazuh-commands*"],
"priority": 1,
"template": {
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
Expand Down
6 changes: 3 additions & 3 deletions test-tools/scripts/07_validate_command_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ while [[ "$#" -gt 0 ]]; do
shift
done

COMMANDS_INDEX=".commands"
COMMANDS_INDEX="wazuh-commands"
SRC="Engine"
USR="TestUser"
TRG_ID="TestTarget"
Expand Down Expand Up @@ -81,7 +81,7 @@ curl -s -k -u "$USERNAME:$PASSWORD" -X POST "https://$CLUSTER_IP:9200/_forcemerg
sleep 2

# Fetch the indices
echo "Validating .commands index is created..."
echo "Validating commands index is created..."
INDICES_RESPONSE=$(curl -s -k -u "$USERNAME:$PASSWORD" "https://$CLUSTER_IP:9200/_cat/indices/.*?v")
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
Expand All @@ -98,7 +98,7 @@ fi
sleep 5
echo "Validate the command is created"
# Validate the command was created
SEARCH_RESPONSE=$(curl -s -k -u "$USERNAME:$PASSWORD" "https://$CLUSTER_IP:9200/.commands/_search")
SEARCH_RESPONSE=$(curl -s -k -u "$USERNAME:$PASSWORD" "https://$CLUSTER_IP:9200/$COMMANDS_INDEX/_search")
# Check if the request was successful
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
Expand Down

0 comments on commit e2eb3ab

Please sign in to comment.