Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update category URL filtering issue #147 #148

Closed
wants to merge 1 commit into from

Conversation

linsmeyerh
Copy link

Hi Team,

This PR is for the issue raised #147

Proposed changes to update field category - extracting from pan:threat raw logs.

Changes applied

transforms.conf file:
-extend capturing for report extract_threat to include new field extraction new_category

props.conf file:
-re-evaluate category from new_category and threat_category fields

PaloAltoNetworks#147

Proposed changes to update field category extraction
Changes applied
transforms.conf file:
-extended capturing for report extract_threat to include new field extraction new_category
props.conf file:
-re-evaluate category from new_category and threat_category fields
@simonsigre
Copy link
Contributor

Pretty keen on seeing this item get pushed through ASAP.

@davidclarke-au
Copy link

+1 for moving this as quickly as possible please PAN team.

@kylegbakker
Copy link

+1 here also

@jxztan
Copy link

jxztan commented Oct 21, 2020

Great job @linsmeyerh !

@Git-Portal
Copy link

+1 please push this through

@amanuelw
Copy link

looking forward to seeing this implemented soon

@grantrburgess
Copy link

+1 to implement this

Copy link
Member

@btorresgil btorresgil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for offering this PR. I made a couple requests for changes. Let me know if you have any questions.

@@ -106,7 +106,7 @@ EVAL-report_id = if(log_subtype=="wildfire", coalesce(report_id,threat_id)
EVAL-http_category = if(log_subtype=="url", raw_category, null())
EVAL-verdict = if(log_subtype=="wildfire", raw_category, null())
EVAL-threat_category = if(log_subtype!="url" AND log_subtype!="file", if(threat_category=="unknown",log_subtype,coalesce(threat_category,log_subtype)), null())
EVAL-category = if(log_subtype=="url" OR log_subtype=="file", raw_category, threat_category)
EVAL-category = if(log_subtype=="url" OR log_subtype=="file", split(new_category, ","), threat_category)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem compatible with older PAN-OS versions that don't have a new_category field. Perhaps you can coalesce raw_category and new_category first?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example:

EVAL-category        = if(log_subtype=="url" OR log_subtype=="file", split(coalesce(new_category, raw_category), ","), threat_category)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @btorresgil ,

Thank you for looking after this issue/enhancement. The adjustment using coalesce making this great change compatible with older PAN-OS versions!!.

Thank you

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @linsmeyerh just following up on this PR. If you could make the requested changes and push them to your remote branch. I can move this PR along.

@@ -74,7 +74,7 @@ FORMAT = sourcetype::pan:config_traps

[extract_threat]
DELIMS = ","
FIELDS = "future_use1","receive_time","serial_number","type","log_subtype","version","generated_time","src_ip","dest_ip","src_translated_ip","dest_translated_ip","rule","src_user","dest_user","app","vsys","src_zone","dest_zone","src_interface","dest_interface","log_forwarding_profile","future_use3","session_id","repeat_count","src_port","dest_port","src_translated_port","dest_translated_port","session_flags","transport","action","misc","threat","raw_category","severity","direction","sequence_number","action_flags","src_location","dest_location","future_use4","content_type","pcap_id","file_hash","cloud_address","url_index","user_agent","file_type","xff","referrer","sender","subject","recipient","report_id","devicegroup_level1","devicegroup_level2","devicegroup_level3","devicegroup_level4","vsys_name","dvc_name","future_use5","src_vm","dest_vm","http_method","tunnel_id","tunnel_monitor_tag","tunnel_session_id","tunnel_start_time","tunnel_type","threat_category","content_version"
FIELDS = "future_use1","receive_time","serial_number","type","log_subtype","version","generated_time","src_ip","dest_ip","src_translated_ip","dest_translated_ip","rule","src_user","dest_user","app","vsys","src_zone","dest_zone","src_interface","dest_interface","log_forwarding_profile","future_use3","session_id","repeat_count","src_port","dest_port","src_translated_port","dest_translated_port","session_flags","transport","action","misc","threat","raw_category","severity","direction","sequence_number","action_flags","src_location","dest_location","future_use4","content_type","pcap_id","file_hash","cloud_address","url_index","user_agent","file_type","xff","referrer","sender","subject","recipient","report_id","devicegroup_level1","devicegroup_level2","devicegroup_level3","devicegroup_level4","vsys_name","dvc_name","future_use5","src_vm","dest_vm","http_method","tunnel_id","tunnel_monitor_tag","tunnel_session_id","tunnel_start_time","tunnel_type","threat_category","content_version","future_use5","future_use6","future_use7","future_use8","new_category"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name new_category is relative because newness is lost over time. Can you use a descriptive name for the field such as url_category?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree 100% with new field name url_category and think the best way to go.

Thank you.

@btorresgil
Copy link
Member

Note to maintainers: No changes to the datamodel necessary because the new field is coalesced to the category field which is already in the datamodel. However, the category field was always a string and now it could be a multi-value field with strings, so we'll need to validate some of the dashboards.

@paulmnguyen paulmnguyen added add-on Related to the Splunk Add-On bug labels Oct 26, 2020
@paulmnguyen
Copy link
Contributor

@linsmeyerh If could you resolve the requested changes by updating your code. I could put this into the next release.

@darrendchow
Copy link

hope this isn't too late +1 to push this

@btorresgil
Copy link
Member

@linsmeyerh If you can make the requested changes we can merge this in and release it. If not, we can close this PR and make the changes ourselves. Let us know.

@linsmeyerh
Copy link
Author

@btorresgil thank you. I'm happy for you to close this PR and make the changes. Please include this work in the next release!!
Thanks again.

@paulmnguyen
Copy link
Contributor

Closing this pull request as changes are part of PR #154

@paulmnguyen paulmnguyen closed this Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-on Related to the Splunk Add-On bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.