I doubt it stops gamma very well. It takes mass, whether an inch of lead, five inches of steel, 20 inches of concrete, 40 inches of water. Beer’s Law applies to gamma.
The Zeigler Equation applies to cosmic rays. In some cases you get MORE radiation into your target as the cosmic ray decelerates in your shield and makes more, lower energy, photons by bremsstrahlung radiation. Another curious thing about cosmic rays is that at lower energies, they can deposit more energy per length than at higher energies, so by putting in say a 200 mil aluminum shield, you can increase the impact of the cosmic ray (shielding can modulate Linear Energy Transfer, LET).
That’s pretty damn interesting. One should learn something new every day. That bit of info will take me through the weekend :-)