All-Optical Networks provide ultra-fast data rates, but present a new set of challenges for network security. We present a new algorithm for attack localization in networks. The algorithm is distributed and requires only local information. The algorithm can localize attacks for a variety of network applications. This algorithm is particularly well suited to the requirements of All-Optical Networks because it provides fast, reliable response to attacks. In particular we apply it to two common forms of rapid optical network restoration: automatic protection switching and loopback.