Kirasir is right, I had the same problem with my car.
Try this to check it, pull the handbrake up one or two clicks, then go drive, does it still rattle? If that fixed the rattling go tighten your parking brake cables. It worked for me.
How to Adjust an e36 Handbrake
"Driving is like a narcotic, an addiction that can take over lives. It ruins people, breaks families apart, and even kills. Itís habit that needs to be fueled. Time, money, rationality, sweat, knuckle skin, and anyone who disapproves are of little importance to a driver, and are often overlooked. Hi, Iím Nelson, and Iím a drivaholic."