Six months after oil began flowing through the Dakota Access Pipeline, a federal judge has ordered the pipeline's owner to develop a final spill response plan for the section that crosses beneath the Missouri River half a mile upstream of the Standing Rock Sioux Tribe's reservation—and to work with the tribe to write the plan.

The judge also directed the company, Energy Transfer Partners LP, to commission an independent audit of its own prior risk analysis and to produce bi-monthly reports of any repairs or incidents occurring at Lake Oahe, the site of the contested river crossing that was the focal point of months of anti-pipeline protests that ended earlier this year.

Monday's ruling, issued on the heels of the Keystone oil spill that leaked an estimated 5,000 barrels or 210,000 gallons of oil in South Dakota last month, gives the tribe new hope that the threat they say the pipeline poses to their drinking water will be addressed.

"To the extent everyone assumed that this was all settled and the pipeline was going to continue operating without a hitch, those assumptions, it turned out, were wrong," said Jan Hasselman of Earthjustice, an attorney representing the Standing Rock tribe. "The door is open a crack to revisit these questions depending on what the audit finds."

Energy Transfer Partners declined to comment on the ruling. "I am happy to confirm that the Dakota Access Pipeline has been safely operating since early this summer, however, beyond that I will decline to comment on issues related to current or pending legal matters," Lisa Dillinger, a spokesperson for the company, said.

In his ruling, U.S. District Judge James Boasberg mentioned the recent Keystone Pipeline spill as cause for concern.

"Although the court is not suggesting that a similar leak is imminent at Lake Oahe, the fact remains that there is an inherent risk with any pipeline," Boasberg wrote.

Hasselman said the Keystone spill likely influenced the ruling. "I have to imagine that the court doesn't want a DAPL [Dakota Access Pipeline] spill on its watch," he said.

Hasselman and the tribe previously sought to shut down the Dakota Access Pipeline while the U.S. Army Corps of Engineers completes a court-ordered re-assessment of its prior environmental analysis of the entire pipeline, which carries crude oil 1,170 miles from North Dakota to Illinois.

Boasberg ruled in October that pipeline operations could continue until the ongoing assessment was complete, a process the Army Corps says it aims to finish in April.

Though the tribe's request to temporarily halt the flow of oil was denied, the tribe also requested a final emergency response plan written with the tribe's involvement and an independent risk assessment.

Energy Transfer Partners has already produced at least two draft emergency response plans for a potential spill at Lake Oahe. The company has also conducted a risk assessment for the crossing, but it did not included Standing Rock tribal officials or seek the opinion of independent experts in either process.

Hasselman said the tribe will continue to push for safeguards against a spill.

"The tribe hasn't wavered in its opposition to this project, and they will keep fighting until the threat is addressed," he said.

Boasberg ordered that the emergency response plan and audit be completed by April 1.