The official "cure" for this problem is to change the banjo bolt for new one Pt. No. 69922861A. This one has a smaller hole in it.
Apparently the brake fluid can set up a pulse in the hose, a bit like when the water pipes "hammer" in your house. The smaller hole acts like a damper.
That, and possibly a set of new pads (Ducati originally listed a different part No. but these have now been discontinued) SHOULD cure the problem