idaholab / Malcolm

Malcolm is a powerful, easily deployable network traffic analysis tool suite for full packet capture artifacts (PCAP files), Zeek logs and Suricata alerts.
https://idaholab.github.io/Malcolm/
Other
353 stars 58 forks source link

add script for exporting dashboard #439

Open mmguero opened 6 months ago

mmguero commented 6 months ago

The contributor's guide gives instructions for exporting a newly created dashboard for inclusion in ./dashboards/dashboards in the Malcolm source repository, but this would be better to be at least a script. I think ideally the script would live inside the dashboards-helper container and could be executed using docker compose and avoid having to have dependencies outside the container.

The script would need to:

  1. call the /dashboards/api/opensearch-dashboards/dashboards/export API to get the dashboard by ID (perhaps it could be looked up by name, but ID is surer)
  2. remove the arkime_sessions3-* index pattern definition section completely
  3. replace the string arkime_sessions3-* with MALCOLM_NETWORK_INDEX_PATTERN_REPLACER and malcolm_beats_* with MALCOLM_OTHER_INDEX_PATTERN_REPLACER
  4. in my opinion, set any instances of highlightAll in the JSON to false
  5. return the exported/scrubbed dashboard JSON file