kali-autosetup/roles/cyberchef/tasks/main.yml

60 lines
1.2 KiB
YAML
Raw Normal View History

2022-07-29 00:01:23 +02:00
- name: Install required packages
apt:
pkg:
- firejail
- npm
update_cache: yes
- name: Create cyberchef user
user:
name: cyberchef
system: yes
- name: Install grunt-cli
become_user: cyberchef
command: npm install -g grunt-cli
- name: Clone CyberChef repo
git:
repo: https://github.com/gchq/CyberChef.git
dest: "{{ cyberchef_root_dir }}"
clone: yes
update: yes
2022-07-29 00:45:13 +02:00
- name: Patch Gruntfile.js
lineinfile:
path: "{{ cyberchef_root_dir }}Gruntfile.js"
regexp: "fixCryptoApiImports"
line: "fixCryptoApiImports: { options: { shell: "/bin/bash" },"
2022-07-29 00:01:23 +02:00
- name: Set permissions on repo
become: yes
file:
path: "{{ cyberchef_root_dir }}"
owner: cyberchef
recurse: yes
- name: Install CyberChef
become_user: cyberchef
2022-07-29 00:45:13 +02:00
command:
cmd: "npm install"
chdir: "{{ cyberchef_root_dir }}"
- name: Perform npm audit and fix
become_user: cyberchef
command:
cmd: "npm audit fix"
chdir: "{{ cyberchef_root_dir }}"
2022-07-29 00:01:23 +02:00
- name: Set systemd service
become: yes
template:
src: cyberchef.service.j2
dest: /etc/systemd/system/cyberchef.service
- name: Enable & start cyberchef
service:
name: cyberchef
state: restarted
enabled: yes
daemon_reload: yes