Task scheduling is the most important issue in the cloud computing environment since its implementation is largely dependent on it. However, due to its weaknesses in energy consumption for resource usage, high computational complexity, and memory needs, Virtual Machine (VM) cannot manage large amounts of workload. Furthermore, by reducing the number of active hosts' data assignments while utilizing the resources, a security risk occurs. To address these challenges, a Grey-wolf with Deadline Restrictions approach was developed to allocate tasks and resources in less time while maintaining fixed interval constraints. Moreover, the Cognizing Anomaly detection method is utilized to find even the most recent abnormalities in the data. Furthermore, using the Confinement Forest-based augmented Min-Min and Max-Min approach, the task scheduling process provides an efficient workload balancing mechanism by restricting makespan, energy consumption, load balancing, and fault tolerance. In contrast, enabling a security-aware multicharacteristic-based heuristic technique is employed to provide secure placement of data in the appropriate location. The proposed technique outperforms existing methods in terms of makespan and memory consumption.