Righteousness is an expression of God's holiness. God always does what is righteous or just. His actions toward us are always in perfect agreement with his holy nature. The standard of righteousness is not made up by men, outside of God, to which God must conform. God is not subject to anything outside himself. Psalm 11 portrays God as righteous in anger and hatred. He hates the violent and the wicked.
We are righteous when our actions reflect God's righteousness. That is why we have the commandments. They are God's righteous standards for us. We are to hunger and thirst after righteousness because we love God and want to please him.