Preheat oven to 190°C (375°F).
In a roasting tray, combine quartered shallot, sliced garlic, parmesan rind (if using), and a drizzle of olive oil.
Add drained cannellini beans, chicken stock, and bay leaf to the tray. Stir gently to mix.
Place chicken legs on top of the bean mixture. Drizzle with olive oil and season with salt and pepper.
Roast in the oven for 30–40 minutes until chicken is golden and cooked through, reaching an internal temperature of 75°C (165°F).
While the chicken cooks, prepare the pistachio and parsley pesto: In a blender or food processor, combine pistachios, grated garlic, fresh parsley, lemon zest, and a pinch of salt. Gradually add olive oil until a pesto-like consistency is achieved.
Once the chicken is cooked, remove from the tray and let it rest for a few minutes.
Before serving, stir lemon juice into the bean mixture for added brightness.
Plate the beans, top with the crispy chicken, and drizzle with the prepared pistachio pesto. Optionally, add a dollop of ricotta or Greek yogurt to each plate.