Hello,
I am trying to write another custom configuration, for the Java Security Engine, for the jakarta.ws.rs.core.Response.seeOther method. I want to mark the method as a sink for the S5146 rule. I cannot figure out how I can do it from the documentation.
My dummy code looks like this:
@GET
@Path("/redirect")
@Produces(MediaType.TEXT_PLAIN)
public Response redirectTest(@RestQuery("path") String path) throws Exception {
URI uri = UriBuilder.fromPath(path).build();
return Response.seeOther(uri).build();
}
The configuration that I tried is the following:
{
"common": {
"sources": [
{
"methodId": "org.jboss.resteasy.reactive.RestQuery"
}
]
},
"S5146": {
"sinks": [
{
"methodId": "jakarta.ws.rs.core.Response#seeOther(Ljava/net/URI;)Ljakarta/ws/rs/core/Response$ResponseBuilder;",
"args": [
1
]
}
]
}
}
If I try to do the same for the jakarta.ws.rs.core.UriBuilder.fromPath method it works with this configuration:
{
"common": {
"sources": [
{
"methodId": "org.jboss.resteasy.reactive.RestQuery"
}
]
},
"S5146": {
"sinks": [
{
"methodId": "jakarta.ws.rs.core.UriBuilder#fromPath(Ljava/lang/String;)Ljakarta/ws/rs/core/UriBuilder;",
"args": [
1
]
}
]
}
}
Is the signature for the method not correctly constructed, or the configuration altogether missing something?
Are there some limitations to the SAST Engine custom configuration that I am missing?
I am running Sonar Enterprise, version 10.8.
Thank you