Moussar sur Les Psaumes 105:18

עִנּ֣וּ בַכֶּ֣בֶל רגליו [רַגְל֑וֹ] בַּ֝רְזֶ֗ל בָּ֣אָה נַפְשֽׁוֹ׃

On chargea ses pieds de liens, son corps fut retenu par les fers,

Ma'alot HaMiddot

My children, come and I will teach you the virtue of modesty. My children, you should know that the virtue of modesty is from the most important and pedigreed traits. As it one of the three traits that the Holy One, blessed be He, seeks from the Jewish people, as it is stated: And what does the Lord require of you, etc. and to walk modestly with your God (Micah 6:8). And not only that, but it protects a person from the evil eye, and saves him from sins and transgressions. For such do we find with the righteous Joseph, that because he acted modestly, he was saved from his mistress, the wife of Potiphar, and did stumble because of her. It is like the matter is stated: and his master's wife lifted her eyes, etc.. She lifted her eyes in order to gaze at him, but he did not lift his eyes to gaze at her. Accordingly did the sages, may their memory be blessed, say in the recountings (Bereishit Rabbah 87:10), that she placed an iron bar beneath his neck until he would direct his glance toward her and look at her. Nevertheless, he would not look at her. As it is stated: They tortured his legs with chains; his body was placed in iron (Psalms 105:18). And we found that a certain matron asked Rabbi Yose: She said to him, "Is it possible that Joseph was seventeen years old, standing in vigor, and he would not have done that thing?" He brought out the book of Genesis in front of them. He began to read the story of Reuben, and of Judah and Tamar. He said to her, "If Scripture did not cover for these, who were older and under their father's authority, all the more so would it be for this one who was younger and under his own authority."