You are assuming the Big Bang happened at a point, so the CMB is a shell of radiation expanding outwards from that point. However the Big Bang happened everywhere so every point in the universe is a source of the CMB. The CMB radiation we are detecting today comes from regions of the universe that were about 13.8 billion light years away at the moment the CMB was emitted (those points are a lot farther away now).
The fact that the Big Bang happened everywhere is a difficult conceptual issue for non-physicists. See my answer to the question Was the singularity at Big Bang perfectly uniform and if so, why did the universe lose its uniformity? for a non-physicist friendly discussion of this.
Actually, in a large solar flare particle energies can get up to 1 GeV, but the top energy of some particles is not really the issue. The issue is the flux of these high energy particles. A 10 MeV proton or electron pretty much rips through most spacecraft bodies, thus, their electronics are effectively exposed to particles at these energies.
The often associated coronal mass ejections (CMEs) produced in association with large solar flares carry with them enhanced fluxes of >MeV protons and electrons. These blobs of plasma and magnetic fields compress the Earth's magnetic field, which can induce DC currents in our power grids and expose geosynchronous (or GPS, I forget which orbit at the co-rotating altitude) spacecraft to the high levels of radiation. After the CME has passed, the effects are not over as they often induce a geomagnetic storm, which enhances the radiation belts and thus further exposes co-rotating spacecraft to high energy particles (thus the name "killer electrons" for the outer radiation belts).
I will add more later and include some links, but the point is that our magnetic field does a tremendous amount to prevent our lives from becoming incredibly complicated, as Timaeus eluded to.
Updated Version
Actually, in a large solar flare particle energies can get up to 1 GeV, but the top energy of some particles is not really the issue. The issue is the flux of these high energy particles. A 10 MeV proton or electron pretty much rips through most spacecraft bodies, thus, their electronics are effectively exposed to particles at these energies.
The often associated coronal mass ejections (CMEs) produced in association with large solar flares carry with them enhanced fluxes of >MeV protons and electrons. These blobs of plasma and magnetic fields compress the Earth's magnetic field, which can induce DC currents in our power grids and expose geosynchronous (or GPS, I forget which orbit at the co-rotating altitude) spacecraft to the high levels of radiation. After the CME has passed, the effects are not over as they often induce a geomagnetic storm, which enhances the radiation belts and thus further exposes co-rotating spacecraft to high energy particles (thus the name "killer electrons" for the outer radiation belts).
The Earth's magnetic field also helps protect our atmosphere from ionizing erosion. By that I mean that once an atom is ionized and exposed to the bulk flow of the solar wind, it will experience a conductive electric field ($\mathbf{E} = -\mathbf{V} \times \mathbf{B}$) and react like a pick-up ion. The force on the particle from such an electric field can easily exceed the gravitational force, thus freeing the particle from the atmosphere. Without the Earth's magnetic field, the ionized part of the upper atmosphere, called the ionosphere, would increase due to the addition of the solar wind's ionization effects. Currently, only charged particles with energies >10-100 MeV, neutral neutrons, or high energy photons (e.g., UV, X-rays, and/or $\gamma$-rays) are able to reach our atmosphere and contribute to the overall ionization.
It is doubtful that during a pole flip of the Earth's magnetic field that we would completely lose our atmosphere, considering several pole flips have happened in the past. However, the point is that our magnetic field does a tremendous amount to prevent our lives from becoming incredibly complicated, as Timaeus eluded to.
Best Answer
On the surface of the Moon, the main source of radiation is energetic solar particles (mostly protons and electrons) and galactic cosmic rays (GCR). (The GCRs come out of the Solar system.) The gamma radiation (as a primary particle) is negligible. (The gamma flux in the space is very low...)
According to this article, most of the particle showers won't penetrate more than 0.5 m of lunar soil (with a density of 1.4 g/cm$^3$). (According to this presentation, the density of lunar soil ranges from about 1 g/cm$^3$ to 2 g/cm$^3$.) The showers have a sharp peak in the [energy deposit - penetration depth] relationship. After which the energy deposition usually drops to less than 10% of the peak value. (Only lightly ionizing particles remain.)
Although they couldn't study the contribution of neutrons (created in the particle showers), which can penetrate more rock than the charged secondary particles. (On current spacecrafts, 30-60% of the total equivalent dose might come from neutrons.)
Based on the article, about 0.5-1 m of soil might be sufficient.
Although the radiation level will be still higher than on the surface of Earth, it is hard to tell more without experiments or simulations. The problem is with the neutrons (and high energy muons). For these, the energy loss is not continuous, but characterized by discrete events. Thus they can often penetrate more material than expected by continuous energy deposit approximation. Thus also non-trivial if '8 km' of air can be substituted by 4 m of rock (as suggested by @CuriousOne). (Also partly because of the different composition of rock and air.)