In petroleum geology, source rock is rock which has generated hydrocarbons or which could generate hydrocarbons. Source rocks are one of the necessary elements of a working petroleum system.