Hi Jose, thank you very much for addressing my issue.
I tried pointing different paths in ossec.conf, for no effect. Here is a summary of my configuration:
S3 bucket file structure:
AWSLogs/<account_id>/GuardDuty/<region>/YYYY/MM/DD/
ossec.conf file, s3 wodle:
<wodle name="aws-s3">
<disabled>no</disabled>
<interval>1m</interval>
<run_on_start>yes</run_on_start>
<skip_on_error>yes</skip_on_error>
<bucket type="cloudtrail">
<name><my-bucket-name></name>
<only_logs_after>2025-MAR-28</only_logs_after>
<path_suffix><org_id></path_suffix>
</bucket>
<bucket type="guardduty">
<name><my-bucket-name></name>
<!--<path>AWSLogs/<account_id>/GuardDuty/</path>-->
<only_logs_after>2025-MAR-28</only_logs_after>
<regions>us-east-1,us-east-2,us-west-1,us-west-2,ap-east-1,ap-south-1,ap-northeast-3,ap-northeast-2,ap-southeast-1,ap-southeast-2,ap-northeast-1,ca-central-1,eu-central-1,eu-west-1,eu-west-2,eu-west-3,eu-north-1,sa-east-1</regions>
</bucket>
</wodle>
I tried with path AWSLogs/<account_id>/GuardDuty/, AWSLogs/*/GuardDuty/, and with no path at all. Also tried with regions and without them.
Here is Wazuh log output just after the manager restart:
tail /var/ossec/logs/ossec.log | grep aws
2025/04/02 10:23:25 wazuh-modulesd:aws-s3: INFO: Starting fetching of logs.
2025/04/02 10:23:25 wazuh-modulesd:aws-s3: INFO: Executing Bucket Analysis: (Bucket: <my-bucket-name>, Path suffix: <org_id>, Type: cloudtrail)
2025/04/02 10:23:26 wazuh-modulesd:aws-s3: INFO: Executing Bucket Analysis: (Bucket: <my-bucket-name>, Type: guardduty)
2025/04/02 10:23:28 wazuh-modulesd:aws-s3: INFO: Fetching logs finished.
2025/04/02 10:24:25 wazuh-modulesd:aws-s3: INFO: Starting fetching of logs.
2025/04/02 10:24:25 wazuh-modulesd:aws-s3: INFO: Executing Bucket Analysis: (Bucket: <my-bucket-name>, Path suffix: <org_id>, Type: cloudtrail)
2025/04/02 10:24:26 wazuh-modulesd:aws-s3: INFO: Executing Bucket Analysis: (Bucket: <my-bucket-name>, Type: guardduty)
2025/04/02 10:24:27 wazuh-modulesd:aws-s3: INFO: Fetching logs finished.
And manual wodle run output:
/var/ossec/wodles/aws/aws-s3 --bucket <my-bucket-name> --type guardduty --debug 4
DEBUG: +++ Debug mode on - Level: 4
DEBUG: Generating default configuration for retries: mode standard - max_attempts 10
DEBUG: +++ Working on <account_id> - eu-west-2
DEBUG: +++ Marker: AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/04/02/db9ce5f5-b1a7-4646-ab7a-7da8a80ffb41.jsonl.gz
DEBUG: +++ No logs to process in bucket: <account_id>/eu-west-2
DEBUG: +++ DB Maintenance
DEBUG: +++ Working on <other_account_id> - eu-west-2
DEBUG: +++ Marker: AWSLogs/<other_account_id>/GuardDuty/eu-west-2/2025/04/02
DEBUG: +++ No logs to process in bucket: <other_account_id>/eu-west-2
DEBUG: +++ DB Maintenance
DEBUG: +++ Working on <third_account_id> - eu-west-2
DEBUG: +++ Marker: AWSLogs/<third_account_id>/GuardDuty/eu-west-2/2025/04/02
DEBUG: +++ No logs to process in bucket: <third_account_id>/eu-west-2
DEBUG: +++ DB Maintenance
I also got inside s3_cloudtrail.db (the only .db file present) and output from SQL query, guardduty table:
sqlite> SELECT * FROM guardduty;
<my-bucket-name>/|<account_id>|AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/03/29/32279e7b-ad2c-41bd-b1b1-41219347c80c.jsonl.gz|2025-04-02 10:11:18|20250329
<my-bucket-name>/|<account_id>|AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/03/29/b15e4b92-ca6d-404a-8529-94f4c63b5ebb.jsonl.gz|2025-04-02 10:11:18|20250329
<my-bucket-name>/|<account_id>|AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/03/29/ee807a71-b78b-4689-afdb-5bc04b122bbb.jsonl.gz|2025-04-02 10:11:18|20250329
<my-bucket-name>/|<account_id>|AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/03/31/380c6d62-da86-4e10-9751-cb1aea9ae18d.jsonl.gz|2025-04-02 10:11:18|20250331
<my-bucket-name>/|<account_id>|AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/04/01/79e9cce1-5b25-48bb-922d-ce387db1a314.jsonl.gz|2025-04-02 10:11:18|20250401
<my-bucket-name>/|<account_id>|AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/04/02/9b1fdff6-2d36-4843-8683-686e48fc785a.jsonl.gz|2025-04-02 10:11:18|20250402
<my-bucket-name>/|<account_id>|AWSLogs/<account_id>/GuardDuty/eu-west-2/2025/04/02/db9ce5f5-b1a7-4646-ab7a-7da8a80ffb41.jsonl.gz|2025-04-02 10:11:18|20250402
So definitely GuardDuty logs are in the bucket and Wazuh does see them. Just none of it appears in Wazuh dashboard, Cloud Security -> AWS. The only source is cloudtrail.
I also wonder, why there is no other .db file than cloudtrail s3_cloudtrail.db? Is it expected, should there not be separate one for guard duty?