Suspicious multiple warnings about encoding on binary files

Hello @lrozenblyum ,

thanks for reporting the issue!

TL;DR: The Docker analysis is not actually analyzing those files. The logs come from trying to determine the git status to determine if we actually should analyze the file.

Looking into the issue in more detail, the warning is not coming directly from the Docker analysis.

To determine which files should be analyzed for the Docker analysis, the Docker Sensor receives the files from the Scanner Engine.

Inside the Scanner Engine is an optimization, which restricts the files, the Docker Sensor receives, to only changed files (Sensor IaC Docker Sensor is restricted to changed files only) when running an analysis inside a Pull Request.

In order to determine which files are changed or not, the scanner calculates some metadata for all files. Most importantly here, it calculates the git status.

However while calculating this metadata, the scanner also tries to reason about the charset used in the file, where the WARNING log messages stem from.

This is all happening before the Docker analysis, so these files never reach the Docker analyzer. They’re definitely not analyzed here and changing the Docker file patterns won’t make any difference.

If you want to exclude the files in question completely, also from the scanner, you can add them to the exclusions via sonar.exclusions .

In your case I would imagine to exclude them like sonar.exclusions=**/*.dll

I hope this resolves the issue, let us know if you have further questions.

I’ll additionally mention this to the Scanner experts, to see if we can improve the situation here.

Best

Jonas