There being no Ukrainian state at the time, he was appropriated by the Russian literature as a quintessential Russian writer, but his sympathetic sentiment towards the Cossack tradition is well-known (and obvious in his texts), and one can make a good argument that in his early stuff he is more subversive about the entire Russian empire thing than a naive reader may think. (Ok, his late stuff is also subtle, but in a different way.) One has to realize that in an empire, with official censorship etc, one cannot be openly anti-czarist.
Here is a nice paper highlighting some of the subtleties in Taras Bulba: https://cius-archives.ca/items/show/1514