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

LME 2 Dashboard Update and Bug Fixes #501

Merged
merged 37 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
392a62a
Fixing and integrating changes from dashboard_fix branch:
mreeve-snl Oct 29, 2024
53e920f
Adding in andrews dashboard changes
mreeve-snl Oct 29, 2024
acfc4b6
update wazuh vulnerability dashboard
aarz-snl Oct 29, 2024
384e59e
Rename wazuh_amazon_aws_alerts.dumped.ndjson to wazuh_amazon_aws_aler…
aarz-snl Oct 29, 2024
1009084
Rename wazuh_docker_listener_events.dumped.ndjson to wazuh_docker_lis…
aarz-snl Oct 29, 2024
8dd2547
rename dashboards
aarz-snl Oct 29, 2024
398ed8a
put dumped back in
aarz-snl Oct 29, 2024
29e7b81
delete old dashboard file
aarz-snl Oct 29, 2024
65cc71b
fixed dashboard panels and removed links from dashboard menu panel
Oct 29, 2024
7ac6a45
updating comment to reflect accurate 30 minute timeout
mreeve-snl Oct 30, 2024
54d336a
Adds azure region selector to the cluster workflow
cbaxley Oct 30, 2024
f8e9acc
Updates the container images to the latest versions
cbaxley Oct 30, 2024
02df457
Updates the container images to the latest versions in all relevant f…
cbaxley Oct 30, 2024
60caf9b
Updates the test_server.py to match the latest version
cbaxley Oct 30, 2024
1b4ab60
Debug why the server won't start with the new versions
cbaxley Oct 30, 2024
d359456
Follow redirects when checking if the services are up
cbaxley Oct 30, 2024
71f5c3d
Removing debugging for the linux_only workflow
cbaxley Oct 30, 2024
5f1e106
Update all the curl calls to use -L
cbaxley Oct 30, 2024
e08c416
remove links, remove extra security dashboard, fix name of dashboard
aarz-snl Oct 30, 2024
924b345
Add links and tags for elastic dashboards
aarz-snl Oct 30, 2024
1e5e6f8
fix location of dashboards
aarz-snl Oct 30, 2024
9cc9be6
delete extra dashboard
aarz-snl Oct 30, 2024
b97258d
remove dupe id's
aarz-snl Oct 30, 2024
4fd9701
revert dashboards to before dupe id removal script
aarz-snl Oct 30, 2024
7f0abd6
ALL fixes for LME dashboards
aarz-snl Nov 1, 2024
2eba9f3
fix again...
aarz-snl Nov 1, 2024
cf88ab1
update conf mount
aarz-snl Nov 1, 2024
3d95827
Updaing wazuh configuration to support vuln scanning
mreeve-snl Nov 4, 2024
6dda9fb
Update lme-wazuh-manager.container
aarz-snl Nov 4, 2024
e76459d
Push updated Wazuh dashboards AND dashboards docs
mreeve-snl Nov 4, 2024
ea1fed3
Adding email alert rule example
mreeve-snl Nov 4, 2024
dbf9435
Update wazuh dashboards
aarz-snl Nov 5, 2024
99ae5eb
Removed 1 symbol in deploy wazuh windows command so it will work on c…
rgbrow1949 Nov 5, 2024
287a4bc
Update the tests for the new LME version to skip the indices that wer…
cbaxley Nov 6, 2024
8535b8a
Set a default region for the cluster workflow
cbaxley Nov 6, 2024
06138e7
Remove cluster run from automatic running.
cbaxley Nov 6, 2024
4a3ad71
Adds a sleep before running the tests
cbaxley Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions .github/workflows/cluster.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
name: Cluster Run - Minimega

on:
pull_request:
# branches:
# - '*'
workflow_dispatch:
# pull_request:
# branches:
# - '*'
inputs:
azure_region:
description: 'Azure region to deploy resources'
required: true
default: 'centralus'
type: choice
options:
- centralus
- eastus
- eastus2
- westus
- westus2
- westus3
- northcentralus
- southcentralus
- canadacentral
- canadaeast
- uksouth
- ukwest
- northeurope
- westeurope

