Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #50 from wazuh/release-wazuh_3.12.0_7.6.1
Browse files Browse the repository at this point in the history
Release Wazuh 3.12.0_7.6.1
  • Loading branch information
Jose M. Garcia authored Mar 27, 2020
2 parents 4b3440c + 45476a0 commit 5ffdd89
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 477 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ A parent domain (e.g. mycompany.com) and subdomain (e.g. wazuh) can be specified

An example of the installation of a new agent, on a Windows system (automatically registered and configured) using an MSI package would be:

wazuh-agent-3.11.4-1.msi /q ADDRESS=“wazuh.mycompany.com” AUTHD_SERVER=“registration.wazuh.mycompany.com” PASSWORD=“mypassword” AGENT_NAME=“myhostname” PROTOCOL=“TCP”
wazuh-agent-3.12.0-1.msi /q ADDRESS=“wazuh.mycompany.com” AUTHD_SERVER=“registration.wazuh.mycompany.com” PASSWORD=“mypassword” AGENT_NAME=“myhostname” PROTOCOL=“TCP”

An example of the registration of a new agent on a Linux system would be:

Expand Down
5 changes: 2 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ if [ "$STACK_NAME" == "" ] || [ "$BUCKET_NAME" == "" ]; then
fi

# Uploading template to S3
aws --profile ansible_demo s3 cp $TEMPLATE_FILE s3://$BUCKET_NAME

aws s3 cp $TEMPLATE_FILE s3://$BUCKET_NAME
# Getting the template URL
URL="https://demo-cloudformation-templates.s3-us-west-1.amazonaws.com/wazuh_template.yml"
echo "Template URL: $URL"

aws --profile ansible_demo cloudformation create-stack --stack-name ${STACK_NAME} --template-url $URL --parameters file://$PARAMS_FILE --capabilities CAPABILITY_IAM --tags Key=service_name,Value=demo_info
aws cloudformation create-stack --stack-name ${STACK_NAME} --template-url $URL --parameters file://$PARAMS_FILE --capabilities CAPABILITY_IAM --tags Key=service_name,Value=demo_info

echo "Done"
10 changes: 3 additions & 7 deletions elastic/wazuh_cf_bootstrap_elastic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ node_name=$(cat /tmp/wazuh_cf_settings | grep '^NodeName:' | cut -d' ' -f2)
master_ip=$(cat /tmp/wazuh_cf_settings | grep '^MasterIp:' | cut -d' ' -f2)
worker_ip=$(cat /tmp/wazuh_cf_settings | grep '^WorkerIp:' | cut -d' ' -f2)
kibana_ip=$(cat /tmp/wazuh_cf_settings | grep '^KibanaIp:' | cut -d' ' -f2)
kibana_dev_ip=$(cat /tmp/wazuh_cf_settings | grep '^KibanaDevIp:' | cut -d' ' -f2)

TAG="v3.11.1"
TAG="v3.12.0"
echo "Added env vars." >> /tmp/deploy.log
echo "eth0_ip: $eth0_ip" >> /tmp/deploy.log

Expand Down Expand Up @@ -85,7 +84,7 @@ node.name: "node-$node_name"
node.master: true
path.data: /mnt/ephemeral/elasticsearch/lib
path.logs: /mnt/ephemeral/elasticsearch/log
cluster.initial_master_nodes:
cluster.initial_master_nodes:
- "10.0.2.123"
- "10.0.2.124"
- "10.0.2.125"
Expand Down Expand Up @@ -137,7 +136,7 @@ load_template(){
}

