Pantry bugs appear not to like bay leaf.
Quick tip: Put a few bay leaves in a jar of grains or beans or put some bay sprigs in your pantry to keep pests out of your food.
Bay trees are common here in California. We have a stand of bays just ten feet from our house so we cut a few sprigs and toss them in the pantry. As they get dusty or overly crispy, we replace them.
If bay is not local to you, it appears that people use the dried leaves too (from a quick Internet search) and place them right in the jar. If you do not have access to fresh bay, that may be your best bet.