forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 571-add-interface-fields-root-level-invent…
…ory-networks-index Signed-off-by: Kevin Ledesma <[email protected]>
- Loading branch information
Showing
33 changed files
with
244 additions
and
363 deletions.
There are no files selected for viewing
This file contains 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
54 changes: 54 additions & 0 deletions
54
distribution/packages/src/common/scripts/install-demo-certificates.sh
This file contains 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,54 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# Directories | ||
TMP_DIR="/tmp/wazuh-indexer/certs" | ||
CERTS_DIR="/etc/wazuh-indexer/certs" | ||
|
||
# Create directories | ||
mkdir -p "$TMP_DIR" | ||
|
||
# Root CA | ||
openssl genrsa -out "$TMP_DIR/root-ca-key-temp.pem" 2048 | ||
openssl req -new -x509 -sha256 -key "$TMP_DIR/root-ca-key-temp.pem" -subj "/OU=Wazuh/O=Wazuh/L=California/" -out "$TMP_DIR/root-ca.pem" -days 3650 | ||
|
||
# Admin cert | ||
openssl genrsa -out "$TMP_DIR/admin-key-temp.pem" 2048 | ||
openssl pkcs8 -inform PEM -outform PEM -in "$TMP_DIR/admin-key-temp.pem" -topk8 -nocrypt -v1 PBE-SHA1-3DES -out "$TMP_DIR/admin-key.pem" | ||
openssl req -new -key "$TMP_DIR/admin-key.pem" -subj "/C=US/L=California/O=Wazuh/OU=Wazuh/CN=admin" -out "$TMP_DIR/admin.csr" | ||
openssl x509 -req -in "$TMP_DIR/admin.csr" -CA "$TMP_DIR/root-ca.pem" -CAkey "$TMP_DIR/root-ca-key-temp.pem" -CAcreateserial -sha256 -out "$TMP_DIR/admin.pem" -days 3650 | ||
|
||
# Node cert | ||
openssl genrsa -out "$TMP_DIR/indexer-key-temp.pem" 2048 | ||
openssl pkcs8 -inform PEM -outform PEM -in "$TMP_DIR/indexer-key-temp.pem" -topk8 -nocrypt -v1 PBE-SHA1-3DES -out "$TMP_DIR/indexer-key.pem" | ||
openssl req -new -key "$TMP_DIR/indexer-key.pem" -subj "/C=US/L=California/O=Wazuh/OU=Wazuh/CN=node-0.wazuh.indexer" -out "$TMP_DIR/indexer.csr" | ||
cat <<'INDEXER_EXT' >$TMP_DIR/indexer.ext | ||
subjectAltName = @alt_names | ||
[alt_names] | ||
DNS.1 = localhost | ||
DNS.2 = *.wazuh.indexer | ||
RID.1 = 1.2.3.4.5 | ||
IP.1 = 127.0.0.1 | ||
IP.2 = 0:0:0:0:0:0:0:1 | ||
INDEXER_EXT | ||
|
||
openssl x509 -req -in "$TMP_DIR/indexer.csr" -CA "$TMP_DIR/root-ca.pem" -CAkey "$TMP_DIR/root-ca-key-temp.pem" -CAcreateserial -sha256 -out "$TMP_DIR/indexer.pem" -days 3650 -extfile "$TMP_DIR/indexer.ext" | ||
|
||
# Cleanup temporary files | ||
rm "$TMP_DIR/"*.csr "$TMP_DIR"/*.ext "$TMP_DIR"/*.srl "$TMP_DIR"/*-temp.pem | ||
|
||
# Move certs to permanent location | ||
mkdir -p "$CERTS_DIR" | ||
mv "$TMP_DIR"/* "$CERTS_DIR/" | ||
|
||
chmod 500 "$CERTS_DIR" | ||
chmod 400 "$CERTS_DIR"/* | ||
chown -R wazuh-indexer:wazuh-indexer "$CERTS_DIR" | ||
|
||
# Cleanup /tmp directory | ||
rm -r "$TMP_DIR" |
This file contains 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
This file contains 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
This file contains 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,22 @@ | ||
# Wazuh Common Schema | ||
|
||
The Wazuh Common Schema is a derivation of the [Elastic Common Schema](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html) (ECS) providing a common data schema for the different central components of Wazuh. | ||
|
||
- [agent](./agent.md) | ||
- [alerts](alerts.md) | ||
- [command](commands.md) | ||
- [states-fim](states-fim.md) | ||
- [states-inventory-hardware](states-inventory-hardware.md) | ||
- [states-inventory-hotfixes](states-inventory-hotfixes.md) | ||
- [states-inventory-networks](states-inventory-networks.md) | ||
- [states-inventory-packages](states-inventory-packages.md) | ||
- [states-inventory-ports](states-inventory-ports.md) | ||
- [states-inventory-processes](states-inventory-processes.md) | ||
- [states-inventory-system](states-inventory-system.md) | ||
- [states-vulnerabilities](states-vulnerabilities.md) | ||
|
||
--- | ||
|
||
### Useful resources | ||
For more information and additional resources, please refer to the following links: | ||
- [ECS schemas repository](https://github.com/elastic/ecs/tree/main/schemas) |
This file contains 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
This file contains 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
Oops, something went wrong.