

The heavy security apparatus isn’t a feature of socialism in and of itself, but a reflection of the fact that every Actually Existing Socialist state (and for that matter every state that tries to act in its own interest over that of Wall Street) exists under siege from the capitalist world.
Consider how the USSR was under constant attack from the West: the major powers invading soon after the Revolution > Nazi Germany > the Cold War (not to mention what the US has done to Vietnam and the DPRK).
Consider the brutal sanctions the US maintains.
Consider especially the many coups and color revolutions that the US in directly and indirectly responsible for - replacing independence minded governments with brutal dictators more amenable to US interests (Mosadeggh in Iran, Sukarno in Indonesia and Allende in Chile are some examples off the top of my head).
The reason every socialist state is ‘authoritarian’ is because the ones that weren’t were swiftly destroyed. In other words, the ‘heavy surveillance and censorship’, as you put it, is something necessitated by the current capitalist (imperialist) world order.
EDIT: Realized I only addressed your question indirectly. On the subject of FOSS, I don’t have any specific knowledge - but given that, unlike capitalist states, socialist states are not hostile to the majority of their population, I don’t see why they wouldn’t.
I think that’s Bukharin.