Cloud computing has become popular in recent years. However, when users use these services, there are some security issues to be considered. The privacy issue is one of the main problems in cloud computing. Users want to make use of these services and simultaneously make sure that their sensitive information will not be leaked. In this paper, we propose an approach that not only provides an intrusion detection system, but also protects user’s privacy in the cloud. We combine hidden keyword search and SNORT rules to construct our system. Finally, we do experiments to evaluate the system performance and detection rates.