Place the thyme, cracked black pepper, bay leaves and juniper berries (if using) in the bottom a pan or container large enough to hold the duck legs in a single layer.
In a small bowl combine the salt and sugar. Rub a generous amount of the salt & sugar mixture over each of the duck legs. Lay the duck legs on top of the thyme, pepper mixture. Cover tightly with plastic wrap and refrigerate for 12 –24 hours.
Day 2 - Slow cook/confit the duck
Adjust oven rack to middle position and preheat oven to 225°F(105°C).Melt the duck fat in a wide heavy-bottom pot just large enough to hold the legs, snugly, in a single layer.
Place the duck legs skin-side up in the melted fat, submerging the duck legs completely. Cover the pan with a lid or aluminum foil, and transfer to oven.Cook until the duck is completely tender, and skin has begun to pull away from bottom of the drumstick, about 3 ½ to 4 hours.Let the duck cool in the fat to room temperature. If not using the same day transfer the duck to a storage container and refrigerate with the legs completely submerged in fat until ready to use, up to one month. When ready to use remove the duck legs from the fat, scaping off any excess fat.
Completing the dish
Heat a dry frying pan, preferably cast iron, over medium-high heat and place the leg in the pan, skin side down, to crisp up and heat through before serving, about 6 minutes. (Alternatively, you can brown and crisp the duck, skin side up, under a broiler for about 8 minutes.)
Notes
Add some baby potatoes to the pot and allow them to cook along with the duck legs. When ready to complete the dish, give them a little smash, and brown them in the hot pan along with the duck legs.