Not resting in hostile areas seems like a good idea... but enemies do not respawn, there's no dungeon master tossing random encounters into the game, so practically speaking, limiting rests to specific locations merely means long walks through already cleared areas to the rest point, then back again. That is going to feel like a mere time-waster after many hours of playing.

I believe that Solasta has the "long rest at specific spot" mechanic. The demo had a long rest spot, but if you ignored it and pressed on, there was a one-way drop and a forced encounter, so it was "use it or lose it". A specific point for long resting in hostile areas is probably the best, but you'd need to communicate that to the player. D:OS 2 had something called the "Tension" meter", which I think was more of a trespassing mechanic - a warning that if you were caught in that area, you would be confronted and a fight would likely start. A similar meter for long resting might work.

There should be some limit or consequence for long rests, but I'm not sure the way to do it. "Random encounters" at camp if you chose to rest in an unsafe spot isn't really an option because the amount of NPC's an party members in camp would make the combat take forever.