This starred paper aimed to analyze different machine learning algorithms using security log data and to identify the best algorithm, which is both accurate and fastest in detecting the attacks by analyzing security data. In this paper, we reviewed different security risk assessments and machine learning algorithms and code. We brought together the security risk and machine learning algorithms to analyze security data by creating a test environment. For any organization detecting the attacks accurately and quickly is an essential factor in reducing the risk of a security breach. No amount of systems, standards, compliance guidelines can assure a complete hundred percent guarantee of avoiding the security breach. The assumption is security breaches will happen, and the best way to reduce the risk is to detect the attack early and implement the mitigation procedures. The early detection of the attack will provide security professionals the time to reduce the impact and safeguard the organization. We have discussed in risk assessment how different security guidelines are implemented within the organization, which slow and provide more time and increase the effort of hackers in getting access to core organization systems. This will be achieved by making sure the attack is detected early and once creating multiple layers of security so that it becomes difficult for attackers as risk procedures prevent the Kill chain of attackers by slowing and stopping the attack at different level