What attaches the heart to body cavity?

Pericardium?

From Google:

The pericardial sac has two layers, a serous layer and a fibrous layer. It encloses the pericardial cavity which contains pericardial fluid. The pericardium fixes the heart to the mediastinum, gives protection against infection, and provides the lubrication for the heart.