Gradle build of new branch fails with UnexpectedCharacterException SemVer in nebula.release plugin
The best articles and links to interesting posts for technical team leaders building sophisticated websites, applications and mobile apps. Think about: software architecture, hardware architecture, design, programming, frameworks, scalability, performance, quality assurance, security, resolving issues, fixing bugs and Android.
Geplaatst door
Techie
op
2:42 PM
0
reacties
Labels: branch, branch name, exception, gradle, kotlin, nebula, nebula.release, new branch, plugin, semver, Spring Boot 4, UnexpectedCharacterException
Add to:
Del.icio.us
DZone
Reddit
Digg
Recently, the NVD (National Vulnerability Database) which the Owasp dependency check plugin uses to get its data from to check for vulnerabilities, has introduced the use of an API key. That's for them to better control access and throttling - imagine how many companies and organizations are using that API, each time a dependency check build is performed. Especially those that don't cache the NVD database and at each run retrieve it again. And be aware: "... previous versions of dependency-check utilize the NVD data feeds which will be deprecated on Dec 15th, 2023. Versions earlier then 9.0.0 are no longer supported and could fail to work after Dec 15th, 2023."
But this introduction doesn't go without some hiccups. For example it is possible to still get HTTP 403 Forbidden responses, even while you have a valid key. Here's my research while trying to fix it.
Setup:
First you should check if your API key is valid by execution this command:
curl -H "Accept: application/json" -H "apiKey: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -v https://services.nvd.nist.gov/rest/json/cves/2.0\?cpeName\=cpe:2.3:o:microsoft:windows_10:1607:\*:\*:\*:\*:\*:\*:\*
(where xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is your NVD API key)
That should return JSON (and not a 404). Now you know your API key is valid.
Some have some success with setting the delay longer:
nvd {
apiKey = System.getProperty("ENV_NVD_API_KEY")
delay = 6000 // milliseconds, default is 2000 with API key, 8000 without
}
Commandline version:
--nvdDelay 6000
You can also increase the validForHours option, but that doesn't work if during you construct completely new Docker containers each build - you lose that history.
All NVD options you can pass to DependencyCheck are found here.
But currently (27 December 2023) all the above efforts don't always fix the problem of the 403. Sometimes it works for a while, but then not again. If you build many projects in your company at about the same time, you still have a chance of getting throttled of course.
The best solution is to create a local cache so you are less dependent on NVID API calls (and thus the throttling).
Geplaatst door
Techie
op
1:26 PM
0
reacties
Labels: 403, api, dependencycheck, forbidden, gradle, HTTP 403, local cache, NVD, NVD API, nvd.delay, nvd.key
Add to:
Del.icio.us
DZone
Reddit
Digg