With the development of computer network technology, network security has become an urgent problem to be solved. The network security management system studied in this paper is based on the Linux platform, the firewall, intrusion detection and other related information technology research and implementation, and through a lot of experiments to verify and optimize the software program. In this paper, we use the K-Means algorithm to solve the problem of multi-objective security policy deployment in the network security management system. Through the comparison of several related network security policy algorithms, it is found that the K-Means algorithm has a higher performance-cost ratio. The main work of this paper is as follows: 1) the data mining algorithm is studied, and the K-Means algorithm is deeply simulated; 2) Analyzed and designed the network security management system based on K-Means algorithm, and carried out detailed functional design, including the configuration of system modules, security management software and database management system; 3) Realized the network security management system based on K-Means algorithm. The system adopts B/S structure, uses K-Me algorithm to optimize the safety management system, and realizes the simulation results by MATLAB software to show that the design scheme is feasible and effective.