Zap Baseline scan using ansible

17 views
Skip to first unread message

rebecca acheampong

unread,
May 3, 2021, 9:59:04 AM5/3/21
to Ansible Project
I am performing a zap-full-scan on DVWS as the target on kali. I get this error below:
Your help is appreciated.

TASK [getting raw output of the scan] *****************************************************
fatal: [my_vm_06]: FAILED! => {"changed": true, "cmd": ["docker", "logs", "-f", "owasp-zap-full-scan-dvws"], "delta": "0:00:00.288796", "end": "2021-05-03 14:54:23.232662", "msg": "non-zero return code", "rc": 1, "start": "2021-05-03 14:54:22.943866", "stderr": "Error: No such container: owasp-zap-full-scan-dvws", "stderr_lines": ["Error: No such container: owasp-zap-full-scan-dvws"], "stdout": "", "stdout_lines": []}

I put my playbook here:

---
- name: Running OWASP ZAP Baseline Scan
  hosts: localhost
  gather_facts: no
  become: yes
  vars_files:
    - var_zapbaseline.yml
  tasks:
    - vmware_guest:
        hostname: "{{ VMWARE_HOST }}"
        username: "{{ VMWARE_USER }}"
        password: "{{ VMWARE_PASSWORD }}"
        validate_certs: no
        folder: /ha-datacenter/vm/
        name: my_vm_06
- name: run zap baseline
  hosts: my_vm_06
  remote_user: "{{ remote_user_name }}"
  gather_facts: no
  vars:
    remote_user_name: kali-user
    owasp_zap_image_name: owasp/zap2docker-weekly
    website_url: 0.0.0.0:80
    reports_location: ~/Documents/scans
    scan_name: owasp-zap-full-scan-dvws
  tasks:
     - name: running owasp zap full scan container against "{{ website_url }}"
      docker_container:
        name: "{{ scan_name }}"
        image: "{{ owasp_zap_image_name }}"
        interactive: yes
        auto_remove: yes
        state: started
        volumes: "{{ reports_location }}:/zap/wrk:rw"
        command: "zap-full-scan.py -t {{ website_url }} -r {{ scan_name }}_report.html
    - name: getting raw output of the scan
      command: "docker logs -f {{ scan_name }}"
      register: scan_output
    - debug:
        msg: "{{ scan_output }}"

Stefan Hornburg (Racke)

unread,
May 3, 2021, 10:36:34 AM5/3/21
to ansible...@googlegroups.com
On 5/3/21 3:59 PM, rebecca acheampong wrote:
> I am performing a zap-full-scan on DVWS as the target on kali. I get this error below:
> Your help is appreciated.

The container is set to auto-removed, so it might be not present when you
run "docker logs".

I think your approach is fragile, what guarantees you that the scan is done when you call
"docker logs" ?

Regards
Racke
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/0d9fe261-9164-49b6-9935-31eb5eb859f9n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/0d9fe261-9164-49b6-9935-31eb5eb859f9n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

OpenPGP_signature

rebecca acheampong

unread,
May 3, 2021, 11:03:50 AM5/3/21
to Ansible Project

Okay Racke, Thank you so in that case how can I find my scan report. I am sorry to ask you this silly question. I am new to all these platforms. I went to the location but there is no report generated. Thank you.
Reply all
Reply to author
Forward
0 new messages