Artica Wiki

Send proxy requests to Wazuh

Send the requests of Artica Proxy to Wazuh as JSON events, through the Wazuh agent installed on the proxy.

Back to Proxy events | Install the Wazuh client inside Artica | Connect the Wazuh client to the Wazuh manager

Artica Proxy can send the requests that pass through the proxy to Wazuh. 
Each request is written as one JSON line to a local file, and the Wazuh agent installed on the proxy sends this file to your Wazuh manager. 
In Wazuh, every field is available under data.*: you do not have to write a decoder.

Functional benefits

Concepts

How it works

  1. For each request, the proxy sends a log line to the Artica logging helper.
  2. The helper parses the line. If the request matches the filter, the helper writes it as one JSON line to /var/log/squid/wazuh/access.json.
  3. The Wazuh agent installed on the proxy reads this file (log_format json) and sends the events to the Wazuh manager.
  4. On the Wazuh manager, your rules raise alerts from the fields of the event.

Filter

Lines that the proxy cannot parse are never sent to Wazuh.

Rotation

When the file reaches the maximum size (100 MB by default), it is renamed to access.json.1 and a new file is started. 
The previous access.json.1 is replaced. 
With 0, the file is never rotated and grows without limit.

Fields of an event

Empty values are not written. Squid writes a - when a value is unknown: these values are not written either.

Field Content
integration Always artica-proxy. Use it in your rules to select the proxy events.
timestamp Date of the request (UTC, RFC 3339).
source_host Hostname of the proxy.
client_ip IP address of the client.
mac MAC address of the client, when the proxy knows it.
username Authenticated user.
method HTTP method (GET, POST, CONNECT…).
host Website requested by the client: the TLS SNI, or the requested domain.
server_ip Server contacted by the proxy.
http_status HTTP status code sent to the client.
squid_status Squid result code (TCP_MISS, TCP_DENIED…).
reply_size Size of the reply, in bytes.
response_time_ms Response time, in milliseconds.
category Web category of the website.
user_agent User-Agent of the client.
error_code Squid error code (ERR_DNS_FAIL, ERR_ACCESS_DENIED…).

Two events written by a proxy:

{"integration":"artica-proxy","timestamp":"2026-10-05T15:49:05.000Z","source_host":"proxy.example.net","client_ip":"192.168.1.142","method":"GET","host":"nonexistent-host.invalid","http_status":503,"squid_status":"TCP_MISS_ABORTED","reply_size":711732,"response_time_ms":3041,"user_agent":"curl/8.14.1","error_code":"ERR_DNS_FAIL"}
{"integration":"artica-proxy","timestamp":"2026-10-05T15:49:05.000Z","source_host":"proxy.example.net","client_ip":"192.168.1.142","method":"GET","host":"www.artica.fr","server_ip":"www.artica.fr","http_status":403,"squid_status":"TCP_MISS","reply_size":2666,"response_time_ms":22,"category":"Science_computing","user_agent":"curl/8.14.1"}

Use cases

Enable the Wazuh output

Artica writes the new configuration and reloads the proxy.

The row shows the filter and the path of the file. The first events are written as soon as a request matches the filter.

Declare the file to the Wazuh agent

The Wazuh agent was installed by Artica

Nothing to do. When you click on Apply, Artica adds the file to the agent configuration and restarts the agent. 
When you disable the Wazuh output, Artica removes the file from the agent configuration. 
Artica also checks this configuration every few minutes, so a change made in ossec.conf by hand is fixed automatically.

See Install the Wazuh client inside Artica and Connect the Wazuh client to the Wazuh manager.

The Wazuh agent was installed by another way

Add this block to /var/ossec/etc/ossec.conf, then restart the agent:

<localfile>
  <log_format>json</log_format>
  <location>/var/log/squid/wazuh/access.json</location>
</localfile>

Create rules on the Wazuh manager

Wazuh receives the events, but it raises an alert only when a rule matches. 
Add these sample rules to /var/ossec/etc/rules/local_rules.xml on the Wazuh manager, then restart the manager. Change the rule IDs if they are already used.

<group name="artica-proxy,web,">
  <rule id="100500" level="0">
    <decoded_as>json</decoded_as>
    <field name="integration">^artica-proxy$</field>
    <description>Artica Proxy: access event</description>
  </rule>

  <rule id="100501" level="5">
    <if_sid>100500</if_sid>
    <field name="squid_status">DENIED</field>
    <description>Artica Proxy: request denied for $(client_ip) to $(host)</description>
    <group>access_denied,</group>
  </rule>

  <rule id="100502" level="3">
    <if_sid>100500</if_sid>
    <field name="http_status">^407$</field>
    <description>Artica Proxy: authentication required for $(client_ip)</description>
    <group>authentication_failed,</group>
  </rule>

  <rule id="100503" level="4">
    <if_sid>100500</if_sid>
    <field name="http_status">^5\d\d$</field>
    <description>Artica Proxy: server error $(http_status) for $(host)</description>
  </rule>

  <rule id="100504" level="10" frequency="20" timeframe="60">
    <if_matched_sid>100501</if_matched_sid>
    <same_field>client_ip</same_field>
    <description>Artica Proxy: $(client_ip) denied 20 times in 60 s</description>
  </rule>
</group>

Check that it works

Limits and troubleshooting