Here is a post of mine from another thread about this topic:
In Jewish thought as can be seen in the book of Job and through out the Talmud, Satan is an agent of God, he is testing and challenging the human character through the evil inclination of man. in the book of Job, we can see that Satan had acted according to permission from God, although if we get a bit intellectual we can see a sort of a mental chess game between Satan and God, with Satan tempting God to give him permission to test job.
as for evil and Satan coming from God. through several books of the Bible indeed it is God who has control over both good and evil, for example see this verse in the book of Isaiah (45:7):
I form the light, and create darkness: I make peace, and create evil: I the LORD do all these things.
While in the English translation of the book of Isaiah in the Hebrew Bible, we find the name Lucifer Son of Dawn for the first time, it is a Latin translation for a figure the Hebrew Bible names as
Heylel Ben Shakhar. Heylel meaning morning star, and
Ben Shakhar meaning Son of Dawn, there is a mythological baggage to this, because the
Canaanites had a personification for the morning star called
Heylel, and in fact
Shakhar (or Dawn) was also a Canaanite deity, the former being the son of the latter. in Latin,
Heylel was translated to Lucifer, meaning Venus, the planet which trumpets the arrival of the dawn, or the 'light bringer' as it were. now the fall of
Heylel signifies two things, in effect it was a prophecy against a Babylonian king and his fall, personified in
Heylel, this fall was dressed on the former Canaanite myth about the deity called
Heylel which tried to ascend above all gods, and eventually fell into the underworld. the metaphor here, is that the oppressors of the Israelites, usually vast empires and rulers would have their moment of glory but would fall. (appearing before morning and lasting only for a moment until the sun comes).
in reality, it took a few centuries before the Christians came to recognize Lucifer with Satan or the devil, and there is documentation of even Christians using the name Lucifer, there is even a 4th century Christian saint named [Saint] Lucifer who was a Bishop in Sardinia.
although the Christian conversion of Lucifer to the devil is based on earlier pre Christian texts of both Pagan and monotheistic sources of a rebellion or defiance against the other gods or God, it seems that Christianity dogmatized this to an extent which programmed this duality on religious thought for centuries to come, some speculate that this chain of events began with the duality found in Zoroastrianism (Ahura Mazada vs. Ahriman), this duality seem to have found a place in Jewish monotheism, and later it became an essential and huge factor in Christianity.