I don't leave anything down in the kitchen that can be gotten by the dogs.
Dogs are by nature scavengers. It is very difficult to fight mother nature. In a dog pack, if a dog gets up and leaves its meal or bone, it is a social signal that it is free for the taking. When you leave food about, the dog may see this as available.
I had a dog who would not look at any food that was around as long as we were with her. She understood not to take it in our presence. But, if left to her own devices she would have a party fast as a wink.
We would have had to do something aversive to her to attempt to give her a negative view of getting on the cabinet or in the refrigerator. I doubt scare or punishment techniques would have worked with her for very long and I never tried them.
She had to be confined to a safe place when we were gone. Some dogs are not so prone to raid or can be dissuaded. But, when they are successful in your absence, they get rewarded for the behavior and some are more persistent than others.
Management can go a long way. What about putting the food away?