One aspect of defending against potential malicious attacks is ignored or underplayed in today's society I think. Well underplayed in Paganism in general though it is pretty well utilized in Afro-Caribbean Disapora practices. . Yet it is perhaps one of the easiest to safe guard against That is the usage of the "dead" to act upon the living.
The means is via a curse type table or workings. Not the type where you caste it upon a person but call upon the shades of the restless dead. The practitioner takes and makes a binding or curse tablet and places it in a graveyard, especially an older one where the unholy might have been buried. Note unholy is not in the biblical sense of the word. Use an inscription to call upon them to perform your task and make the promise of providing a proper funeral rite or appropriate offerings and blessings for them if they do as you ask. Others can be done via asking ones gods / goddesses to call upon the dead and compel them to do your tasking. Hekate / Hecate is one that is often referenced in archaic practices but any chthonic god / goddess could aid you. From a Voudoo, HooDoo, Voudon, Santeria (Disapora practices) perspective one might call upon certain Orisha or Loa's (sorry not my specialty but have a bit of knowledge). Again proper offerings, sacrifices, etc to call upon the dead or divine / semi-divine forces.
Persons who have been buried without proper ritual, ceremony and thanks / recognition in many beliefs can be compelled to perform "actions" for a would be practitioner. Many times minor actions such as simply to haunt the persons dreams and give them restless nights. Other times to even go to the extent of causing a physical death to the targeted individual. In rare occasions to mind trap the individual and take effective control over their lives and to some extent their bodies. Almost zombie like in how the person so attacked looses control and becomes a patsy for the practitioner who has called upon such powers. Figure for instance a person who identifies as pagan, lets say Nordic for example, dies and is buried under Christian proceedings. That shade is a prime candidate for being bribed as the burial rituals and such maybe seen as being ineffective or appropriate to allow the shade to crossover and drop its earthly garb.
The easiest and perhaps most affective / effective means of blocking such actions is to provide provide crossing ceremonies and honorings for ones family members or friends. Singing of travelings songs of honor and praise for the deceased and letting the spirit world know of their crossing. Adding the death meal plate to ones table is also a means of honoring and providing for the spirits of the deceased who wander between the worlds. Sometimes it's as simple as praying over the graves of those who died violent deaths, untimely deaths, scorned deaths or even self inflicted deaths. Perhaps the hardest is the forgiveness of the deceased that lay buried in unhallowed ground.
Recognition of such an attack can be difficult but not impossible to detect. One such indicator is the constant nightmares, night frights perhaps even things like being ridden by a night hag. A lot of times its the recognition of the deceased in your dreams and potentially visions of them in your waking moments. Occasionally there will be a aromatic association with things of the grave.
Under old Hellenic influences the practitioner frequently offers to perform the required burial rituals, offerings, honorings, etc to the shade once it has done the desired tasks. Though not seen today that I am aware of one could also gain control over the deceased by holding some item(s) of the deceased and using it to call their spirit forth. Folk lore wise one indicator of said trapping occurring would be visible during the funeral itself, that being if birds didn't scream the spirit was captured. If the birds became very noisy and flighty the soul or shade evaded capture and crossed over or was guided to what ever boundary or waiting place its spirituality / religious practices provided for. For some native American nations passing through a graveyard or funeral area was sufficient enough to disturb the dead and cause them to walk and become troublesome until proper steps were taken to return the shade to its hereafter.
As I said though not exceptionally acknowledged today as a means of creating malicious actions against a person but still something to consider and keep in ones skill sets I'd think.