Do I need a permit to replace roof shingles or siding?

No. Provided there is no structural work involved. If it is discovered that some portion of the building framing needs to be replaced because of moisture damage then a permit and follow-up inspection would be required.