misp-packer/misp.json

178 lines
7.1 KiB
JSON

{
"_comment": "MISP VM Autogen packer build system",
"variables": {
"boot_command_prefix": "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"preseed":"preseed.cfg",
"ssh_fullname": "misp",
"ssh_name": "misp",
"ssh_pass": "Password1234",
"iso_checksum": "87bedd68607f059ca973f86346bbdf1caa6e1077",
"iso_checksum_type": "sha1",
"iso_name": "ubuntu-18.04.1-server-amd64.iso",
"iso_path": "iso",
"iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-18.04.1-server-amd64.iso",
"desktop": "false",
"update": "true",
"headless": "true",
"no_proxy": "{{env `no_proxy`}}",
"http_proxy": "{{env `http_proxy`}}",
"https_proxy": "{{env `https_proxy`}}",
"hostname": "misp",
"vm_version": "2.4",
"vm_description": "MISP, is an open source software solution for collecting, storing, distributing and sharing cyber security indicators and threat about cyber security incidents analysis and malware analysis. MISP is designed by and for incident analysts, security and ICT professionals or malware reverser to support their day-to-day operations to share structured informations efficiently.",
"vm_name": "MISP_demo",
"disk_size": "25000",
"memory": "2048",
"cpus": "1"
},
"builders": [{
"type": "virtualbox-iso",
"headless": "{{user `headless`}}",
"guest_os_type": "Ubuntu_64",
"format": "ova",
"vm_name": "{{user `vm_name`}}",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"export_opts":
[
"--manifest",
"--vsys", "0",
"--eulafile", "/tmp/LICENSE-misp",
"--description", "{{user `vm_description`}}",
"--version", "{{user `vm_version`}}"
],
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}"],
["modifyvm", "{{.Name}}", "--natpf1", "ssh,tcp,,2222,0.0.0.0,22" ],
["modifyvm", "{{.Name}}", "--natpf1", "http,tcp,,8080,,80" ],
["modifyvm", "{{.Name}}", "--natpf1", "https,tcp,,8443,,443" ],
["modifyvm", "{{.Name}}", "--natpf1", "dashboard,tcp,,8001,0.0.0.0,8001" ],
["modifyvm", "{{.Name}}", "--natpf1", "viper,tcp,,8888,0.0.0.0,8888" ],
["modifyvm", "{{.Name}}", "--natpf1", "jupyter-notebook,tcp,,8889,0.0.0.0,8889" ],
["modifyvm", "{{.Name}}", "--natpf1", "misp-modules,tcp,,1666,0.0.0.0,6666" ],
["modifyvm", "{{.Name}}", "--audio", "none"],
["modifyvm", "{{.Name}}", "--usb", "off"],
["modifyvm", "{{.Name}}", "--vrde", "off"],
["modifyvm", "{{.Name}}", "--cpus", "{{user `cpus`}}"],
["modifyvm", "{{.Name}}", "--vram", "32"]
],
"disk_size": "{{user `disk_size`}}",
"hard_drive_interface": "sata",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "{{ user `iso_checksum_type` }}",
"iso_urls": [
"{{ user `iso_path` }}/{{ user `iso_name` }}",
"{{ user `iso_url` }}"
],
"http_directory" : "preseeds",
"http_port_min" : 9001,
"http_port_max" : 9011,
"ssh_username": "{{user `ssh_name`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_wait_timeout": "20m",
"ssh_pty" : "true",
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
"boot_command": [
"{{ user `boot_command_prefix` }}",
"/install/vmlinuz noapic ",
"initrd=/install/initrd.gz ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{ user `hostname` }} ",
"grub-installer/bootdev=/dev/sda<wait> ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"passwd/user-fullname={{ user `ssh_fullname` }} ",
"passwd/user-password={{ user `ssh_password` }} ",
"passwd/user-password-again={{ user `ssh_password` }} ",
"passwd/username={{ user `ssh_username` }} ",
"-- <enter>"
]
},
{
"type": "vmware-iso",
"headless": "{{user `headless`}}",
"guest_os_type": "ubuntu-64",
"vm_name": "{{user `vm_name`}}",
"disk_size": "{{user `disk_size`}}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "{{ user `iso_checksum_type` }}",
"iso_urls": [
"{{ user `iso_path` }}/{{ user `iso_name` }}",
"{{ user `iso_url` }}"
],
"http_directory" : "preseeds",
"http_port_min" : 9001,
"http_port_max" : 9011,
"ssh_username": "{{user `ssh_name`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_wait_timeout": "20m",
"ssh_pty" : "true",
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
"vmx_data": {
"memsize": "{{user `memory`}}"
},
"boot_command" : [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{user `hostname`}} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
],
"skip_compaction": false
}
],
"provisioners": [{
"environment_vars": [
"DESKTOP={{user `desktop`}}",
"UPDATE={{user `update`}}",
"http_proxy={{user `http_proxy`}}",
"https_proxy={{user `https_proxy`}}",
"no_proxy={{user `no_proxy`}}"
],
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"inline": [
"echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
]
},
{
"type": "shell",
"execute_command" : "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/bootstrap.sh",
"pause_before": "10s"
}],
"post-processors":[{
"keep_input_artifact": "false",
"keep_input_artifact": false,
"type": "checksum",
"checksum_types": ["sha1", "sha256", "sha384", "sha512"]
}]
}