A surety may maintain an action against his principal to obtain indemnity against the debt or liability for which he is bound before it is due whenever any of the grounds exist upon which, by the provisions of this act, an order may be made for arrest, or for an attachment.
W.S. 38-1-108