Compare commits

...

5 Commits

8 changed files with 114 additions and 149 deletions

29
.github/bug_report.md vendored Normal file
View File

@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots & Logs**
If applicable, please add screenshots and/or logs to help explain your problem.
**Desktop (please complete the following information):**
- OS+Distribution Version: [e.g. Ubuntu 16.04, FreeBSD 10]
- Browser (if relevant) [e.g. chrome, safari]
- Munin Version [e.g. 2.0.35]
**Additional context**
Add any other context about the problem here.

17
.github/feature_request.md vendored Normal file
View File

@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

0
http/meta-data Normal file
View File

31
http/user-data Normal file
View File

@ -0,0 +1,31 @@
#cloud-config
autoinstall:
version: 1
apt:
geoip: true
preserve_sources_list: true
identity:
hostname: misp-vm
username: 'misp'
password: '$6$Zw5jtOmRPBqrzFT7$st/15FZrcYhlt7bgv70ILUsPfzEuFumiZF.CdXJ9VdVXXLHI4WIjJ6MS/5g3410L1ogCO5O7B7ro.XEFZ2P0o0'
keyboard:
layout: us
variant: ''
locale: en_US
network:
network:
version: 2
ethernets:
ens33:
dhcp4: true
dhcp-identifier: mac
ssh:
allow-pw: true
authorized-keys: []
install-server: true
storage:
layout:
name: lvm
late-commands:
- sed -i 's/^#*\(send dhcp-client-identifier\).*$/\1 = hardware;/' /target/etc/dhcp/dhclient.conf
- 'sed -i "s/dhcp4: true/&\n dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'

View File

@ -4,36 +4,23 @@
{
"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` }} ",
"debconf/frontend=noninteractive ",
"-- <enter>"
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
"<enter>"
],
"disk_size": "{{user `disk_size`}}",
"disk_size": "{{ user `disk_size` }}",
"export_opts": [
"--manifest",
"--vsys", "0",
"--eulafile", "/tmp/LICENSE-misp",
"--description", "{{user `vm_description`}}",
"--version", "{{user `vm_version`}}"
"--description", "{{ user `vm_description` }}",
"--version", "{{ user `vm_version` }}"
],
"format": "ova",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "Ubuntu_64",
"hard_drive_interface": "sata",
"headless": "{{user `headless`}}",
"http_directory": "preseeds",
"headless": "{{ user `headless` }}",
"http_directory": "http",
"http_port_max": 9011,
"http_port_min": 9001,
"iso_checksum": "{{ user `iso_checksum` }}",
@ -42,11 +29,11 @@
"{{ user `iso_path` }}/{{ user `iso_name` }}",
"{{ user `iso_url` }}"
],
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
"ssh_password": "{{user `ssh_pass`}}",
"shutdown_command": "echo {{ user `ssh_pass` }} | sudo -S shutdown -P now",
"ssh_password": "{{ user `ssh_pass` }}",
"ssh_pty": "true",
"ssh_timeout": "20m",
"ssh_username": "{{user `ssh_name`}}",
"ssh_username": "{{ user `ssh_user` }}",
"type": "virtualbox-iso",
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}" ],
@ -68,37 +55,33 @@
},
{
"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>"
"{{ user `boot_command_prefix` }}",
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
"<enter>"
],
"disk_size": "{{user `disk_size`}}",
"boot_wait": "5s",
"disk_size": "{{ user `disk_size` }}",
"guest_os_type": "ubuntu-64",
"headless": "{{user `headless`}}",
"http_directory": "preseeds",
"http_port_max": 9011,
"headless": "{{ user `headless` }}",
"http_directory": "http",
"http_port_min": 9001,
"http_port_max": 9011,
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "{{ user `iso_checksum_type` }}",
"iso_urls": [
"{{ user `iso_path` }}/{{ user `iso_name` }}",
"{{ user `iso_url` }}"
],
"memory": "{{user `memory`}}",
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
"skip_compaction": false,
"ssh_password": "{{user `ssh_pass`}}",
"memory": "{{ user `memory` }}",
"shutdown_command": "echo {{user `ssh_pass`}} |sudo -S shutdown -P now",
"skip_compaction": false,
"ssh_pty": "true",
"ssh_timeout": "20m",
"ssh_username": "{{user `ssh_name`}}",
"ssh_timeout": "30m",
"ssh_handshake_attempts": "90",
"ssh_username": "{{user `ssh_user`}}",
"ssh_password": "{{user `ssh_pass`}}",
"type": "vmware-iso",
"vm_name": "{{user `vm_name`}}"
"vm_name": "{{ user `vm_name` }}"
}
],
"provisioners": [
@ -118,12 +101,12 @@
},
{
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/users.sh",
"script": "scripts/extend.sh",
"type": "shell"
},
{
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/interfaces.sh",
"script": "scripts/users.sh",
"type": "shell"
},
{
@ -136,7 +119,7 @@
"PACKER=1",
"DEBIAN_FRONTEND=noninteractive"
],
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -u {{user `ssh_name`}} -E -S bash '{{ .Path }}'",
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -u {{user `ssh_user`}} -E -S bash '{{ .Path }}'",
"inline": [
"chmod u+x /tmp/INSTALL.sh",
"/tmp/INSTALL.sh -A -u"
@ -164,7 +147,7 @@
}
],
"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>",
"boot_command_prefix": "<enter><enter><f6><esc><wait> ",
"cpus": "1",
"desktop": "false",
"disk_size": "25000",
@ -180,9 +163,8 @@
"memory": "3072",
"no_proxy": "{{env `no_proxy`}}",
"ovftool_path": "ovftool",
"preseed": "preseed.cfg",
"ssh_fullname": "misp",
"ssh_name": "misp",
"ssh_fullname": "MISP User",
"ssh_user": "misp",
"ssh_pass": "Password1234",
"update": "true",
"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.",
@ -190,4 +172,3 @@
"vm_version": "2.4"
}
}

