Your changes about the firewall need to be based on the firewall configuration after the system initialized.
Therefore, you can copy the firewall configuration from the router to the Imagebuilder to make a default configuration.