Resin is produced in the foundry, starting from level 17. You need logs and fir cones for it.

It can also be found after cutting down baobab trees.