A cowardly attack is where the attack takes some advantage in the attack that is unwarranted, unethical or a violation of moral principles. It is not simply an attack that is unethical or immoral. It is one that takes advantage of some opening or opportunity in violation of such a principle.
An attack under a flag of truce is a cowardly attack.
It used to be considered that any attack prior to a declaration of war was a cowardly attack. So Pearl Harbor was a cowardly attack.
Attacking someone in a wheel chair or old or unable to defend themselves is a cowardly attack.
A terrorist attack is one where the terrorist takes advantage of the civility and hospitality of the host or society to attack him.
In the case of the Washington Navy Yard, Aaron Alexis had a pass and was trusted. He took advantage of that privilege to attack them. That makes it a cowardly attack.
Aaron Alexis also shot unarmed people. That makes it a cowardly attack.