judge advocate

noun

1.
an officer assigned to the judge advocate general
2.
a staff officer serving as legal adviser to a military commander