Reputation systems are playing critical roles in P2P networks as a method to assess the trustworthiness of peers and to combat malicious peers. However, the characteristic of aggregating ratings makes reputation systems vulnerable to be abused by false ratings, and thus offering opportunities for malicious peers. They can conspire with each other to form a collusive clique and unfairly increase the reputation of them. Under the cover of high reputation, malicious peers can masquerade as trusted ones and violate P2P networks arbitrarily. This attack model, called GoodRep, is described in this paper. In order to defend against GoodRep attack, the RatingGuard scheme is proposed to secure P2P reputation systems. This scheme is built with three functional modules: DC, DP and AD. The data collection (DC) module supports the collection of the previous rating data among raters. The data processing (DP) module measures the rating similarity of raters’ activities by analyzing these data. To identify GoodRep cliques, the abnormal detection (AD) module detects the abnormalities through clustering partition technology. The experimental results show that our RatingGuard scheme is effective in suppressing GoodRep attack, and the reputation system with RatingGuard gains higher detection ratio of malicious peers compared with the traditional schemes.