GoSecure / malboxes

Builds malware analysis Windows VMs so that you don't have to.
GNU General Public License v3.0
1.03k stars 134 forks source link

Change cpu, memory and other from the config file with vboxmanage options in the packer templates #18

Open Svieg opened 7 years ago

Svieg commented 7 years ago

A quick look-up told me that we could add vboxmanage options in the profiles so the user could easily modify those options in config.js

Svieg commented 7 years ago

That would only require to template the builder_virtualbox_windows.json snippet as I can tell

obilodeau commented 7 years ago

Yes, we could iterate on a dict adding modifyvm lines in this list:

                "vboxmanage": [
                        ["modifyvm", "{{ '{{.Name}}' }}", "--memory", "4096"],
                        ["modifyvm", "{{ '{{.Name}}' }}", "--cpus", "1"]
                ],

Something like:

                "vboxmanage": [
                        ["modifyvm", "{{ '{{.Name}}' }}", "--memory", "4096"],
                        ["modifyvm", "{{ '{{.Name}}' }}", "--cpus", "1"],
                        {% for key, value in my_dict.iteritems() %}
                        ["modifyvm", "{{ '{{.Name}}' }}", "--{{ key }}", "{{ value }}"],
                        {% endfor %}
                ],

But we need to be careful with the dangling comma. Maybe put CPU last and without a terminating comma.

Anyway, I would :+1: such a change.

Svieg commented 7 years ago

Cool, I'll check that.