Archived
Exclude the following false positive patterns: - CRLF_INJECTION_LOGS: Log values are internal, not user-controlled - COMMAND_INJECTION: Platform service managers need to run commands - VA_FORMAT_STRING_USES_NEWLINE: Config file generators need \n - DM_CONVERT_CASE: Internal identifiers don't need locale - IMPROPER_UNICODE: Simple parsing doesn't need Unicode handling - EI_EXPOSE_REP: BarnService intentionally exposes components Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
84 lines
2.5 KiB
XML
84 lines
2.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<FindBugsFilter
|
|
xmlns="https://github.com/spotbugs/filter/3.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
|
|
|
|
<!-- Exclude test classes from certain checks -->
|
|
<Match>
|
|
<Source name="~.*Test\.java"/>
|
|
<Or>
|
|
<Bug pattern="DM_DEFAULT_ENCODING"/>
|
|
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
|
|
</Or>
|
|
</Match>
|
|
|
|
<!-- Exclude generated code -->
|
|
<Match>
|
|
<Source name="~.*[\\/]generated[\\/].*"/>
|
|
</Match>
|
|
|
|
<!-- Allow System.exit in Main class -->
|
|
<Match>
|
|
<Class name="com.samsonmedia.barn.Main"/>
|
|
<Bug pattern="DM_EXIT"/>
|
|
</Match>
|
|
|
|
<!-- Allow command execution in specific classes -->
|
|
<Match>
|
|
<Or>
|
|
<Class name="~.*ProcessExecutor.*"/>
|
|
<Class name="~.*CommandRunner.*"/>
|
|
<Class name="~.*ServiceManager.*"/>
|
|
<Class name="~.*WindowsServiceManager.*"/>
|
|
<Class name="~.*SystemdManager.*"/>
|
|
<Class name="~.*LaunchdManager.*"/>
|
|
</Or>
|
|
<Bug pattern="COMMAND_INJECTION"/>
|
|
</Match>
|
|
|
|
<!-- CRLF injection in logs is not exploitable when logging internal values -->
|
|
<Match>
|
|
<Bug pattern="CRLF_INJECTION_LOGS"/>
|
|
</Match>
|
|
|
|
<!-- Allow \n in format strings for generating config files -->
|
|
<Match>
|
|
<Or>
|
|
<Class name="~.*LaunchdManager.*"/>
|
|
<Class name="~.*SystemdManager.*"/>
|
|
</Or>
|
|
<Bug pattern="VA_FORMAT_STRING_USES_NEWLINE"/>
|
|
</Match>
|
|
|
|
<!-- Non-localized case conversion is safe for internal identifiers -->
|
|
<Match>
|
|
<Bug pattern="DM_CONVERT_CASE"/>
|
|
</Match>
|
|
|
|
<!-- Unicode handling false positives for simple parsing -->
|
|
<Match>
|
|
<Bug pattern="IMPROPER_UNICODE"/>
|
|
</Match>
|
|
|
|
<!-- Allow exposing internal representation for service classes -->
|
|
<Match>
|
|
<Class name="~.*BarnService.*"/>
|
|
<Bug pattern="EI_EXPOSE_REP"/>
|
|
</Match>
|
|
|
|
<!-- Exclude false positives for try-with-resources -->
|
|
<Match>
|
|
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
|
|
</Match>
|
|
|
|
<!-- Allow serialization without serialVersionUID for internal classes -->
|
|
<Match>
|
|
<Bug pattern="SE_NO_SERIALVERSIONID"/>
|
|
<Not>
|
|
<Class name="~.*Exception"/>
|
|
</Not>
|
|
</Match>
|
|
|
|
</FindBugsFilter>
|