It really just sounds like she is defending you and your home. The first time she did this did you discipline her? She may just need to be told that it is unacceptable behavior.
My husband works at an animal hospital, and said that sometimes dogs get anxiety like people do, and will growl and be aggressive. They do make doggy prozac (reconcile). You can talk to your vet about that.
I hope this helps, GL.