The present invention relates to compounds of the formula wherein R1 to R8 are as defined in the description and claims, and pharmaceutically acceptable salts thereof. The compounds are useful for the treatment and/or prophylaxis of diseases which are associated with the modulation of CB1 receptors.