Suppose we have two bodies A and B, they are connected to each other with an ideal string of length $L$. Then is this system a rigid body? This system has 5 degrees of freedom ( 6-1 constraint). But a rigid body in 3D has 6 degrees of freedom. What am I missing here?
First, normally a string is something that can get shorter, not a full constraint, only a "less or equal". I'll assume you mean a rod.
Second, a body is something different than a mass point, and has already 6 degrees. If you mean two mass points, than 5 degrees are correct for two points joined by a rod. But that's a coincidence, actually :) see next paragraph.
Two bodies joined by a rod are one rigid body, which has to have 6 degrees. Now let's count them differently, subtracting from 12.
The rotation of both has to coincide, that's minus three. And the difference of the positions has to be consistent with the rotation, that's again minus three. So in the sum we have six.
If the rod allows independent rotations around its axis, you get one degree more. If the rotation around its axis doesn't change the system (like in the case with two mass points), there is one degree less.