If there is a direct threat to the United State's national security, then that definitely has a direct impact on the need to go to war. If, for example, the threat to security had not previously been a threat to security, then war would not have been necessary. Since the threat to security is a threat to security, though, war is necessary. The connection between national security and war is direct. If national security is pressed, the need to go to war rises.
Despite how bad our national security is, it is not justifiable enough for us to go to war. Our national security may pose a problem within a nations border, and it may not necessarily involve other countries. We can make our people feel safer and secure in our nation without the need to invade other countries and steal their oil or establish democracies.