This paper proposes a framework for anomaly detection in network security using Bayesian Optimization and Machine Learning. The effectiveness of the BO-SVM, BO-RF, and BO-KNN methods is explored in terms of precision, low false alarm ratio, high-accuracy ratio, and recall. The ISCX 2012 intrusion evaluation dataset is used for experiments and evaluation. The paper discusses the theoretical aspects of the techniques used and the experimental setup and result discussion.