German Shepherds are protective by nature. That being said, generations of being overbred has lead to GSDs that are not true to the standard.
There is no guarantee. Some dogs just aren't. But a well bred German Shepherd (from working lines from a breeder who titles and health certs their dogs) will be more apt to have this trait. You will pay alot of money, but it is worth it.
Both of mine are protective, not aggressive though. When I am running with my oldest, he is aware of everything that is going on. He is also protective of the house and of my lab. He has never been challenged. I honestly don't know what he would do, but his barks and looks are deterrant enough for most not to try.
GSDs tend to be aloof with strangers. I doubt they would protect someone they do not know but you never know. It may depend on the situation.
ETA- training is important. Aggressive behavior should not be seen as being protective. There is a very big difference. Both of mine are very social dogs, but still watchful at the same time. My oldest even herds people away from the edge of our pool. They will bark when someone comes in the house, but stop when I answer the door. Depending on how I recieve the person, the act appropriately. If I smile and invite you in, they turn into tail wagging attention hogs.
Owned by 2 GSDs and a Lab