add_wazuh_user(){

until curl -XGET "https://$eth0_ip:9200" -k -u elastic:${ssh_password}; do
sleep 5
echo "Elasticsearch not ready yet..." >> /tmp/deploy.log
Expand Down Expand Up @@ -207,9 +206,6 @@ instances:
- name: "elasticsearch"
ip:
- "$eth0_ip"
- name: "kibana-dev"
ip:
- "$kibana_dev_ip"
EOF
/usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --in /usr/share/elasticsearch/instances.yml --out /usr/share/elasticsearch/certs.zip
echo "Generated certs" >> /tmp/deploy.log
Expand Down
25 changes: 17 additions & 8 deletions elastic/wazuh_cf_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ path.logs: /mnt/ephemeral/elasticsearch/log
node.master: false
node.data: false
node.ingest: false
discovery.seed_hosts:
discovery.seed_hosts:
- "10.0.2.123"
- "10.0.2.124"
- "10.0.2.125"
Expand Down Expand Up @@ -242,10 +242,10 @@ get_plugin_url(){
plugin_url="https://packages-dev.wazuh.com/staging/app/kibana/wazuhapp-${wazuh_major}.${wazuh_minor}.${wazuh_patch}_${elastic_major_version}.${elastic_minor_version}.${elastic_patch_version}.zip"
elif [[ ${EnvironmentType} == 'sources' ]]
then
BRANCH="3.11-7.5"
BRANCH="3.12-7.6"
if [[ $BRANCH != "" ]]; then
yum install -y git
curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
# Installing NodeJS
yum -y install nodejs
npm install -g [email protected]
Expand All @@ -260,7 +260,7 @@ get_plugin_url(){
BUILD_SRC=$(pwd)
APP_FILE=$(ls *.zip)
else
plugin_url="https://aws-nist.s3-us-west-1.amazonaws.com/wazuhapp-3.11-sources.zip"
echo 'Error: Unsupported Wazuh Plugin installation method' >> /tmp/deploy.log
fi
else
echo 'no repo' >> /tmp/stage
Expand All @@ -271,15 +271,18 @@ install_plugin(){
echo "Installing app" >> /tmp/deploy.log
if [[ ${EnvironmentType} != 'sources' ]] || [[ ${BRANCH} == "" ]]
then
cd /usr/share/kibana
sudo -u kibana /usr/share/kibana/bin/kibana-plugin install ${plugin_url}
else
cd /usr/share/kibana
sudo -u kibana /usr/share/kibana/bin/kibana-plugin install file://$BUILD_SRC/$APP_FILE
fi
cd /tmp
echo "App installed!" >> /tmp/deploy.log
echo "Redirecting to Wazuh app " >> /tmp/deploy.log
# Set Wazuh app as the default landing page
echo "server.defaultRoute: /app/wazuh" >> /etc/kibana/kibana.yml
# Redirect Kibana welcome screen to Discover
# Redirect Kibana welcome screen to
echo "Redirect Kibana welcome screen to Discover"
sed -i "s:'/app/kibana#/home':'/app/wazuh':g" /usr/share/kibana/src/ui/public/chrome/directives/global_nav/global_nav.html
sed -i "s:'/app/kibana#/home':'/app/wazuh':g" /usr/share/kibana/src/ui/public/chrome/directives/header_global_nav/header_global_nav.js
Expand All @@ -296,8 +299,8 @@ install_plugin(){

add_api(){
echo "Adding Wazuh API" >> /tmp/deploy.log
sed -ie '/- default:/,+4d' /usr/share/kibana/plugins/wazuh/wazuh.yml
cat > /usr/share/kibana/plugins/wazuh/wazuh.yml << EOF
sed -ie '/- default:/,+4d' /usr/share/kibana/optimize/wazuh/config/wazuh.yml
cat > /usr/share/kibana/optimize/wazuh/config/wazuh.yml << EOF
hosts:
- default:
url: https://${wazuh_master_ip}
Expand Down Expand Up @@ -357,6 +360,10 @@ echo "Do not ask user to help providing usage statistics to Elastic" >> /tmp/de
# Disable Elastic repository
sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/elastic.repo
echo "Configured Kibana" >> /tmp/deploy.log

# Remove Montserrat font
sed -i 's/@import\surl.*Montserrat.*/# Removed montserrat font/g' /usr/share/kibana/optimize/bundles/login.style.css

}

add_nginx(){
Expand Down Expand Up @@ -422,10 +429,12 @@ main(){
kibana_certs
get_plugin_url
install_plugin
add_api
enable_kibana
start_kibana
sleep 60
add_api
kibana_optional_configs
start_kibana
add_nginx
custom_welcome
}
Expand Down
Loading

0 comments on commit 5ffdd89

Please sign in to comment.