"Internal affairs" varies from jurisdiction to jurisdiction, but based on US TV series, the name seems to refer to a branch of the judiciary that is concerned with quality control in police forces. In other words, if you are a police officer, and you are accused of corruption, or you make a mistake, internal affairs are the people that investigate the complaint.
"ferret" is an inquisitive animal that can find its way into small holes. Here is is a demeaning way to refer to an investigator.
"crawling up my butt" means that the investigators are going to be investigating the person thoroughly - looking into their very personal details, and being annoying to them.