The meaning of the phrase is straightforward: One cannot do me wrong and expect to receive no consequences.

To add some interest to the discussion, compare this statement to the narrator's other reference to impunity in the short story:

"I must not only punish, but punish with impunity. A wrong is unredressed when retribution overtakes its redresser. It is equally unredressed when the avenger fails to make himself felt as such to him who has done the wrong."
Here, he says that he must not only punish but do so while expecting no consequences for the punishment. He adds that he must go a step further and demonstrate to the person being punished that he feels that way.

While the above answers are correct, I would like to add another interpretation of the quote.

The motto "No one attacks me with impunity" is seen in Poe's "The Cask of Amontillado". Merriam Webster defines the wrod "impunity" as: exemption or freedom from punishment, harm, or loss.

Montresor has a grudge that he carries against Fortunato. Montresor never divulges what offense Fortunato has done to him. Regardless, Montresor decides that Fortunato must pay for the offenses he has made against him.

Montresor's motto states that no one will be able to act against me without worry of punishment. The curious aspect of the story is that Fortunato has no idea about the revenge which Montresor wishes to enact upon him.

Here is where the motto could change in meaning. While Montresor states that any action against him will result in repercussions, one could also interpret the motto to say that Montresor lives his life in fear that others will offend him or his name. To embrace a motto, such as Montresor's, circumstances must exist so as to support the motto. What one could divulge from this is that Montresor has repeatedly been offended and, therefore, his motto stands as a warning to others.