Petraeus is currently serving two years of probation after he gave classified information to a woman with whom he was having an affair. Among the conditions of his probation, Petraeus “shall not leave the Western District of North Carolina without the permission of the Court or probation officer.” He’s not even allowed to travel for work unless he gets the approval of the U.S. Probation Office. While there is a special condition regarding travel for employment that allows Petraeus to go outside the District and even travel internationally, he still needs approval from a probation officer to do it.
On top of that, Petraeus also has to notify his probation officer of any new employment or residence within 72 hours.
So while Petraeus is technically allowed to become Secretary of State, he would have to jump through some hoops in order to serve in the position. That is, of course, if the Senate agreed to confirm him.