Skip to content

Commit

Permalink
Merge pull request #18 from CoffeeITWorks/develop
Browse files Browse the repository at this point in the history
close #15
  • Loading branch information
pablodav authored Apr 8, 2019
2 parents 0cd4496 + 5d2c4b7 commit c70f087
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.8.0:

* upgrade to 0.6.6 see #15 https://github.com/CoffeeITWorks/ansible_burpui_server/issues/15
* change molecule tests to Debian:9 due to some errors with apt sources for Ubuntu

1.7.0:

* keep burpui-agent to 0.6.1 as: can't migrate to 0.6.5 until upgrade burp to 2.2.12+
Expand Down
11 changes: 6 additions & 5 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# file defaults/main.yml

burpui_pip_burpui_dev: "git+https://git.ziirish.me/ziirish/burp-ui.git#egg=burp-ui"
burpui_version_dev: master
# use syntax: https://pip.pypa.io/en/stable/reference/pip_install/#git
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@stable#egg=burp-ui'
burpui_use_dev: False

burpui_pip_burpui: "burp-ui"
burpui_version: 0.6.1 # can't migrate to 0.6.5 until upgrade burp to 2.2.12+
burpui_version: 0.6.6
python_pip_executable: "pip3" # options pip3 / pip2

burpui_pip_packages:
Expand All @@ -19,6 +19,7 @@ burpui_pip_packages:
- { name: "{{ burpui_pip_burpui }}[websocket]", version: "{{ burpui_version }}" }

burpui_pip_present:
- "cryptography"
- "redis"
- "Flask-Session"
- "Flask-Migrate"
Expand Down Expand Up @@ -82,8 +83,8 @@ burpui_experimental_zip64: "false"
#http://burp-ui.readthedocs.io/en/latest/advanced_usage.html#options
burpui_backend_bhost: '::1'
burpui_backend_bport: '4972' # you can use also {{ burp_server_status_port }}
burpui_backend_burpbin: "/usr/sbin/burp"
burpui_backend_stripbin: "/usr/bin/vss_strip"
burpui_backend_burpbin: "/usr/local/sbin/burp"
burpui_backend_stripbin: "/usr/local/bin/vss_strip"
burpui_backend_bconfcli: "/etc/burp/burp.conf"
burpui_backend_bconfsrv: "/etc/burp/burp-server.conf"
burpui_backend_tmpdir: "/tmp"
Expand Down
8 changes: 8 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
supervisorctl:
name: bui-celery
state: restarted
when: not bui_use_systemd

- name: restart bui-celery systemd
service:
name: bui-celery
state: restarted
when: bui_use_systemd

- name: wait burpui
wait_for:
timeout: 60
delay: 2
port: "{{ burpui_global_port }}"

3 changes: 1 addition & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ lint:
name: yamllint
platforms:
- name: ansible_test-01
image: solita/ubuntu-systemd:16.04
image: paulfantom/debian-molecule:9
privileged: True
command: /sbin/init
capabilities:
- SYS_ADMIN
volumes:
Expand Down
5 changes: 4 additions & 1 deletion molecule/default/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
hosts: all
vars:
burpui_standalone: True
burpui_use_dev: False
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@stable#egg=burp-ui'
burpui_use_dev: True
roles:
- role: ansible_burp2_server
- role: ansible_burpui_server
tags:
- burpui-server
4 changes: 3 additions & 1 deletion tasks/bui-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
# state: 0.4.2

- name: Upgrade database schema
shell: bui-manage -c /etc/burp/burpui.cfg db upgrade
shell: LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 bui-manage -c /etc/burp/burpui.cfg db upgrade
ignore_errors: yes
changed_when: False

# TODO: Change user to burpui
# TODO: check other way to run it without breaking ansible task
Expand Down
11 changes: 9 additions & 2 deletions tasks/python3_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@

- name: pip3 | install pip packages
pip:
name: "{{ item }}"
name: '{{ burpui_pip_present }}'
state: present
executable: "{{ python3_pip }}"
with_items: "{{ burpui_pip_present }}"

- name: pip3 | Install pip packages by version
pip:
Expand All @@ -23,4 +22,12 @@
executable: "{{ python3_pip }}"
with_items: "{{ burpui_pip_packages }}"
register: bui_pip_install
when: not burpui_use_dev
notify: restart burpui services

