Use the security groups options in the portable TemplateOptions (1.8.x)

1.8.x version of #481 (and #439)