Israel’s top general has resigned, citing the security and intelligence failures related to the surprise attack by Hamas that triggered the war in the Gaza Strip.