Impact of Energy Security Indicators on policy making of energy supply is one of the concerns of researchers in this field. Generally، these considerations are implicitly included in energy supply models. In this paper، we introduce the import dependency index، one of the most important energy security indicators، as a means of measuring energy security in the energy supply optimization model. In this method، the NEID indicators، which are a little interpreted from the threats associated with energy imports، are introduced stochastically into the model. The nature of these parameters is uncertainty type، therefore، based on the probable scenarios of the stochastic model، the perspective of the energy supply system is drawn up based on a stochastic model of optimizing the supply of different carrier energy. Gasoline price scenarios are based on the cross impact analysis method، which consists of three scenarios of intense boycotting and passivity، a strong and active boycott، and the continuation of the current situation. The LINGO 16. 0 software has been used for modeling and solving stochastic problems under the license. The method developed in the case study is the use of petroleum products in the three scenarios resulting from the sanctions. According to the results of the model، in the period when there are threats of energy imports، energy storage upto 8 million bbl annually is a low-cost and reliable way to compensate for the threats posed by sanctions، and the optimal index in this period is oscillating between 0. 04 to 0. 06.