In a situation where you could die (or other Jews could), would you be allowed to break the rules in order to survive?
The Talmud (Ketubot 19a) states:
דאמר מר אין לך דבר שעומד בפני פיקוח נפש אלא עבודת כוכבים וגלוי עריות ושפיכות דמים בלבד
for a Master said: 'There is nothing that comes before the saving of life except idolatry, incest and bloodshed only. (Soncino translation)
Various parameters of this are codified by Rambam in Hilchot Yesodei Hatorah Chapter 5:
Should a gentile arise and force a Jew to violate one of the Torah's commandments at the pain of death, he should violate the commandment rather than be killed, because [Leviticus 18:5] states concerning the mitzvot: "which a man will perform and live by them." [They were given so that] one may live by them and not die because of them. If a person dies rather than transgress, he is held accountable for his life.
When does the above apply? With regard to other mitzvot, with the exception of the worship of other gods, forbidden sexual relations, and murder. However, with regard to these three sins, if one is ordered: "Transgress one of them or be killed," one should sacrifice his life rather than transgress.
When does the above apply? When the gentile desires his own personal benefit - for example, he forces a person to build a house or cook food for him on the Sabbath, he rapes a woman, or the like. However, if his intention is solely to have him violate the mitzvot, [the following rules apply:] If he is alone and there are not ten other Jews present, he should transgress and not sacrifice his life. However, if he forces him [to transgress] with the intention that he violate [a mitzvah] in the presence of ten Jews, he should sacrifice his life and not transgress. [This applies] even if [the gentile] intended merely that he violate only one of the [Torah's] mitzvot.
All the above [distinctions] apply [only in times] other than times of a decree. However, in times of a decree - i.e., when a wicked king like Nebuchadnezzar or his like will arise and issue a decree against the Jews to nullify their faith or one of the mitzvot - one should sacrifice one's life rather than transgress any of the other mitzvot, whether one is compelled [to transgress] amidst ten [Jews] or one is compelled [to transgress merely] amidst gentiles.