Question: "Why does God allow Satan to attack us?"
Answer: It is true that God allows Satan a certain amount of freedom (see Job 1:12), but it should be understood that it is Satan's choice to attack God's children (see 1 Peter 5:8). It was never in God's original design for humanity, i.e. Adam and Eve, to suffer attacks from Satan. But when Adam disobeyed God, humanity was subject to the consequences of sin, one of which is being open to attacks from Satan. It is part of our fallen nature.
In a real sense, it is humanity's fault for opening the door to satanic attack. Therefore, we cannot blame God that we are vulnerable to satanic attack. In fact, when Satan attacked Job through the loss of his family, wealth, and health, he didn't blame God. Notice Job 1:21-22, "And he (Job) said: Naked I came from my mother's womb, and naked shall I return there. The Lord gave, and the Lord has taken away; blessed be the name of the Lord. In all this Job did not sin nor charge God with wrong."
As believers experience the attacks of Satan, they can take to heart the truth of Romans 8:28, "We know that all things work together for good to those who love God..." Therefore, the assumption is that we will experience "good" things and "bad" things, but "all" of these things can be made to be "good" as God works them out. So even the attacks of Satan can be considered "good" as God uses them in our lives to conform us to Christ, His Son (see Romans 8:29). Attacks from Satan, along with all other tribulations will cause believers to love God more, resist Satan more, practice patience, resist temptation, and grow stronger in our faith in many other ways. Praise God for His abundant protection from Satan most of the time, as well as be thankful for God's plan to make the occasional attacks of Satan "work together for good" for you!