Skip to content

Commit

Permalink
Report on no binaries in war/jar/ear files
Browse files Browse the repository at this point in the history
  • Loading branch information
antfie committed Mar 29, 2023
1 parent 51d7b54 commit 5cd7ab7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions analyze_modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ func (data Data) analyzeModuleFatalErrors() {
if module.HasFatalErrors {
reason := module.getFatalReason()

if strings.HasPrefix(reason, "No Scannable Binaries") {
if strings.HasSuffix(strings.ToLower(module.Name), ".war") {
data.makeRecommendation("Java war files with no compiled Java classes suggests incorrect packaging and will not be scanned for Java flaws")
data.makeRecommendation("Veracode requires Java application to be compiled into a .jar, .war or .ear file")
data.makeRecommendation("Do not upload Java source code files. They will not be scanned")
} else if strings.HasSuffix(strings.ToLower(module.Name), ".ear") {
data.makeRecommendation("Java ear files with no compiled Java classes suggests incorrect packaging and will not be scanned for Java flaws")
data.makeRecommendation("Veracode requires Java application to be compiled into a .jar, .war or .ear file")
data.makeRecommendation("Do not upload Java source code files. They will not be scanned")
} else if strings.HasSuffix(strings.ToLower(module.Name), ".jar") {
data.makeRecommendation("Java .jar files with no compiled Java classes suggests incorrect packaging and will not be scanned for Java flaws")
data.makeRecommendation("Veracode requires Java application to be compiled into a .jar, .war or .ear file")
data.makeRecommendation("Do not upload Java source code files. They will not be scanned")
}
}

if _, isReasonInMap := errors[reason]; !isReasonInMap {
errors[reason] = []string{}
}
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# !/usr/bin/env sh

ESCAPE=$'\e'
export VERSION="1.14"
export VERSION="1.15"

./build.sh && \

Expand Down

0 comments on commit 5cd7ab7

Please sign in to comment.