Been messing around with this all week. I've got a little enclosure in the garage where I run the irrigation controller and some relay boards, and my Uno has been dangling off a cable tie for the better part of a year. Every time I unplugged the USB lead the whole thing woud swing around like a pendulum. Enough of that, so I sat down with FreeCAD and knocked up a small bracket that bolts to the board's corner holes and clips straight onto the rail.
It's an X shape with a slide-in foot on the back, and it locks on with a standard snap clip. Mounted it sideways, upside down, whatever, the board doesn't budge. Whole thing printed in about half an hour on a 0.2mm layer, barely used any filament. I went with PETG because the cabinet gets warm in summer, PLA would probly creep over time near anything that generates heat. Used small M2 bolts to fasten it down, countersunk so nothing shorts out on the underside. Honestly it just looks tidy now, which is more than I can say for the rest of the cabinet.