The two Parshiyot that most often fall out during Chanukah are VaYeishev and Mikeitz. They tell the story of Yosef's descent into the mire of Egyptian slavery followed by his amazing ascent to viceroy of the entire country. Throughout his time as a slave, in prison, and as viceroy, Yosef keeps to his principles. He refuses to sin with Potifar’s wife, and even the Egyptians realized that he had special divine assistance. He was able to resist all of the terrible influences of Egyptian society. On a simple level, this is the connection to Chanukah. The small band of Jews led by Matityahu that rebelled against the Greeks was made up of those who resisted the influence of Hellenism and the morass of Greek culture and lifestyle. How did Yosef and the Chashmona’im have the ability to resist the pernicious influence of the surrounding culture? After all, the Rambam (Hilchot Dei'ot 6:1) states that it is natural for people to be affected by their environment!
Chazal give us a hint as to how Yosef survived. Rashi (BeReishit 39:3 s.v. Ki Hashem Ito), in explaining how Potifar knew that Hashem was with Yosef, quotes the Midrash Tanchuma which explains that Yosef always used to mention Hashem’s name. Further on, Rashi (39:11 s.v. LaAsot Melachto) quotes a Gemara (Sotah 36b) which relates that as Yosef was giving in to Potifar’s wife, the image of his father appeared to him and he was able to overcome his desires. The point Chazal may be driving at is that Yosef kept his focus on remembering everything he had learned with Yaakov about Hashem and about what a moral person was. He constantly reminded himself of Hashem’s presence, and when things looked bleak, he tried to remember Yaakov and the shining example he had set. By doing so, he was able to resist the immorality of Egypt.
It seems that the same was true of the Chashmona’im. They resisted the Greeks not as a political move – the Jews of the second Beit HaMikdash era never had been independent – but as a religious uprising. They saw the downward spiral of Jews' commitment to Hashem and were deeply distressed, because Hashem was at the center of their lives. They kept their focus on Hashem, and as long as they did so, they were able to fight the Greeks.
The Halacha (Orach Chaim 671:7) states that the Chanukiyah should be placed in the doorframe of the house (this is not practiced in many places today - see Rama ibid.). Why did Chazal establish that the commemoration of the miracle that occurred in the Beit HaMikdash be placed in the house? What does a house have to do with the Beit HaMikdash? I heard Rav Zvi Sobolofsky explain that the Jewish home is, in fact, supposed to be like a miniature Beit HaMikdash. The house has to be a place of Kedushah that provides a haven from those aspects of society that are dangerous to Avodat Hashem. Even not during Chanukah, we have a Mezuzah to remind us of the role of the house, but on Chanukah, when we remember the courageous stand of the Chashmona’im against the outside culture, we put an extra symbol by the doorpost.
It would behoove all of us to take a careful look in the mirror to see how much of what we are is made up of Torah values and how much is made up of those parts of the surrounding culture that are antithetical to Torah. If we find anything that should not be there, Chanukah is a great time to work on excising it. By critically evaluating what comes into our homes and becomes part of our lifestyles, we will be following in the footsteps of the Chashmona’im and will, Im Yirzteh Hashem, merit a salvation similar to theirs.