FortiSOAR Knowledge Base
FortiSOAR: Security Orchestration and Response software provides innovative case management, automation, and orchestration. It pulls together all of an organization's tools, helps unify operations, and reduce alert fatigue, context switching, and the mean time to respond to incidents.
malayamanas_FTNT
Article Id 303260
Description This article describes creating a custom JINJA filter html2json to convert html data to JSON dictionary. This method can be used to create any custom JINJA filter.
Scope FortiSOAR v7.X.
Solution
  1. Install pypi package: sudo -u nginx /opt/cyops-workflow/.env/bin/pip install html-to-json.
  2. Restart services: systemctl restart celeryd celerybeatd.
  3. Take a backup of the below file with the below command:

 

cp /opt/cyops-workflow/sealab/expression_builder/custom/custom_functions.py /opt/cyops-workflow/sealab/expression_builder/custom/custom_functions.py.original

 

  1. Edit the attachment file 'custom_functions.py' as per requirement. The file attached below is already edited for html2json custom JINJA filter in this example.
  2. Restart services: systemctl restart celeryd celerybeatd.
  3. The new JINJA filter html2json is now ready for use in the playbook.