jobs:
build-and-test-cluster:
Expand Down Expand Up @@ -84,7 +105,7 @@ jobs:
-g pipe-${{ env.UNIQUE_ID }} \
-s ${{ env.IP_ADDRESS }}/32 \
-vs Standard_D8_v4 \
-l centralus \
-l ${{ inputs.azure_region || 'centralus' }} \
-ast 23:00 \
-y
"
Expand Down Expand Up @@ -199,7 +220,7 @@ jobs:
# Retrieve policy ID
POLICY_ID=$(docker compose -p ${{ env.UNIQUE_ID }} exec -T pipeline bash -c "
ssh lme-user@${{ env.AZURE_IP }} '
curl -k -s -u \"$ES_USERNAME:$ES_PASSWORD\" -X GET \"$KIBANA_URL/api/fleet/agent_policies\" \
curl -kL -s -u \"$ES_USERNAME:$ES_PASSWORD\" -X GET \"$KIBANA_URL/api/fleet/agent_policies\" \
-H \"kbn-xsrf: true\" \
-H \"Content-Type: application/json\" |
jq -r '.items[0].id'
Expand All @@ -210,7 +231,7 @@ jobs:
# Retrieve enrollment token using the policy ID
ENROLLMENT_TOKEN=$(docker compose -p ${{ env.UNIQUE_ID }} exec -T pipeline bash -c "
ssh lme-user@${{ env.AZURE_IP }} '
curl -k -s -u \"$ES_USERNAME:$ES_PASSWORD\" -X POST \"$KIBANA_URL/api/fleet/enrollment-api-keys\" \
curl -kL -s -u \"$ES_USERNAME:$ES_PASSWORD\" -X POST \"$KIBANA_URL/api/fleet/enrollment-api-keys\" \
-H \"kbn-xsrf: true\" \
-H \"Content-Type: application/json\" \
-d \"{\\\"policy_id\\\":\\\"$POLICY_ID\\\"}\" |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux_only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
KIBANA_PASSWORD: ${{ env.KIBANA_PASSWORD }}
AZURE_IP: ${{ env.AZURE_IP }}
run: |
sleep 360
cd testing/v2/development
docker compose -p ${{ env.UNIQUE_ID }} exec -T pipeline bash -c "
cd /home/lme-user/LME/testing/v2/installers && \
Expand Down
8 changes: 4 additions & 4 deletions ansible/post_install_local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

vars:
headers:
kbn-version: "8.12.2"
kbn-version: "8.15.3"
kbn-xsrf: "kibana"
Content-Type: "application/json"
max_retries: 60
Expand Down Expand Up @@ -465,7 +465,7 @@
register: dashboards

- name: Upload dashboards to Kibana
shell: 'curl -X POST -k --user "{{ elastic_username }}":"{{ elastic_password }}" -H "kbn-xsrf: true" -F file=@"{{ item }}" "{{ kibana_url }}"'
shell: 'curl -X POST -kL --user "{{ elastic_username }}":"{{ elastic_password }}" -H "kbn-xsrf: true" -F file=@"{{ item }}" "{{ kibana_url }}"'
loop: "{{ dashboards.files | map(attribute='path') | list }}"
args:
warn: false
Expand Down Expand Up @@ -610,7 +610,7 @@
register: dashboards

- name: Upload dashboards to Kibana
shell: 'curl -X POST -k --user "{{ elastic_username }}":"{{ elastic_password }}" -H "kbn-xsrf: true" -F file=@"{{ item }}" "{{ kibana_url }}"'
shell: 'curl -X POST -kL --user "{{ elastic_username }}":"{{ elastic_password }}" -H "kbn-xsrf: true" -F file=@"{{ item }}" "{{ kibana_url }}"'
args:
warn: false
loop: "{{ dashboards.files | map(attribute='path') | list }}"
Expand Down Expand Up @@ -901,7 +901,7 @@
shell: >
curl -X POST "{{ local_es_url }}/_security/user/readonly_user"
-u "{{ elastic_username }}:{{ elastic_password }}"
-k
-kL
-H "Content-Type: application/json"
-d '{
"password": "{{ read_only_password.stdout }}",
Expand Down
4 changes: 2 additions & 2 deletions ansible/set_fleet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

vars:
headers:
kbn-version: "8.12.2"
kbn-version: "8.15.3"
kbn-xsrf: "kibana"
Content-Type: "application/json"
max_retries: 60
Expand Down Expand Up @@ -109,7 +109,7 @@
max_attempts=30
delay=10
while [ $attempt -lt $max_attempts ]; do
response=$(curl -s -o /dev/null -w "%{http_code}" -k -u elastic:{{ elastic_password }} {{ local_kbn_url }}/api/fleet/agents/setup)
response=$(curl -s -o /dev/null -w "%{http_code}" -kL -u elastic:{{ elastic_password }} {{ local_kbn_url }}/api/fleet/agents/setup)
if [ "$response" = "200" ]; then
echo "Fleet API is ready. Proceeding with configuration..."
exit 0
Expand Down
8 changes: 4 additions & 4 deletions config/containers.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
docker.io/caddy:2-alpine
docker.elastic.co/elasticsearch/elasticsearch:8.12.2
docker.elastic.co/beats/elastic-agent:8.12.2
docker.elastic.co/kibana/kibana:8.12.2
docker.io/wazuh/wazuh-manager:4.7.5
docker.elastic.co/elasticsearch/elasticsearch:8.15.3
docker.elastic.co/beats/elastic-agent:8.15.3
docker.elastic.co/kibana/kibana:8.15.3
docker.io/wazuh/wazuh-manager:4.9.1
docker.io/jertel/elastalert2:2.20.0
2 changes: 2 additions & 0 deletions config/elastalert2/misc/smtp_auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
user: "[email protected]"
password: "giyq caym zqiw chje" #this is your app password if using gmail
21 changes: 21 additions & 0 deletions config/elastalert2/rules/example-email-rule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: EMAIL
type: frequency
index: wazuh-*
num_events: 1
timeframe:
minutes: 1
filter:
- query:
match_phrase:
agent.ip: "10.1.0.4"
alert: email
alert_text: "ASDFASDF"
alert_text_type: alert_text_only
email:
- "[email protected]"
smtp_ssl: true
smtp_port: 465
smtp_host: "smtp.gmail.com"
from_addr: "[email protected]"
smtp_auth_file: /opt/elastalert/misc/smtp_auth.yml

2 changes: 1 addition & 1 deletion config/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LOCAL_ES_URL=https://127.0.0.1:9200
#################

# Version of Elastic products
STACK_VERSION=8.12.2
STACK_VERSION=8.15.3
# Testing pre-releases? Use the SNAPSHOT option below:
# STACK_VERSION=8.11.0-SNAPSHOT
#
Expand Down
2 changes: 1 addition & 1 deletion config/setup/acct-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ ! -f "${CERTS_DIR}/ACCOUNTS_CREATED" ]; then
until curl -s --cacert config/certs/ca/ca.crt https://lme-elasticsearch:9200 | grep -q "missing authentication credentials"; do echo "WAITING"; sleep 30; done;

echo "Setting kibana_system password";
until curl -s -X POST --cacert config/certs/ca/ca.crt -u elastic:${ELASTIC_PASSWORD} -H "Content-Type: application/json" https://lme-elasticsearch:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD}\"}" | grep -q "^{}"; do sleep 2; done;
until curl -L -s -X POST --cacert config/certs/ca/ca.crt -u elastic:${ELASTIC_PASSWORD} -H "Content-Type: application/json" https://lme-elasticsearch:9200/_security/user/kibana_system/_password -d "{\"password\":\"${KIBANA_PASSWORD}\"}" | grep -q "^{}"; do sleep 2; done;

echo "All done!" | tee "${CERTS_DIR}/ACCOUNTS_CREATED" ;
fi
Expand Down
103 changes: 19 additions & 84 deletions config/wazuh_cluster/wazuh_manager.conf
Original file line number Diff line number Diff line change
Expand Up @@ -101,91 +101,26 @@
<skip_nfs>yes</skip_nfs>
</sca>

<vulnerability-detector>
<enabled>yes</enabled>
<interval>5m</interval>
<min_full_scan_interval>6h</min_full_scan_interval>
<run_on_start>yes</run_on_start>

<!-- Ubuntu OS vulnerabilities -->
<provider name="canonical">
<enabled>yes</enabled>
<os>trusty</os>
<os>xenial</os>
<os>bionic</os>
<os>focal</os>
<os>jammy</os>
<update_interval>1h</update_interval>
</provider>

<!-- Debian OS vulnerabilities -->
<provider name="debian">
<enabled>no</enabled>
<os>buster</os>
<os>bullseye</os>
<os>bookworm</os>
<update_interval>1h</update_interval>
</provider>

<!-- RedHat OS vulnerabilities -->
<provider name="redhat">
<enabled>no</enabled>
<os>5</os>
<os>6</os>
<os>7</os>
<os>8</os>
<os>9</os>
<update_interval>1h</update_interval>
</provider>

<!-- Amazon Linux OS vulnerabilities -->
<provider name="alas">
<enabled>no</enabled>
<os>amazon-linux</os>
<os>amazon-linux-2</os>
<os>amazon-linux-2022</os>
<update_interval>1h</update_interval>
</provider>

<!-- SUSE OS vulnerabilities -->
<provider name="suse">
<enabled>no</enabled>
<os>11-server</os>
<os>11-desktop</os>
<os>12-server</os>
<os>12-desktop</os>
<os>15-server</os>
<os>15-desktop</os>
<update_interval>1h</update_interval>
</provider>

<!-- Arch OS vulnerabilities -->
<provider name="arch">
<enabled>no</enabled>
<update_interval>1h</update_interval>
</provider>

<!-- Alma Linux OS vulnerabilities -->
<provider name="almalinux">
<enabled>no</enabled>
<os>8</os>
<os>9</os>
<update_interval>1h</update_interval>
</provider>

<!-- Windows OS vulnerabilities -->
<provider name="msu">
<enabled>yes</enabled>
<update_interval>1h</update_interval>
</provider>
<vulnerability-detection>
<enabled>yes</enabled>
<index-status>yes</index-status>
<feed-update-interval>60m</feed-update-interval>
</vulnerability-detection>

<!-- Aggregate vulnerabilities -->
<provider name="nvd">
<enabled>yes</enabled>
<update_interval>1h</update_interval>
</provider>

</vulnerability-detector>
<indexer>
<enabled>yes</enabled>
<hosts>
<!-- TODO make this use the official one we set in environment variables -->
<host>https://lme-elasticsearch:9200</host>
</hosts>
<ssl>
<certificate_authorities>
<ca>/etc/wazuh-manager/certs/ca/ca.crt</ca>
</certificate_authorities>
<certificate>/etc/wazuh-manager/certs/wazuh-manager/wazuh-manager.crt</certificate>
<key>/etc/wazuh-manager/certs/wazuh-manager/wazuh-manager.key</key>
</ssl>
</indexer>

<!-- File integrity monitoring -->
<syscheck>
Expand Down
Loading
Loading