In this paper, we propose a reputation-based trust model for P2P applications and study it a security framework. This framework makes it easy to reason about the resilience of the reputation metrics against Sybil attacks. We show that using the PageRank reputation metric in a P2P system can make it very vulnerable from Sybil attacks. We then propose a new reputation metric based on the original PageRank, and show that it is more resilient against such attacks.