In the Internet of Things (IoT), a simple form of attack can deplete the energy available to operate the sensor nodes. Some of these nodes may use batteries, while others may harvest ambient energy such as photovoltaic, or electromagnetic, or vibration based energy. We first briefly survey the types of attacks which aim at the nodes' energy provisioning systems. This paper analyses the effect of such attacks on the energy lifetime of a wireless node. Then we provide models to estimate the effect of attacks that attempt to deplete the node's energy supply, both for a node that uses energy harvesting. We then examine a simple means of attack mitigation based on dropping both attack and "good" traffic. For nodes that use energy harvesting, we compute the fraction of traffic that must be dropped so as to offer a desired "energy life-time" of the node. We see that the required traffic drop rate depends in a non-linear manner on the nominal "good traffic rate" at which the node is expected to operate. Finally, we analyse the impact of attacks on the energy lifetime of a node that operates with a replaceable battery.