Duh.
Certainly they used this personal scandal to sack and discredit Petraeus immediately after he election because they knew they had edited his talking points.
A friend with some knowledge of security matters says he is 100% certain they knew of the Petraeus affair before he became CIA Director.
Of course they knew. I’d go further to say that Obama had to personally overrule an objection like that to give him the clearance.