Five out of six
The Forward's J.J. Goldberg runs it down (h/t Lablueyz) :
Here is a rough roll call: Of the six living ex-IDF chiefs, all but Yaalon favor a Palestinian state with borders based, either now or eventually, on the 1967 lines. Of six living ex-Shin Bet chiefs, all say likewise except Yuval Diskin, who retired this summer and hasn’t yet spoken publicly. Of seven living ex-Mossad chiefs, the three oldest haven’t spoken out lately; all the others publicly support the positions described.
Think about it. These are the people who have overseen Israel’s defense for more than a generation. The military chiefs believe, almost unanimously, that Israel could be secure living alongside a Palestinian state with adjusted 1967 borders. The intelligence chiefs believe almost unanimously that the Palestinians would settle for what Israel can safely give. They all believe Israel would be safer that way. Put differently, that the current alternative makes Israel less safe.
Does their military background entitle them to dictate policy? No one suggests that. Most say they’d rather not be speaking out at all, given the rules of democracy. But they think things are going badly, and it needn’t be that way, and they think the public is entitled to know.
If one or two of them argued against the government’s policies like this, you’d call them eccentric. If a rump group rebelled, you might call it a surprising debate. But this is almost unanimous. That raises a different question: Why are the politicians endangering their people?