Skip to content

Commit a391435

Browse files
authored
Wazuh mitre report setup pr 2.x (#2676)
* Wazuh-mitre-report-setup * Wazuh-mitre-shellshock-longurl-block * Fixing-vars * Wazuh-mitre-report-setup-PR-2.x * Wazuh-mitre-report-setup-PR-2.x * Wazuh-mitre-report-setup-PR-2.x
1 parent 976485a commit a391435

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

roles/debian/wazuh/templates/generate_weekly_report.sh.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
REPORT_DATE=$(date +"%Y-%m-%d")
77
REPORT_NAME="weekly-report-${REPORT_DATE}"
88
LOG_FILE="/var/log/opensearch-reports.log"
9-
USERNAME= {{ wazuh.mitre_report.username }}
10-
PASSWORD= {{ _wazuh_filebeat_password }}
9+
USERNAME="{{ wazuh.mitre_report.username | default('') }}"
10+
PASSWORD="{{ _wazuh_filebeat_password.stdout | default('') }}"
1111

1212
# Function to log messages
1313
log_message() {
@@ -17,7 +17,7 @@ log_message() {
1717
log_message "Starting weekly report generation"
1818

1919
# Generate and send the report
20-
opensearch-reporting-cli \
20+
/usr/local/bin/opensearch-reporting-cli \
2121
-u "{{ wazuh.mitre_report.visualization_url }}" \
2222
-a basic \
2323
-c "$USERNAME:$PASSWORD" \
@@ -26,7 +26,7 @@ opensearch-reporting-cli \
2626
-n "$REPORT_NAME" \
2727
-e smtp \
2828
-s "{{ wazuh.mitre_report.e_mail_from }}" \
29-
-r "{{ wazuh.manager.wazuh_manager_mailto}}" \
29+
-r "{{ wazuh.manager.wazuh_manager_mailto }}" \
3030
--subject "Weekly OpenSearch Report - $(date '+%B %d, %Y')" \
3131
--note "Hi,\n\nPlease find attached the weekly Wazuh Mitre report covering the last 7 days.\n\nReport generated on: $(date '+%Y-%m-%d %H:%M:%S')\n\nBest regards,\nAutomated Reporting System" \
3232
--smtphost localhost \

0 commit comments

Comments
 (0)