I don't know who needs to hear this, but in management's eyes, it's your job to make them look good. If you want to be rewarded, make them look good, and if you want to be punished, make them look bad.
That's it. Fight losing self-destructive battles if you feel you have to, but never forget it.
sib's lemma: Not just as an IC (but as a manager, executive, senior exec, ...).