The permissions were the indicated, but with root:wazuh instead of root:ossec, as it said in the documentation.
{"timestamp":"2023-11-08T07:18:38.227+0000","rule":{"level":3,"description":"Suricata: Alert - ET POLICY curl User-Agent Outbound","id":"86601","firedtimes":167,"mail":false,"groups":["ids","suricata"]},"agent":{"id":"005","name":"suricata","ip":"172.30.103.42"},"manager":{"name":"wazuh-server"},"id":"1699427918.9919257","decoder":{"name":"json"},"data":{"timestamp":"2023-11-08T07:18:38.127337+0000","flow_id":"1893192943492407.000000","in_iface":"ens5","event_type":"alert","src_ip":"172.30.103.42","src_port":"57460","dest_ip":"104.20.67.143","dest_port":"80","proto":"TCP","pkt_src":"wire/pcap","tx_id":"0","alert":{"action":"allowed","gid":"1","signature_id":"2013028","rev":"7","signature":"ET POLICY curl User-Agent Outbound","category":"Attempted Information Leak","severity":"2","metadata":{"created_at":["2011_06_14"],"updated_at":["2022_05_03"]}},"http":{"hostname":"
pastebin.com","url":"/raw/ZkwP7zPF","http_user_agent":"curl/8.3.0","http_method":"GET","protocol":"HTTP/1.1","status":"301","redirect":"
https://pastebin.com/raw/ZkwP7zPF","length":"3"},"app_proto":"http","direction":"to_server","flow":{"pkts_toserver":"4","pkts_toclient":"3","bytes_toserver":"359","bytes_toclient":"498","start":"2023-11-08T07:18:38.113113+0000","src_ip":"172.30.103.42","dest_ip":"104.20.67.143","src_port":"57460","dest_port":"80"}},"location":"/var/log/suricata/eve.json"}
Wed Nov 08 07:54:16 UTC 2023 /var/ossec/integrations/alert.json a a debug
Wed Nov 08 07:54:16 UTC 2023: # Starting
Wed Nov 08 07:54:16 UTC 2023: # File location
Wed Nov 08 07:54:16 UTC 2023: /var/ossec/integrations/alert.json
Wed Nov 08 07:54:16 UTC 2023: # Processing alert
Wed Nov 08 07:54:16 UTC 2023: {'timestamp': '2023-11-08T07:18:38.227+0000', 'rule': {'level': 3, 'description': 'Suricata: Alert - ET POLICY curl User-Agent Outbound', 'id': '86601', 'firedtimes': 167, 'mail': False, 'groups': ['ids', 'suricata']}, 'agent': {'id': '005', 'name': 'suricata', 'ip': '172.30.103.42'}, 'manager': {'name': 'wazuh-server'}, 'id': '1699427918.9919257', 'decoder': {'name': 'json'}, 'data': {'timestamp': '2023-11-08T07:18:38.127337+0000', 'flow_id': '1893192943492407.000000', 'in_iface': 'ens5', 'event_type': 'alert', 'src_ip': '172.30.103.42', 'src_port': '57460', 'dest_ip': '104.20.67.143', 'dest_port': '80', 'proto': 'TCP', 'pkt_src': 'wire/pcap', 'tx_id': '0', 'alert': {'action': 'allowed', 'gid': '1', 'signature_id': '2013028', 'rev': '7', 'signature': 'ET POLICY curl User-Agent Outbound', 'category': 'Attempted Information Leak', 'severity': '2', 'metadata': {'created_at': ['2011_06_14'], 'updated_at': ['2022_05_03']}}, 'http': {'hostname': '
pastebin.com', 'url': '/raw/ZkwP7zPF', 'http_user_agent': 'curl/8.3.0', 'http_method': 'GET', 'protocol': 'HTTP/1.1', 'status': '301', 'redirect': '
https://pastebin.com/raw/ZkwP7zPF', 'length': '3'}, 'app_proto': 'http', 'direction': 'to_server', 'flow': {'pkts_toserver': '4', 'pkts_toclient': '3', 'bytes_toserver': '359', 'bytes_toclient': '498', 'start': '2023-11-08T07:18:38.113113+0000', 'src_ip': '172.30.103.42', 'dest_ip': '104.20.67.143', 'src_port': '57460', 'dest_port': '80'}}, 'location': '/var/log/suricata/eve.json'}
Wed Nov 08 07:54:16 UTC 2023: {'query_status': 'ok', 'id': '2045738', 'urlhaus_reference': '
https://urlhaus.abuse.ch/url/2045738/', 'url': '
https://pastebin.com/raw/ZkwP7zPF', 'url_status': 'offline', 'host': '
pastebin.com', 'date_added': '2022-02-16 21:28:04 UTC', 'last_online': '2022-04-13 22:XX:XX UTC', 'threat': 'malware_download', 'blacklists': {'spamhaus_dbl': 'not listed', 'surbl': 'not listed'}, 'reporter': 'pmelson', 'larted': 'true', 'takedown_time_seconds': '50110124', 'tags': ['PowerShellSMTPInfoStealer'], 'payloads': [{'firstseen': '2022-02-16', 'filename': None, 'file_type': 'txt', 'response_size': '1186', 'response_md5': '9837238a94e0aacb1186fa7cfe97f671', 'response_sha256': 'ae6ac2c0135531cf68c7546e663b8f02b4e43be6a8a0b0faf256ec9d385d2545', 'urlhaus_download': '
https://urlhaus-api.abuse.ch/v1/download/ae6ac2c0135531cf68c7546e663b8f02b4e43be6a8a0b0faf256ec9d385d2545/', 'signature': None, 'virustotal': None, 'imphash': None, 'ssdeep': '24:+U1HHnkr/EuokcV5SgTs3Dvoxu+rEJ79KZCgrcYCe:+Knt/5SgIz4DEJE3rcYCe', 'tlsh': 'T1EC21F124D398A0604669B797F262BC02690C059E1DF1F6644BDBE8AF41CFB846224E'}]}
Wed Nov 08 07:54:16 UTC 2023: ok
Wed Nov 08 07:54:16 UTC 2023: {'urlhaus': {'found': 1, 'source': {'alert_id': '1699427918.9919257', 'rule': '86601', 'description': 'Suricata: Alert - ET POLICY curl User-Agent Outbound', 'url': '
https://pastebin.com/raw/ZkwP7zPF'}, 'urlhaus_reference': '
https://urlhaus.abuse.ch/url/2045738/', 'url_status': 'offline', 'url_date_added': '2022-02-16 21:28:04 UTC', 'url_threat': 'malware_download', 'url_blacklist_spamhaus': 'not listed', 'url_blacklist_surbl': 'not listed', 'url_tags': ['PowerShellSMTPInfoStealer']}, 'integration': 'custom-urlhaus'}
Wed Nov 08 07:54:16 UTC 2023: 1:[005] (suricata) 172.30.103.42->urlhaus:{"urlhaus": {"found": 1, "source": {"alert_id": "1699427918.9919257", "rule": "86601", "description": "Suricata: Alert - ET POLICY curl User-Agent Outbound", "url": "
https://pastebin.com/raw/ZkwP7zPF"}, "urlhaus_reference": "
https://urlhaus.abuse.ch/url/2045738/", "url_status": "offline", "url_date_added": "2022-02-16 21:28:04 UTC", "url_threat": "malware_download", "url_blacklist_spamhaus": "not listed", "url_blacklist_surbl": "not listed", "url_tags": ["PowerShellSMTPInfoStealer"]}, "integration": "custom-urlhaus"}
Wed Nov 08 07:54:16 UTC 2023 /tmp/custom-gchat-1699430056-191113913.alert > /dev/null 2>&1
This script dont need the api-key or hook-url to be sent because it is already in the script, thats why I put the values "a", with another values it works. I also know that is working because I have an integration with Google Meets and a message is sent when an alert with level > 10 is triggered, and the message is sent.
But when I use the integration it keeps returning the same error, I tried to put values for hook_url and api_key in the ossec.conf but same result.