Cloud computing (CC) is vulnerable for the attacks of current information technology, because it prolongs and uses the information technology infrastructure, traditional operating system, and applications. Several security issues in detecting irregular network performances are confronted by the CC environment. With the intention of solving these security issues, dual-channel capsule generation adversarial network optimized with red fox optimization algorithm fostered intrusion detection framework (IDS-CC-DCCGAN-RFOA) is proposed in this article, for securing the privacy attacks in CC environment. Initially, the data are taken from NSL-KDD benchmark dataset. Then the data are given to the preprocessing segment. When using the developed random forest and local least squares in preprocessing segment, the redundancy, and missing values are purged. Then the output of preprocessing is given to the feature selection stage. In feature selection, the optimal features are extracted using univariate ensemble feature selection (UEFS) technique. Based on the optimal features, the data are classified into secured data and privacy attack data based on dual-channel capsule generative adversarial network. Here, the weight of dual-channel capsule generative adversarial network is optimally tuned using the red fox optimization algorithm for generating an effective and optimal solution to detect the intruders. The proposed IDS-CC-DCCGAN-RFOA method is implemented in MATLAB. Here, the performance metrics, like accuracy, specificity, sensitivity, F-score, precision, false positive rate, AUC are analyzed.Then, the proposed IDS-CC-CCGAN-WSOA method provides 13.9367%, 11.12%, 13.268%, and 13.739% higher accuracy and 24.54%, 29.76%, 12.87%, and 34.21% higher sensitivity compared with the existing methods, like intrusion detection framework in cloud computing using deep belief network with salp swarm algorithm (IDS-CC-DBN-CSSA), intrusion detection framework in cloud computing using deep neural network with improved genetic algorithm and simulated annealing algorithm (IDS-CC-DNN-IGASAA), intrusion detection for cloud computing using multilayer perceptron neural network and artificial bee colony optimization algorithm (IDS-CC-MLPNN-ABC), and intrusion detection for cloud computing using recurrent convolutional neural network with ant lion optimization algorithm (IDS-CC-RCNN-ALO).