| Verify Rule Deletion in Database. Use the following command to check if the rule still exists in the ph_drq_rule table in the database:  psql -U phoenix phoenixdb -c "select * from ph_drq_rule" --csv > /tmp/allrules.csv  Open the exported CSV file (/tmp/allrules.csv). Search for the rule name to confirm whether it exists in the current database. If the rule is not found in the database, proceed to the next step.  Sometimes, even after deletion from the database, a rule might still exist in a previous version of the FortiSIEM and continue to trigger incidents. To stop this: - Navigate to the incident page where the specific incident is listed.
- Locate and select the incident that is being triggered by the deleted rule.
- Select 'Actions'.
- Choose Disable Rule.
Once the rule is disabled from the incident interface, no further incidents should be triggered from the deleted rule. Â Maintain an updated list of active rules to avoid confusion by running below command: psql -U phoenix phoenixdb -c "select * from ph_drq_rule where active = 't';" --csv > /tmp/enablerule.csv
How to check for Certain event types and certain rules as per below :-Â
psql -U phoenix phoenixdb -c " SELECT count(*) FROM ph_incident WHERE incident_et = 'PH_RULE_Msiexec_Initiated_Connection' AND creation_time > (extract(epoch FROM now() - interval '15 minutes') * 1000); " psql -U phoenix phoenixdb -c " SELECT id, incident_et, incident_title, to_timestamp(creation_time/1000) AS created_at FROM ph_incident WHERE incident_et = 'PH_RULE_Msiexec_Initiated_Connection' ORDER BY creation_time DESC LIMIT 10; " psql -U phoenix phoenixdb -c " SELECT i.id, i.incident_title, i.incident_et, to_timestamp(i.creation_time/1000) AS created_at, d.trigger_events FROM ph_incident i JOIN ph_incident_detail d ON i.id = d.incident_id WHERE i.incident_et = 'PH_RULE_Msiexec_Initiated_Connection' ORDER BY i.creation_time DESC LIMIT 20; " |