This is a difficult one. There is almost certainly a rule against it and almost certainly the rule is applied haphazardly. So how do you deal with it? The odd "f***in' hell" used to be met effectively with: "I hope so, because that's where I'm going", but the General Teaching Council for England has deemed such badinage an unprofessional and punishable offence.
Don't try the old argument that swearing is a sign of a limited vocabulary, as it just doesn't add up. If you haven't got words in your vocabulary, your vocabulary lacks words. If you have, it has increased. This is a mathematical fact, as all children know, especially since the numeracy hour.
Much depends on your attitude to swearing. I suspect that if you have a pathological loathing of cussing (and litter), teaching is not the job for you. Others are oblivious to it. Intent is probably the key. Some children happily utter meaningless expletives as fillers between words. They barely notice it and it probably warrants only a mild reaction. With other pupils, cussing can show considerable wit and verbal dexterity. Where it is malicious, though, it should certainly be challenged. Consider the following: were you meant to hear it? Can you deal with it humorously? Was it nasty, aggressive harassment? If the instance is a serious one, report it and don't let your senior management team belittle it.