A German shepherd would be an excellent choice for a companion/protection dog. You'll want to start out with a puppy so you can be sure of its level of training and since this is your first dog I would highly recommend training classes you both attend. Classes in a store like PetSmart are good for general training, manners and housebreaking but for protection training you'll want to find a more specialized trainer. Look for trainers that offer Canine Good Citizen classes and working dog classes such as Schutzhund.
Also, where you get your puppy is important. A rescue is fine, you can get a good dog from them but you will likely have no information at all about its lineage or parent's disposition. If you buy from a breeder you really have to do your homework. What do they do with their dogs? Are they working dogs? Show dogs? Do they offer a health guarantee? (If not, RUN!) Are the parents on-site and can you meet them? Is their facility clean and well kept? Are their dogs healthy and well treated?
One sign of a decent breeder is that they will ask you a lot of questions too and maybe even want to see where you'll be keeping your dog. One question to ask of any breeder you're considering buying from: Why do you breed these dogs? If they answer with something other than a love for the breed and a desire to make it the best they can, it's not a good idea to buy from them.