Speaking at a press conference in Kyiv, Poroshenko however said he was confident that there was no military solution, but only a political way out of the crisis in Donbas.
But he stressed that martial law would be introduced immediately by his decree, if hostilities along the front line intensified.
"No one will hesitate for a minute," Poroshenko said.
According to Poroshenko, the ceasefire regime has been effective.
He noted that the last two meetings of the National Security and Defense Council have been devoted to discussing the issue of government actions in case of violations of the ceasefire.
"In this case, martial law will be introduced immediately. That is why we have insisted on adoption of the Ukrainian budget now, because we believe that the risks are high," the president said.
"I, as the commander-in-chief, have to defend my country against subversion and terrorist groups. Therefore, much is being done now to make various elements of our defense more effective."
Ukraine introduced a unilateral ceasefire on December 9, even after a previous ceasefire declared on September 9 was ignored by the pro-Russian militants in the east of the country.
Although fighting has decreased during the latest ceasefire, the militants have continued to break it on a daily basis. On Monday, fighting at Donetsk airport, which has been grimly defended by Ukrainian forces for months, resulted in the deaths of three Ukrainian servicemen.