Risk ranking and allocation of resources