But that is only the first phase. The second phase is to use peer review of the code, keep a healthy amount of paranoia and constantly train developers on security issues. And to use external penetration testing, companies regularly and expose the system to different people different technology stacks to try to break security and then build it back stronger.
Security is a never-ending task, and it requires a significant amount of ongoing investment that can only be put into a system that many people use. This is why a commercial cloud-based system has a much better chance of getting adequately funded to pay for ongoing security.