who is to know

What does 'who is to know ’ mean? Is it some sort of idiom?

“Who is to know?” is asking who will know/understand/discover something, usually with the suggestion that probably no one will – i.e. there is no way of discovering that information.

Is it a synonym to “Who knows?”?

Not quite. “Who is to know?” has more of a future sense or hypothetical sense. It means that no one will be able to find out, and it’s quite often used with the implication that someone’s misdeeds will therefore escape detection. For example: “Why don’t we just delete all the files? Who’s to know?” (here you couldn’t use “Who knows?”).

“Who knows” often means something like “I don’t know, and probably other people don’t know, and I don’t know how we could easily find out”:
A: “Why did he say that?”
B: “Who knows…”
In this case “Who is to know?” would seem odd.