-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add demo certificates installer #548
Conversation
The package correctly deploys the demo certificates when it is installed
|
Package installation works in root@node-2:/vagrant/scripts# GITHUB_TOKEN=***** bash 01_download_and_install_package.sh -id 11806038378 -n wazuh-indexer_5.0.0-0_amd64_769ce7a7-bd947b4-b41f2b0.deb
Fetching artifacts list...
Checking wazuh-indexer_5.0.0-0_amd64_769ce7a7-bd947b4-b41f2b0.deb package is generated for workflow run 11806038378
Wazuh indexer artifact detected. Artifact ID: 2178870411
Downloading wazuh-indexer package from GitHub artifactory...
(It could take a couple of minutes)
Package downloaded successfully
Decompressing wazuh-indexer package...
Archive: ./package.zip
inflating: wazuh-indexer_5.0.0-0_amd64_769ce7a7-bd947b4-b41f2b0.deb
Package decompressed
Installing wazuh-indexer package...
Package installed successfully.
root@node-2:/vagrant/scripts# ls /etc/wazuh-indexer/certs/
admin-key.pem admin.pem indexer-key.pem indexer.pem root-ca.pem
|
Replace $ with % on macros usage
Works on [root@node-1 scripts]# GITHUB_TOKEN=**** bash 01_download_and_install_package.sh -id 11819424324 -n wazuh-indexer_5.0.0-0_x86_64_5ae8cc66-bd947b4-b41f2b0.rpm
Fetching artifacts list...
Checking wazuh-indexer_5.0.0-0_x86_64_5ae8cc66-bd947b4-b41f2b0.rpm package is generated for workflow run 11819424324
Wazuh indexer artifact detected. Artifact ID: 2182430868
Downloading wazuh-indexer package from GitHub artifactory...
(It could take a couple of minutes)
Package downloaded successfully
Decompressing wazuh-indexer package...
Archive: ./package.zip
inflating: wazuh-indexer_5.0.0-0_x86_64_5ae8cc66-bd947b4-b41f2b0.rpm
Package decompressed
Installing wazuh-indexer package...
Package installed successfully.
[root@node-1 scripts]# ls /etc/wazuh-indexer/certs/
admin-key.pem admin.pem indexer-key.pem indexer.pem root-ca.pem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Have we tried to form up a cluster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cluster cannot be formed using the current solution, so it's a partial solution.
I'd rather have the certificates pre-generated and hosted in our repository if that allows us to form up clusters without having to generate custom certificates.
Hard coded certs were added as an option, enabled by the root@node-2:/vagrant/scripts# USE_DEMO_CERTS="true" dpkg -i wazuh-indexer_5.0.0-0_amd64_8ff89d65-e3248bb-b41f2b0.deb
Selecting previously unselected package wazuh-indexer.
(Reading database ... 76250 files and directories currently installed.)
Preparing to unpack wazuh-indexer_5.0.0-0_amd64_8ff89d65-e3248bb-b41f2b0.deb ...
Running Wazuh Indexer Pre-Installation Script
Unpacking wazuh-indexer (5.0.0-0) ...
Setting up wazuh-indexer (5.0.0-0) ...
Running Wazuh Indexer Post-Installation Script
No certificates detected in /etc/wazuh-indexer, installing demo certificates...
### If you are using a custom certificates path, ignore this message.
### NOT starting on installation, please execute the following statements to configure wazuh-indexer service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable wazuh-indexer.service
### You can start wazuh-indexer service by executing
sudo systemctl start wazuh-indexer.service
root@node-2:/vagrant/scripts# systemctl daemon-reload && systemctl start wazuh-indexer
root@node-2:/vagrant/scripts# systemctl status wazuh-indexer
● wazuh-indexer.service - wazuh-indexer
Loaded: loaded (/lib/systemd/system/wazuh-indexer.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2024-11-20 10:47:45 UTC; 5s ago
Docs: https://documentation.wazuh.com
Main PID: 5701 (java)
Tasks: 65 (limit: 4557)
Memory: 1.3G
CPU: 23.526s
CGroup: /system.slice/wazuh-indexer.service
└─5701 /usr/share/wazuh-indexer/jdk/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch>
Nov 20 10:47:37 node-2 systemd-entrypoint[5701]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.OpenSearch (file:/usr/share/wazuh-indexer/lib/opense>
Nov 20 10:47:37 node-2 systemd-entrypoint[5701]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.OpenSearch
Nov 20 10:47:37 node-2 systemd-entrypoint[5701]: WARNING: System::setSecurityManager will be removed in a future release
Nov 20 10:47:37 node-2 systemd-entrypoint[5701]: Nov 20, 2024 10:47:37 AM sun.util.locale.provider.LocaleProviderAdapter <clinit>
Nov 20 10:47:37 node-2 systemd-entrypoint[5701]: WARNING: COMPAT locale provider will be removed in a future release
Nov 20 10:47:38 node-2 systemd-entrypoint[5701]: WARNING: A terminally deprecated method in java.lang.System has been called
Nov 20 10:47:38 node-2 systemd-entrypoint[5701]: WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.Security (file:/usr/share/wazuh-indexer/lib/opensear>
Nov 20 10:47:38 node-2 systemd-entrypoint[5701]: WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.Security
Nov 20 10:47:38 node-2 systemd-entrypoint[5701]: WARNING: System::setSecurityManager will be removed in a future release
Nov 20 10:47:45 node-2 systemd[1]: Started wazuh-indexer.
root@node-2:/vagrant/scripts# curl --cacert /etc/wazuh-indexer/certs/root-ca.pem -u admin:admin https://localhost:9200
{
"name" : "node-1",
"cluster_name" : "wazuh-cluster",
"cluster_uuid" : "80_cgZXaRt2tqsOq31ZCtg",
"version" : {
"distribution" : "opensearch",
"number" : "2.17.1",
"build_type" : "deb",
"build_hash" : "8ff89d653ea6271fa31d5743618b77587c3ba510",
"build_date" : "2024-11-20T10:20:12.060264055Z",
"build_snapshot" : false,
"lucene_version" : "9.11.1",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
root@node-2:/vagrant/scripts# curl --cacert /etc/wazuh-indexer/certs/root-ca.pem -u admin:admin https://wazuh.indexer:9200
{
"name" : "node-1",
"cluster_name" : "wazuh-cluster",
"cluster_uuid" : "80_cgZXaRt2tqsOq31ZCtg",
"version" : {
"distribution" : "opensearch",
"number" : "2.17.1",
"build_type" : "deb",
"build_hash" : "8ff89d653ea6271fa31d5743618b77587c3ba510",
"build_date" : "2024-11-20T10:20:12.060264055Z",
"build_snapshot" : false,
"lucene_version" : "9.11.1",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
} |
Works under [root@alma9 ~]# USE_DEMO_CERTS="true" rpm -i ./wazuh-indexer_5.0.0-0_x86_64_8ff89d65-e3248bb-b41f2b0.rpm
No certificates detected in /etc/wazuh-indexer, installing demo certificates...
### If you are using a custom certificates path, ignore this message.
### NOT starting on installation, please execute the following statements to configure wazuh-indexer service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable wazuh-indexer.service
### You can start wazuh-indexer service by executing
sudo systemctl start wazuh-indexer.service
[root@alma9 ~]# systemctl daemon-reload
[root@alma9 ~]# systemctl start wazuh-indexer
[root@alma9 ~]# curl --cacert /etc/wazuh-indexer/certs/root-ca.pem -u admin:admin https://localhost:9200
{
"name" : "node-1",
"cluster_name" : "wazuh-cluster",
"cluster_uuid" : "g-MZ0mwbR6OE2n5ifqtxvQ",
"version" : {
"distribution" : "opensearch",
"number" : "2.17.1",
"build_type" : "rpm",
"build_hash" : "8ff89d653ea6271fa31d5743618b77587c3ba510",
"build_date" : "2024-11-20T10:18:15.841796027Z",
"build_snapshot" : false,
"lucene_version" : "9.11.1",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
[root@alma9 ~]# curl --cacert /etc/wazuh-indexer/certs/root-ca.pem -u admin:admin https://wazuh.indexer:9200
{
"name" : "node-1",
"cluster_name" : "wazuh-cluster",
"cluster_uuid" : "g-MZ0mwbR6OE2n5ifqtxvQ",
"version" : {
"distribution" : "opensearch",
"number" : "2.17.1",
"build_type" : "rpm",
"build_hash" : "8ff89d653ea6271fa31d5743618b77587c3ba510",
"build_date" : "2024-11-20T10:18:15.841796027Z",
"build_snapshot" : false,
"lucene_version" : "9.11.1",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
} |
Migrate to the new master branch. |
Migrated to #566 |
Description
Add
install-demo-certificates.sh
that generates and configure the demo certificates for the currentwazuh-indexer
installation.It is being used at the
post-install
packaging stepRelated Issues
Resolves #183
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.