Preheat the oven to 400F and grease a 24-cup mini muffin tin.
Cut the puff pastry into 24 small squares, about 2 inches across.
Press each square into a muffin cup so the corners stand up above the rim.
Place a brie cube into each cup, then top with about 1/2 teaspoon of cranberry sauce.
Brush the pastry edges with egg wash so they bake to an even golden colour.
Bake for 12 to 15 minutes, until the pastry is puffed and deeply golden and the cranberry sauce is bubbling slightly.
Check that the centre pastry isn't raw by peeking underneath one bite; it should look dry and flaky, not wet.
Cool in the tin for 3 minutes before lifting out with a thin knife or small offset spatula.
Scatter chopped rosemary over the top if using.
Serve warm; the filling re-sets as it cools, so these taste best within the first hour.