Old-testament wise, satan is neutral, god is allmightly.
Satan just means "adversary". He's the prosecution counsel, in charge of the trial over the fate of mankind, and individual humans in general. He tempts humans to sin, and if they fail to resist, he makes his case that the human is not fit to enter heaven.
That's basically it.
This is why God and Satan are so buddy-buddy in the story of Job.
According to ancient Hebrew mysticism, Sheol, "the grave", was a temporary holding place divided into 3 areas. One for very unrighteous dead, one for the ambiguously righteous, and one for the righteous. Each section was divided by an uncrossable river. (Descriptions given in first Enoch, apocryphal book)
Christ ended this area, when he descended into "hell" (ahem), and extracted the souls from there. To be deemed worthy of that, he had to live a perfectly virtuous life, and all that noise, which is why the adversary tested him.
The modern notions of "The devil" are very much European constructions, created by the catholic church. Even the word "Hell" is a loanword of European origin. The most foundation they have, is the few quotations about the prince of the morning star, as previously cited.
Satan serves a purpose. That purpose is not at odds with God's purpose, at least in the old testament. It is just at odds with human interest. Unlike what most people seem to think is appropriate for a "Good" and "Just" god, the hebrew one is uninterested in placating every human want and vice, and seems to hold a much more rigid "no, this is how it must be" approach. I tend to view that approach as less "Arbitrarily officious, totalitarian asshole", and more "Stickler for adhering to necessity, all i's dotted, all t's crossed, because that is how the nature of reality demands it must be, for things to keep working." (where the nature of reality is defined by the cosmology of the religion.)
In that light, the necessity to test mankind is evident, the role of the adversary is seen as necessity, humans getting away with doing whatever they want cannot be permitted, and sinners cannot be allowed in heaven-- as stipulated.