Skip to content
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

Complete "full demo" example with Wazuh sample events #10

Open
misje opened this issue May 7, 2024 · 0 comments
Open

Complete "full demo" example with Wazuh sample events #10

misje opened this issue May 7, 2024 · 0 comments
Assignees
Labels
pri:low Low priority

Comments

@misje
Copy link
Owner

misje commented May 7, 2024

The full demo docker-compose example lacks logic to populate Wazuh with demo events. Create a docker image that runs once, calling

  1. docker run --rm -w "/home/node/app" -v "$(pwd):/home/node/app" node:lts-alpine node cli.js --all-modules --format bulk-api --index wazuh-alerts-4.x-sample > output.ndjson
  2. curl -k -u 'admin:SecretPassword' https://localhost:9200/_bulk -H "Content-Type: application/x-ndjson" --data-binary "@output.ndjson"
  3. Add missing "@timestamp" column:
curl -k -u 'admin:SecretPassword' -X POST https://localhost:9200/wazuh-alerts-*/_update_by_query -H "Content-Type: application/json" -d "$(cat <<EOF
{
"script": {
  "source": "String timestamp = ctx._source['timestamp']; if (timestamp != null) { DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\"); ZonedDateTime parsedTime = ZonedDateTime.parse(timestamp, inputFormatter); String formattedTime = DateTimeFormatter.ISO_INSTANT.format(parsedTime); ctx._source['@timestamp'] = formattedTime; }",
  "lang": "painless"
}
}
EOF
)"

Use patched misje/wazuh-dashboard-plugins as a referene, since the Wazuh maintainers have not provided any feedback on my pull request to fix invalid IP addresses and invalid SHA-256 hashes in the example data. The entrypoint needs to patientely wait for OpenSearch to become available.

@misje misje added this to the 0.1.0alpha milestone May 7, 2024
@misje misje self-assigned this May 7, 2024
@misje misje modified the milestones: 0.1.0alpha, 0.2.0 May 11, 2024
@misje misje modified the milestones: 0.3.0, 0.4.0 Jun 10, 2024
@misje misje added the pri:low Low priority label Jun 10, 2024
@misje misje modified the milestones: 0.4.0, Distant future Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pri:low Low priority
Projects
None yet
Development

No branches or pull requests

1 participant