Skip to Content
Security Automation with Ansible 2
book

Security Automation with Ansible 2

by Akash Mahajan, MADHU AKULA
December 2017
Intermediate to advanced
364 pages
7h 30m
English
Packt Publishing
Content preview from Security Automation with Ansible 2

OWASP ZAP Python API sample script

OWASP ZAP Python API package comes with a very handy script that is complete in terms of code for spidering and doing an active scan of a web application.

Here are some snippets from sample code that we are interested in at this point. Import the Python API client for OWASP ZAP. This is installed using pip install python-owasp-zap-v2.4:

from zapv2 import ZAPv2

Now, we connect to the ZAP instance API endpoint. We can provide the host and port for the OWASP ZAP instance as an argument to our module:

zap = ZAPv2(apikey=apikey, proxies={'http': 'http://127.0.0.1:8090', 'https': 'http://127.0.0.1:8090'}) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Implementing DevOps with Ansible 2

Implementing DevOps with Ansible 2

Jonathan McAllister
Practical Ansible 2

Practical Ansible 2

Daniel Oh, James Freeman, Fabio Alessandro Locati

Publisher Resources

ISBN: 9781788394512Supplemental Content