cancel
Showing results for 
Search instead for 
Did you mean: 
Reliable Contributor malware-alerts
Reliable Contributor
Report Inappropriate Content
Message 1 of 2

Logging the matching objects in a list when a rule fires.

Jump to solution

We have rules in the ruleset that refer to lists that contain a lot of objects that we would like to clean-up.

I'm trying to figure out a way to log the objects that match in a list referred to in a specific rule. I tried using the "List.LastMatches" operand but unfortunately this doesn't work as it only logs the name of the rule that matches (since the rule name is part of the condition for the logging rule I'm creating.). 

For example:

The rule that contains the list is similar to the following:

Name: Bypass Authentication for URLs in whitelist ("whitelist" is a list containing URLs)

The logging rule I've created is like so:

Name: Log objects in fired rule list ("list" contains rule names that I'm monitoring)

Condition: Rules.FiredRules,Names at least one in list "list"

Event: Set User-Defined.logLine = DateTime.ToWebReporterString,IP.toString(Client.IP),URL.Host,Header.Request.Get ("User-Agent"),List.LastMatches

 

So the issue here is that "List.LastMatches" results in the name of the FiredRule since this is the last list it had to match against before executing this rule.

I'm looking for a way to log the object that matched in "whitelist" instead.

Thanks for your help

1 Solution

Accepted Solutions
Reliable Contributor malware-alerts
Reliable Contributor
Report Inappropriate Content
Message 2 of 2

Re: Logging the matching objects in a list when a rule fires.

Jump to solution

I figured out an easy way to get the objects within the rule in the ruleset that triggers:

 

In the rule itself, I add an event the following way:

Set Property Value: Set User-Defined.logline2 (I created this one) = List.LastMatches

 

This basically puts the value of the URL in "User-Defined.logline2"

Then in the logging ruleset I append "User-Defined.logline2" to the already existing "FileSystemLogging.WriteLogEntry" and voilà.

1 Reply
Reliable Contributor malware-alerts
Reliable Contributor
Report Inappropriate Content
Message 2 of 2

Re: Logging the matching objects in a list when a rule fires.

Jump to solution

I figured out an easy way to get the objects within the rule in the ruleset that triggers:

 

In the rule itself, I add an event the following way:

Set Property Value: Set User-Defined.logline2 (I created this one) = List.LastMatches

 

This basically puts the value of the URL in "User-Defined.logline2"

Then in the logging ruleset I append "User-Defined.logline2" to the already existing "FileSystemLogging.WriteLogEntry" and voilà.

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator
  • Community Help Hub

      New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

    • Find Forum FAQs
    • Learn How to Earn Badges
    • Ask for Help
    Go to Community Help

    Join the Community

      Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

    • Get helpful solutions from McAfee experts.
    • Stay connected to product conversations that matter to you.
    • Participate in product groups led by McAfee employees.
    Join the Community
    Join the Community