Skip to content

Commit

Permalink
Merge pull request #73 from pix/provisioners
Browse files Browse the repository at this point in the history
Added support for defining custom provisioners in profile
  • Loading branch information
Svieg authored Sep 6, 2017
2 parents 8a12d34 + 52b5150 commit 10611c6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 9 deletions.
5 changes: 5 additions & 0 deletions malboxes/malboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,11 @@ def prepare_profile(template, config):
for package_mod in profile["package"]:
package(profile_name, package_mod["package"], fd)

if "packer" in profile:
packer = profile["packer"]
if "provisioners" in packer:
config["packer_extra_provisioners"] = packer["provisioners"]

fd.close()
return config

Expand Down
11 changes: 10 additions & 1 deletion malboxes/profile-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@
{"modtype": "delete", "key": "HKLM:\\SYSTEM\\ControlSet001\\Services", "name": "VBoxService"},
{"modtype": "delete", "key": "HKLM:\\SYSTEM\\ControlSet001\\Services", "name": "VBoxSF"},
{"modtype": "delete", "key": "HKLM:\\SYSTEM\\ControlSet001\\Services", "name": "VBoxVideo"},
{"modtype": "add", "key": "HKLM:\\HARDWARE\\DEVICEMAP\\Scsi\\Scsi Port 0\\Scsi Bus 0\\Target Id 0\\Logical Unit Id 0", "value": "Malboxes", "name": "Identifier", "valuetype": "String"}]
{"modtype": "add", "key": "HKLM:\\HARDWARE\\DEVICEMAP\\Scsi\\Scsi Port 0\\Scsi Bus 0\\Target Id 0\\Logical Unit Id 0", "value": "Malboxes", "name": "Identifier", "valuetype": "String"}],
"packer": {
"_comment": "See https://www.packer.io/docs/templates/provisioners.html for syntax"
"provisioners": [
{
"type": "powershell",
"inline": ["dir c:\\"]
}
]
}
}
6 changes: 5 additions & 1 deletion malboxes/templates/win10_32_analyst.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
{% if ida_path %},
{% include 'snippets/ida_remote_32.json' %}
{% endif %}

{% if packer_extra_provisioners %}
{% for p in packer_extra_provisioners %}
,{{ p | tojson }}
{% endfor %}
{% endif %}
]
}
6 changes: 5 additions & 1 deletion malboxes/templates/win10_64_analyst.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
{% include 'snippets/ida_remote_64.json' %},
{% include 'snippets/ida_remote_32.json' %}
{% endif %}

{% if packer_extra_provisioners %}
{% for p in packer_extra_provisioners %}
,{{ p | tojson }}
{% endfor %}
{% endif %}
]
}
6 changes: 5 additions & 1 deletion malboxes/templates/win7_32_analyst.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
{% if ida_path %},
{% include 'snippets/ida_remote_32.json' %}
{% endif %}

{% if packer_extra_provisioners %}
{% for p in packer_extra_provisioners %}
,{{ p | tojson }}
{% endfor %}
{% endif %}
]
}
14 changes: 9 additions & 5 deletions malboxes/templates/win7_64_analyst.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@
{% if tools_path %},
{% include 'snippets/tools.json' %}
{% endif %}
{% if ida_path %},
{% include 'snippets/ida_remote_64.json' %},
{% include 'snippets/ida_remote_32.json' %}
{% endif %}

{% if ida_path %},
{% include 'snippets/ida_remote_64.json' %},
{% include 'snippets/ida_remote_32.json' %}
{% endif %}
{% if packer_extra_provisioners %}
{% for p in packer_extra_provisioners %}
,{{ p | tojson }}
{% endfor %}
{% endif %}
]
}

0 comments on commit 10611c6

Please sign in to comment.