- name: pip3 | Install pip packages by tar.gz
shell: "{{ python3_pip }} install -e {{ burpui_pip_burpui_dev }}"
register: bui_pip_install
when: burpui_use_dev
notify: restart burpui services

13 changes: 12 additions & 1 deletion tasks/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
package:
name: "{{ burpui_system_requirements | join(',') }}"
state: present
when: python_pip_executable != "pip3"
when: python_pip_executable == "pip2"

- name: install requirements for ansible pip
package:
name: ['python-setuptools']
state: present

- name: install burpui package requirements for python3
package:
Expand All @@ -30,6 +35,12 @@
path: "/usr/local/sbin/burp"
register: burp_local_sbin_path

- name: uninstall burpui package requirements for python3
package:
name: "{{ burpui_system_absent }}"
state: absent
when: python_pip_executable == "pip3"

- name: change burp path var burpui_backend_burpbin
set_fact:
burpui_backend_burpbin: /usr/local/sbin/burp
Expand Down
4 changes: 0 additions & 4 deletions tasks/requirements_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@
with_items:
- git

- name: set dev packages for pip install burpui
set_fact:
burpui_pip_burpui: "{{ burpui_pip_burpui_dev }}"
burpui_version: "{{ burpui_version_dev }}"
1 change: 1 addition & 0 deletions tasks/systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
with_items:
- { src: "systemd/bui-celery.service.j2",
dest: "/etc/systemd/system/bui-celery.service" }
notify: restart bui-celery systemd
# notify:
# - systemd daemon-reload

Expand Down
4 changes: 2 additions & 2 deletions templates/burpui.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ version = {{ burpui_global_version }}
# If set to 'false', you will need to declare at least one 'Agent' section (see
# bellow)
{% if burpui_standalone %}
standalone = true
single = true
{% else %}
standalone = false
single = false
{% endif %}
# authentication plugin (mandatory)
# list the misc/auth directory to see the available backends
Expand Down
2 changes: 2 additions & 0 deletions templates/systemd/bui-celery.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ExecStart={{ burpui_sv_command }}
User={{ burpui_user }}
Group={{ burpui_group }}
Environment={{ burpui_sv_environment }}
Environment=LC_ALL=en_US.UTF-8
Environment=LANG=en_US.UTF-8
RestartSec=1
Restart=on-failure

Expand Down
7 changes: 6 additions & 1 deletion vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
#::::::::::::::
---

burpui_system_absent:
- python3-cryptography

burpui_system_requirements:
- python-pip
- python-setuptools
- python-dev
- libssl-dev # dependecy of ndg-httpsclient
- libffi-dev # dependency for cffi
Expand All @@ -14,10 +18,11 @@ burpui_system_requirements:
burpui_py3_packages:
- python3
- python3-dev
- python3-setuptools
- python3-pip
- libssl-dev # dependecy of ndg-httpsclient
- libffi-dev # dependency for cffi
- locales # required for python3
- locales-all # required for python3
- gcc

burpui_packages:
Expand Down
6 changes: 5 additions & 1 deletion vars/Fedora.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#::::::::::::::
# Ubuntu.yml
# Fedora.yml
#::::::::::::::
---

burpui_system_absent:
- python3-cryptography

burpui_system_requirements:
- python-pip
- python-setuptools
- python-devel
- openssl-devel # dependecy of ndg-httpsclient
- libffi-devel # dependency for cffi
Expand Down
6 changes: 5 additions & 1 deletion vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#::::::::::::::
# Ubuntu.yml
# RedHat.yml
#::::::::::::::
---

burpui_system_absent:
- python36-cryptography

burpui_system_requirements:
- python-pip
- python-devel
- python-setuptools
- openssl-devel # dependecy of ndg-httpsclient
- libffi-devel # dependency for cffi
- redhat-rpm-config
Expand Down
7 changes: 6 additions & 1 deletion vars/Ubuntu-14.04.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
#::::::::::::::
# Ubuntu.yml
# Ubuntu-14.04.yml
#::::::::::::::
---

burpui_system_absent:
- python3-cryptography

burpui_system_requirements:
- python-pip
- python-dev
- python-setuptools
- libssl-dev # dependecy of ndg-httpsclient
- libffi-dev # dependency for cffi
- locales # required for python3

burpui_py3_packages:
- python3
- python3-dev
- python3-setuptools
- python3-pip
- libssl-dev # dependecy of ndg-httpsclient
- libffi-dev # dependency for cffi
Expand Down

0 comments on commit c70f087

Please sign in to comment.