-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathd4-server.json
More file actions
145 lines (139 loc) · 5.94 KB
/
Copy pathd4-server.json
File metadata and controls
145 lines (139 loc) · 5.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{
"_comment": "D4 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>",
"cpus": "1",
"desktop": "false",
"disk_size": "8000",
"headless": "true",
"hostname": "d4-server",
"http_proxy": "{{env `http_proxy`}}",
"https_proxy": "{{env `https_proxy`}}",
"iso_checksum": "57c3a25f2c5fd61596ce39afbff44dd49b0089a2",
"iso_checksum_type": "sha1",
"iso_name": "ubuntu-18.04.2-server-amd64.iso",
"iso_path": "iso",
"iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-18.04.2-server-amd64.iso",
"memory": "2048",
"no_proxy": "{{env `no_proxy`}}",
"ovftool_path": "ovftool",
"preseed":"preseed.cfg",
"ssh_fullname": "d4",
"ssh_name": "d4",
"ssh_pass": "Password1234",
"update": "true",
"vm_description": "D4, a large-scale distributed sensor network to monitor DDoS and other malicious activities relying on an open and collaborative project.",
"vm_name": "D4_DEMO",
"vm_version": "1.0"
},
"builders": [{
"disk_size": "{{user `disk_size`}}",
"format": "ova",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "Ubuntu_64",
"hard_drive_interface": "sata",
"headless": "{{user `headless`}}",
"http_directory" : "preseeds",
"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` }}"
],
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
"ssh_username": "{{user `ssh_name`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_wait_timeout": "20m",
"ssh_pty" : "true",
"type": "virtualbox-iso",
"vm_name": "{{user `vm_name`}}",
"export_opts":
[
"--manifest",
"--vsys", "0",
"--eulafile", "/tmp/LICENSE-D4",
"--description", "{{user `vm_description`}}",
"--version", "{{user `vm_version`}}"
],
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}"],
["modifyvm", "{{.Name}}", "--natpf1", "d4-server-ssh,tcp,127.0.0.1,2222,,22" ],
["modifyvm", "{{.Name}}", "--natpf1", "d4-server-http,tcp,127.0.0.1,7000,,7000" ],
["modifyvm", "{{.Name}}", "--natpf1", "d4-server-tcp,tcp,127.0.0.1,4443,,4443" ],
["modifyvm", "{{.Name}}", "--natpf1", "pdns-server-http,tcp,127.0.0.1,8400,,8400" ],
["modifyvm", "{{.Name}}", "--audio", "none"],
["modifyvm", "{{.Name}}", "--usb", "off"],
["modifyvm", "{{.Name}}", "--vrde", "off"],
["modifyvm", "{{.Name}}", "--cpus", "{{user `cpus`}}"],
["modifyvm", "{{.Name}}", "--vram", "32"]
],
"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>"
]
}],
"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": "file",
"source": "conf/redis.conf",
"destination": "/tmp/redis.conf"
},
{
"type": "shell",
"execute_command" : "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/users.sh"
},
{
"type": "shell",
"execute_command" : "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/interfaces.sh"
},
{
"type": "shell",
"execute_command" : "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -u d4 -E -S bash '{{ .Path }}'",
"script": "scripts/bootstrap.sh",
"pause_before": "10s"
},
{
"type": "shell",
"execute_command" : "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "scripts/clean.sh",
"expect_disconnect": "true",
"pause_before": "30s"
}
],
"post-processors":[{
"keep_input_artifact": "false",
"keep_input_artifact": false,
"type": "checksum",
"checksum_types": ["sha1", "sha256", "sha384", "sha512"]
}]
}