Assuming the COBRA insurance qualifies to contribute to an HSA, you can contribute to an HSA for 2018 anytime before April 15th, 2019.
However, if the HSA is held by your employer, they could have restrictions, and you would need to ask your employer about that.
Otherwise, you could open a HSA at many other financial institutions, and contribute to that account.