Is this legal?

HOAs around here push the limit until someone busts them back into line. I would examine the covenants very closely before buying a home in a neighborhood with a HOA
It isn't just the covenants. If they are acting outside the bounds of their authority, you still have to pay for a lawyer while they use HOA funds to defend themselves and run up your legal bills