Confinement-driven Spatial Variations in the Cosmic-Ray Flux