To be honest Elastix suffered from a lot of security issues in vtiger and other modules.
Your PBX should never be exposed to the Internet and integrating many tools will always result in a security nightmare. At some point this modules will need to moved to containers and be as isolated as possible.