File tree 3 files changed +14
-5
lines changed
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -137,17 +137,24 @@ var LibraryMap = map[string]string{
137
137
"Gemfile.lock" : "ruby" ,
138
138
"Cargo.lock" : "rust" ,
139
139
"composer.lock" : "php" ,
140
+ "requirements.txt" : "python" ,
140
141
"Pipfile.lock" : "python" ,
141
142
"poetry.lock" : "python" ,
142
143
"packages.lock.json" : ".net" ,
144
+ "packages.config" : ".net" ,
143
145
"go.sum" : "gomod" ,
146
+ "pom.xml" : "java" ,
147
+ "*.jar" : "java" ,
148
+ "*.war" : "java" ,
149
+ "*.ear" : "java" ,
150
+ "*.par" : "java" ,
144
151
}
145
152
146
153
// GetLibraryKey returns target library key
147
154
func (s LibraryScanner ) GetLibraryKey () string {
148
155
fileName := filepath .Base (s .LockfilePath )
149
156
switch s .Type {
150
- case "jar" , "war" , "ear" :
157
+ case "jar" , "war" , "ear" , "par" :
151
158
return "java"
152
159
}
153
160
return LibraryMap [fileName ]
Original file line number Diff line number Diff line change @@ -592,12 +592,12 @@ func (l *base) scanLibraries() (err error) {
592
592
if l .ServerInfo .FindLock {
593
593
findopt := ""
594
594
for filename := range models .LibraryMap {
595
- findopt += fmt .Sprintf ("-name %q -o " , "*" + filename )
595
+ findopt += fmt .Sprintf ("-name %q -o " , filename )
596
596
}
597
597
598
598
// delete last "-o "
599
- // find / -name "* package-lock.json" -o -name "* yarn.lock" ... 2>&1 | grep -v "find: "
600
- cmd := fmt .Sprintf (`find / ` + findopt [:len (findopt )- 3 ] + ` 2>&1 | grep -v "find: "` )
599
+ // find / -type f -and \( - name "package-lock.json" -o -name "yarn.lock" ... \) 2>&1 | grep -v "find: "
600
+ cmd := fmt .Sprintf (`find / -type f -and \( ` + findopt [:len (findopt )- 3 ] + ` \) 2>&1 | grep -v "find: "` )
601
601
r := exec (l .ServerInfo , cmd , noSudo )
602
602
if r .ExitStatus != 0 && r .ExitStatus != 1 {
603
603
return xerrors .Errorf ("Failed to find lock files" )
Original file line number Diff line number Diff line change @@ -185,12 +185,12 @@ func printConfigToml(ips []string) (err error) {
185
185
#keyPath = "/home/username/.ssh/id_rsa"
186
186
#scanMode = ["fast", "fast-root", "deep", "offline"]
187
187
#scanModules = ["ospkg", "wordpress", "lockfile", "port"]
188
+ #lockfiles = ["/path/to/package-lock.json"]
188
189
#cpeNames = [
189
190
# "cpe:/a:rubyonrails:ruby_on_rails:4.2.1",
190
191
#]
191
192
#owaspDCXMLPath = "/tmp/dependency-check-report.xml"
192
193
#ignoreCves = ["CVE-2014-6271"]
193
- #containersOnly = false
194
194
#containerType = "docker" #or "lxd" or "lxc" default: docker
195
195
#containersIncluded = ["${running}"]
196
196
#containersExcluded = ["container_name_a"]
@@ -209,6 +209,8 @@ host = "{{$ip}}"
209
209
#scanModules = ["ospkg", "wordpress", "lockfile", "port"]
210
210
#type = "pseudo"
211
211
#memo = "DB Server"
212
+ #findLock = true
213
+ #lockfiles = ["/path/to/package-lock.json"]
212
214
#cpeNames = [ "cpe:/a:rubyonrails:ruby_on_rails:4.2.1" ]
213
215
#owaspDCXMLPath = "/path/to/dependency-check-report.xml"
214
216
#ignoreCves = ["CVE-2014-0160"]
You can’t perform that action at this time.
0 commit comments