So I'm a bit confused as to whose side the major characters are on and the alignments of each ninja organisation.
The following threat and relations diagram is pretty useful.
The most important thing is that the current connector to the main story it's the Kumogakure clan. Officially they have a seat in the Great『NIN』Council with one of them as a member of the Seven Lords.
『NIN』is the official Ninja Intelligence Agency of Japan. They work in conjunction with the police and, due to the power structure and dependence of Japan with the United States after World War II, 『NIN』pledge alliance first and foremost to an unidentified international organization.
Inside the country『NIN』represents the "voice of the people" and thus, in addition to being part of domestic affairs, they perform televised public executions of criminals and bad elements as an assertion of dominance and strength to maintain a favorable opinion within the civilian population, projecting themselves as a brutal, ruthless but pacifying and ultimately benign force that preserves Japanese rule of law.