When Sony Pictures Entertainment was attacked by hackers working on behalf of North Korea, its network suffered from serious deficiencies that its own auditor had found and identified.