quien a buen árbol se arrima, buena sombra le cobija

Etymology
lit. '(he) who comes close to a good tree, good shade shelters him'.

Proverb

 * 1) it's not what you know but who you know