לְךָ֤ אֲדֹנָי֙ הַצְּדָקָ֔ה וְלָ֛נוּ בֹּ֥שֶׁת הַפָּנִ֖ים כַּיּ֣וֹם הַזֶּ֑ה לְאִ֤ישׁ יְהוּדָה֙ וּלְיוֹשְׁבֵ֣י יְרֽוּשָׁלִַ֔ם וּֽלְכָל־יִשְׂרָאֵ֞ל הַקְּרֹבִ֣ים וְהָרְחֹקִ֗ים בְּכָל־הָֽאֲרָצוֹת֙ אֲשֶׁ֣ר הִדַּחְתָּ֣ם שָׁ֔ם בְּמַעֲלָ֖ם אֲשֶׁ֥ר מָֽעֲלוּ־בָֽךְ׃
Unto Thee, O Lord, belongeth righteousness, but unto us confusion of face, as at this day; to the men of Judah, and to the inhabitants of Jerusalem, and unto all Israel, that are near, and that are far off, through all the countries whither Thou hast driven them, because they dealt treacherously with Thee.
Rashi on Daniel
To you, O Lord, is the righteousness i.e., Your judgments and retributions that You have brought upon us—justice and righteousness are with You.
Rashi on Daniel
and to us is the shamefacedness We should be ashamed for what has happened to us, for we caused it for ourselves.