There are several ways to get the cables from your deck stepped mast into the boat without allowing water in with them.
Deck plugs are inclined to corrode and fail unless meticulously maintained. Deck glands are a better choice because any joint is made below decks. Both deck glands and deck plugs are vulnerable to being stepped on by crew working the busy area around the foot of the mast. If you use them, buy metal not plastic versions. A swan neck is a popular choice on bigger boats but they can snag sheets and halyards if you’re not careful.
An excellent option is the Swedish designed Cableport.