Simplest way I can think of is attaching collision boxes to the camera that block only the player, so you have invisible walls around the valid area, that automatically move with the camera.
If you want to do some more math, you can also use a single collision box (that overlaps with player) and check the OnOverlapEnd event (=> player leaves valid area). Then you would disable movement in all directions but those that would bring the player back in the valid area. So for example if the player leaves the collision box on -x side, then you disable -x movement but still allow +x and all movement on y axis. If you want your camera to support all angles you would need some math here to lock the movement axis correctly.