Preheat the oven to 180°C.
Unroll the pastry on a floured surface and cut into 72 equal squares.
Transfer pastry to baking trays and brush with the beaten egg.
Place a little pesto, a mozzarella piece, and a tomato segment on 36 squares.
Season the pesto bites with salt and pepper.
Salt the sliced onions in a bowl to soften them.
Place sour cream on the remaining 36 squares.
Rinse and drain the onions, then place them onto the sour cream bites.
Top with chopped prosciutto ensuring each piece includes some fat.
Bake for 15 minutes until the pastry is puffed and golden.
Top tomato bites with fresh basil before serving.