For large gun safes you can mount a dry rod that plugs in (safe needs to have holes for electrical cord, most do.) This keeps interior of safe at a consistent degree or 2 over outside area to expel moisture.
For smaller safes you can buy a rechargeable desiccant pack such as the Stack On cordless dehumidifier. The beads change color when it needs recharging (not all that often, depends on climate and size of area it's working in).
https://www.farmandfleet.com/product...FQdXDQodq-EBJQ