Interesting question.
If it was an Eastern Bloc central storage facility back in the Cold War days, they probably would have dipped them in a degreasing vat full of carbon tetrachloride, perchloroethylene or similar (dry cleaning solvents) then discharged the solvent to a river or put it in an unlined pond where it would seep into the groundwater.
In a field deployment situation, where they're degreasing a few or many crates at a time, probably each
militia soldier would have to degrease his newly issued second-line weapon. I've seen videos of Chinese degreasing them in a boiling water bath, as mentioned by Carl. This would be another possibility for the Eastern Bloc field deployment situation. Pulling second line weapons like SKSs, Mosins, Russian Capture K98k rifles or similar, would not have been likely to be time sensitive to the point that you'd be hours away from being overrun, so an individual soldier doing it the laborious way with an NCO looking on to tell them they're doing it wrong
would be the most likely scenario in my opinion
All of the above is primarily educated guessing for Eastern Bloc procedures, aka a WAG
American practice for removing actual Cosmoline (not the ersatz Cosmoline that communist countries used) was the chlorinated solvent approach (disposal in pits, not rivers), based on first hand accounts. That is one reason that many military bases have issues with DNAPLs (dense non-aqueous phase liquids, i.e., chlorinated solvents) in their groundwater. The wonderful properties of chlorinated solvents are that they are excellent degreasers and they are not flammable, the down side is that many are mutagenic/carcinogenic.
For myself, doing one, or a few, at a time, I've used a few different procedures. For light grease, I've wiped off excess and then used WD-40 or Remoil spray to remove light residue, or for heavier used mineral spirits to help dissolve the grease. I've also used boiling hot water in a 4" diameter PVC tube with an end cap that I set up specifically for the purpose with Dawn dishwashing liquid to emulsify the grease. I followed that up with a hot water rinse and immediately sprayed down all the metal with WD-40 or Remoil that flashes off the solvent and leaves the oily fraction behind.
For the stock I always prefer gentle heat to bleed out the grease and simply wipe it down. Usually a low temp (200F) oven that is pre-heated, then turned off. I don't want a hot heating element or gas flame as a source of flash ignition of any light petroleum products. A heat gun/hair dryer also works. Then there's the summer time seal it in a black paper bag in the sun trick too