Gmina Szastarka is a rural gmina (administrative district) in Kraśnik County, Lublin Voivodeship, in eastern Poland. Its seat is the village of Szastarka, which lies approximately 12 kilometres (7 mi) south-east of Kraśnik and 48 km (30 mi) south of the regional capital Lublin.
The gmina covers an area of 73.53 square kilometres (28.4 sq mi), and as of 2006 its total population is 6,236 (5,957 in 2013).
Gmina Szastarka contains the villages and settlements of Blinów Drugi, Blinów Pierwszy, Brzozówka, Brzozówka-Kolonia, Cieślanki, Huta Józefów, Majdan-Obleszcze, Polichna, Rzeczyca-Kolonia, Stare Moczydła, Szastarka, Wojciechów and Wojciechów-Kolonia.
Gmina Szastarka is bordered by the gminas of Batorz, Kraśnik, Modliborzyce, Potok Wielki, Trzydnik Duży and Zakrzówek.