Our Gemara on Amud Beis discusses the principle of Avid Inish Dina Lenafshe, which is to the extent that a person can take the law into his own hands to protect, or recover his possessions. There are times where it may be permitted to even resort to violence to protect one's possessions, see Shulkhan Arukh (CM 4). Of course, the potential for vigilantism and rationalization for out of control behavior is considerable, so one should be both well-versed in the laws, consult with competent poskim, and have sufficient self-control and judgment.

Our Gemara discusses a vignette where the person was technically justified in taking matters into his own hands to recover something that was rightfully his. However, the sage Ben Bag Bag ruled that if it has the appearance of theft such as by stealthily, entering into the person's property, it would still be forbidden because of the optics. It is not good for people to see others behave in a manner that appears sinful and lawless.

Be’er Yosef (Kedoshim) finds scriptural support for this.  There are verses in the Torah that the sages say refer to theft of objects, but also verses that refer to human theft, i.e. kidnapping.  Gemara Sanhedrin (86a) states that the verse in Shemos (20:13) “[You - singular], Do not steal” refers to kidnapping. And the verse in Vayikra (19:11) “[You - plural], Do not steal” refers to theft of objects. Unlike English, Hebrew has a plural verb form and singular verb form. Thus, the first verse by kidnapping is singular (“lo signov”), and the second verse referring to ordinary theft, is plural (“lo signovu”). Be’er Yosef says this hints at Ben Bag Bag’s principle. The provision against ordinary theft is said in a plural form to remind even the victim to be careful not to retaliate by stealing back. However, since the first verse is referring to kidnapping, which is considered a capital offense, it would be permitted to retaliate and engage in any means necessary to rescue the victim. Therefore it is stated in the singular form and is only addressing the thief not the victim.

I cannot help reflecting on the current situation regarding Israel, Hamas, and world opinion. Bizarrely, the world holds Israel to a twisted moral standard, that they should not defend and even retaliate to protect themselves from a sworn enemy, that has no interest other than our complete annihilation in the cruelest and inhumane manner. Lest we be tempted to worry about the optics, because it has the appearance of impropriety, let us remind ourselves of the words of the Be’er Yosef. When it comes to saving lives, we are not concerned about appearances.