View File

@ -1,72 +0,0 @@
### Base system install
d-i base-installer/kernel/override-image string linux-server
# Account setup
d-i passwd/user-fullname string misp
d-i passwd/username string misp
d-i passwd/user-password password Password1234
d-i passwd/user-password-again password Password1234
d-i user-setup/encrypt-home boolean false
d-i user-setup/allow-password-weak boolean true
# English
d-i debian-installer/language string en
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/preferred-locale string en_US.UTF-8
d-i localechooser/supported-locales en_US.UTF-8
# Including keyboards
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layout select USA
d-i keyboard-configuration/variant select USA
d-i keyboard-configuration/modelcode string pc105
# get host/domain from user env
d-i netcfg/get_hostname string this-host
d-i netcfg/get_domain string this-host
# set TZ
d-i time/zone string UTC
d-i time/zone string Europe/Luxembourg
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
# Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
d-i debconf debconf/frontend select Noninteractive
# Package selection
tasksel tasksel/first multiselect standard
d-i pkgsel/update-policy select none
d-i pkgsel/include string openssh-server
d-i pkgsel/install-language-support boolean false
# No language support packages.
d-i pkgsel/install-language-support boolean false
# Stuck between a rock and a HDD place
d-i partman-auto/method string lvm
d-i partman-lvm/confirm boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
# Write the changes to disks and configure LVM?
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max
# No proxy, plx
d-i mirror/http/proxy string
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade select safe-upgrade
# grub
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note

5
scripts/extend.sh Normal file
View File

@ -0,0 +1,5 @@
#! /usr/bin/env bash
echo "--- Extending disks "
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

View File

@ -1,26 +0,0 @@
#! /usr/bin/env bash
## This file is AUTOGENERATED.
## /!\ Do NOT Change the contents of the file.
## To generate it you need a copy of the main MISP repo.
## As a quick reference, you cat generate with xsnippet:
# $ xsnippet /tmp/ $PATH_TO_MISP/docs/generic/ethX.md
# $ cp /tmp/interfaces.sh .
echo "--- Using old style name (ethX) for interfaces"
sed -r 's/^(GRUB_CMDLINE_LINUX=).*/\1\"net\.ifnames=0\ biosdevname=0\"/' /etc/default/grub | sudo tee /etc/default/grub > /dev/null
# install ifupdown since ubuntu 18.04
sudo apt update
sudo apt install ifupdown -qqy
# enable eth0
echo "--- Configuring eth0"
cat >> /etc/network/interfaces << EOF
# The primary network interface
auto eth0
iface eth0 inet dhcp
EOF
update-grub > /dev/null 2>&1