Spring between two objects?

How can I attach two objects with a spring?
In my example Cube1 has physics disabled, and Cube2 has physics enabled, the idea is that if I push Cube2 - it will bounce back to its previous position. How can I achieve that? It seems that SpringArm might a wrong way to do it, cause if I push my Cube2 it just flies away, as if it wouldn’t be attached at all.