community-scripts
community-scripts copied to clipboard
Add dynatrace scan hook
This PR:
- Adds a Dynatrace scan hook integration
The scan hook:
- Works with Dynatrace SaaS and Managed
- Create Dynatrace log attributes for
zap_pass_count,zap_warn_countandzap_fail_count - Create Dynatrace log metrics for
log.zap.pass_count,log.zap.warn_countandlog.zap.fail_count - Create a Dynatrace log event that generates and attaches
INFOevents to theAPPLICATIONentity forZAP scan passed - Automatically retrieves the Dynatrace entity ID(s) for any matching entities (based on the
entitySelectorgiven by the user). - The ZAP failure threshold is configurable. By default it is
0which means any ZAP failures are considered as a problem (and a ticket is raised). - Wraps
zap_get_alerts_wrapand pushes log lines via log ingest for each ZAP finding. If ZAP risk isMedium, log line status isWARN. If ZAP risk isHigh, log line status isERROR. - Wraps
pre_exitto pushfail_count,warn_countandpass_countas custom metrics (via log ingest). - Create a Dynatrace log event that generates and attaches
ERRORevents to theAPPLICATIONentity forVulnerable applications - If ZAP detects failures, an
ERRORlog line will be pushed - A dynatrace problem report will be automatically created when a ZAP error event occurs
- Create a Dynatrace dashboard to show all of this
Signed-off-by: agardnerit [email protected]
This pull request introduces 5 alerts when merging a56e52a5779a2b2ed2f1ab3d714eb8d6f790a7f1 into 9fe8c621d06e27c6f012bc3a2c918278631391d6 - view on LGTM.com
new alerts:
- 3 for Variable defined multiple times
- 1 for Unused local variable
- 1 for Nested loops with same variable
This should be added under the scan-hooks directory.
The LGTM issues should also be addressed.
I believe everything is addressed here. Have I missed anything?
The branch needs to be rebased, the commit can be fixed up.
Rebased to use latest CI.
Thank you!