What is the input voltage range for this voltage regulator?
I suggest you use an UA78M33 rather than a '1117. They're rated for 25V in (35V abs max) and are inexpensive and very stable. Your 12V is above the recommended maximum (10V) but below the absolute max (15V) so you're still in a danger zone- if the 12V supply overshoots a bit you could see failures. 

There's no point in using an LDO where you are burning away 8.7V anyway- your efficiency will necessarily be terrible with a linear regulator. 

If the current drawn is more than a few tens of mA, you should consider using a switching regulator instead. 

If you insist on using the '1117 you can drop the input voltage a bit with a series zener + resistor to maintain minimum current, or maybe a series LED + resistor to ground (for the same reason) if the currents are small and light variation with current doesn't bother you. 

The resistors can be either from the input diode to ground or from the output of the regulator to ground, depending on where you want the power to be dissipated.