in cloud - it all new. people are still figuring out how to deploy their software so that it works both for users and developers. That's why on average onprem is more secure than cloud.
I feel like the hacks I hear about are pretty evenly distributed between cloud and on prem type setups... and most of the big ransomware attacks are almost exclusive to on prem.
Also firewalls/DMZ/IDS has nothing to do with a SaaS offering from GitHub. That on prem setup you mentioned would be practiced by GitHub.
My opinion of general on-prem security is that it's often haphazard and updates are almost never applied.
But also a lot of on prem security practices hamper developers and users. Because they rely on decades old outdated ways of working.
Also your comment makes no sense as this is likely to be a hack through stolen credentials.
It is a new and ever changing field, there are many cloud vendors and their product line and configurations change all the time - meaning it will take a lot of time until majority of IT specialists become familiar with configuring secure cloud and majority of users of those cloud services will not make security mistakes.