google / cloud-forensics-utils

Python library to carry out DFIR analysis on the Cloud
Apache License 2.0
453 stars 89 forks source link

Make setting UserData in GetOrCreateAnalyssiVM() configurable #315

Closed hiddenillusion closed 3 years ago

hiddenillusion commented 3 years ago

GetOrCreateAnalysisVM() in the AWS ec2.py lib is currently hard coded to install the contents of startup_script.

It would be more flexible if this was determined via an argument since we may not want to install any supplemental packages (right now you can only remove the contents of scripts/startup.sh to satisfy this)

ramo-j commented 3 years ago

There is currently an alternate method to specify a userdata script that is provided, via an env var. From the code comments on utils.ReadStartupScript:

Users can either write their own script to install custom packages,
or use one of the provided ones. To use your own script, export a
STARTUP_SCRIPT environment variable with the absolute path to it:
"user@terminal:~$ export STARTUP_SCRIPT='absolute/path/script.sh'"

That said, I agree that being able to pass in an argument makes more sense, but the above might suit you in the meantime.