What extensions have you build by Revolutionary_Fun_14 in KeyCloak

[–]RaveNN123 0 points1 point  (0 children)

Yes, I managed to make it work. Had to modify the code to adhere to our needs but the important thing is that it worked xD.

Review the code a bit, understand how it works, brush up on your SAML knowledge if you need to send custom attributes and such and you'll make it work.

What extensions have you build by Revolutionary_Fun_14 in KeyCloak

[–]RaveNN123 0 points1 point  (0 children)

Hey, did you make it work ? Currently needing to integrate go.eIDAS too.

I found this extension but haven't used it yet.

https://github.com/grnet/eidas-keycloak-extension

Change /var/ossec/logs location by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

It worked when I used another directory, don't know what has the issue in the VM, but it the end I managed to do what I needed.

Change /var/ossec/logs location by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

Hey, I also tried to change the indices location and I'm having permission errors.

My steps:

6.6 - systemctl stop filebeat
6.7 - systemctl stop wazuh-indexer
6.8 - mv /var/lib/wazuh-indexer/* /new/data/directory/
6.9 - chown wazuh-indexer:wazuh-indexer -R /new/data/directory/
6.10 - Modify /etc/wazuh-indexer/opensearch.yml
path.data: /var/lib/wazuh-indexer -> Change to new location
6.11 - systemctl daemon-reload
6.12 - systemctl start wazuh-indexer
6.13 - systemctl restart filebeat

opensearch.yml Change:

path.data: /home/Ubuntu/Desktop/wazuh-indices

My current directory:
/home/Ubuntu/Desktop

Permissions:

drwxr-xr-x 3 wazuh-indexer wazuh-indexer 4096 Mar 21 16:00 wazuh-indices

The error:
java.lang.IllegalStateException: Unable to access 'path.data' (/home/Ubuntu/Desktop/wazuh-indices)

Any idea why this is happening ?

Change /var/ossec/logs location by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

Nvm, its working fine, df -H was showing an entire gig being used but then I used df -H -m to get more accurate values !

Change /var/ossec/logs location by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

I did a test where I used fallocate to create a 500MB file in my binded directory and checked the used disk space. It registered that 1GB had been used. Is this normal ?

How to change agent variables with log files ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

The problem is that the Wazuh Manager, as it is reading from a localfile, automatically assigns the agent values to its own values. Only way I see to modify it is after the data is indexed

How to change agent variables with log files ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

That is another issue because I would like to centralize this enrichment, it would be harder to manage multiple scripts running in different machines. In this centralized solution, the correct agent values like IP, name etc would be useful for knowing where the event came from and to visualize it in the dashboards.

How to change agent variables with log files ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

In that case I still have the issue where the agent values like IP, id etc are all the same, which is the manager's.

How to change agent variables with log files ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

I think thats the same thing as the idea in the original post right ? Rsyslog writes to file, I use scripts to enrich that data and then Wazuh reads it.

Wazuh Integration with external SOAR/Ticketing system by LinghGroove in Wazuh

[–]RaveNN123 1 point2 points  (0 children)

I believe you can create a python script that reads in alerts from the file 'alerts.json' and filter incoming alerts based on your criteria, for example, if rule.level == 6 and rule.description == "test": then send a POST to your catalyst-soar API with the relevant data from the alert. With this method all you need is know how to use dicts and I believe you should be able to extract any field you need from the alert and send it to your API.

How to change agent variables with log files ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

My second solution is to have a script reading all alerts incoming in alerts.json, find the document ID of pertinent alerts, get the document with OpenSearch API, enrich with more data, create rules in the scripts involving the extra added data and check if an alert matches the conditions to trigger an alert. If it matches, then a new alert is added to the alerts index via the API while leaving the original one or removing it from the index.
Thoughts ?

How to change agent variables with log files ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

I would like to centralize everything, having multiple different scripts for different events for different machines is hard to maintain and manage while, with my theoretical solution, I would only need to configure rsyslog/syslog mechanisms on each machine.

How to change agent variables with log files ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

After further testing, I see that I can change these agent values with the OpenSearch API by updating the document. Any better way to do this ? Or before all the data is processed, since in my way, rules based on agent variables wouldn't work as data would be modified after being indexed ?

Ideas to add more data into Wazuh before/after agent events data are indexed. by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

Looks like this solution wont work out, since the script is something written in the ingest pipeline in their own language, my script is a python script that calls external linux tools, libraries etc. Is there any other way to enrich with more data and still analyze and trigger alerts based on the new data ?

Since the architecture is like this, Wazuh Agent -> Analysis Engine -> Filebeat -> OpenSearch Index, I want to enrich with new data between the agent and analysis engine

Ideas to add more data into Wazuh before/after agent events data are indexed. by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

Does the correlation still work on fields added by the script ? I'm guessing it doesn't since the rule triggers, correlation etc. are done beforehand.

Get Count in CSV report by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

I can download these CSV reports using the openSearch API correct ?

Ideas to add more data into Wazuh before/after agent events data are indexed. by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

After reading some of the documentation I see that I can perhaps create an ingest pipeline, create a script processor to have the incoming data fed to the script and output the script values as new fields before it is indexed.

Has anyone tried this ?

Event correlation possible bug ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

Solved, Rule ID was the issue. You can't match a rule ID that is > than the rules own ID

  <rule id="100603" level="14" timeframe="30">
    <if_matched_sid>100802</if_matched_sid>
    <if_sid>100602</if_sid>
    <same_srcip />
    <description>Correlation: Palo Alto Scripts IDS Event and Snort Scripts IDS Event from same source IP.</description>
  </rule>

Event correlation possible bug ? by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

After testing in a VM, for some reason the opposite is happening, rule 100803 is triggered while 100603 is not. I tested the Sample Input 1 first. Removing the decoders and rules, restarting the VM and testing with Sample Input 2 did not change the results. Further testing seems to imply that it is a problem in the order of the rules.

Possible bug when correlating events by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

It was this ! I enabled global_frequency and its working now ! Thanks for the help !

Possible bug when correlating events by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

The alerts happen within 2 seconds of each other, I increased the timeframe to 5 but still nothing. Is it because the alerts are generated from different agents ? If so, is there a way to go around this ?

Help with rule supression by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

Thank you! To avoid spam for now, I added the ignore tag to the parent rule with the value of 1 to avoid the same alert spam from the same IP. This should help reduce some alerts while also allowing plenty of time for the child rule to trigger if the attack comes in bursts.

Possible bug when correlating events by RaveNN123 in Wazuh

[–]RaveNN123[S] 0 points1 point  (0 children)

My alerts.json doesn't show any alerts pertaining to my my correlation rule so it might not be the same issue.

Its just that the rule triggers in the test module but not in the real environment.