stevespringett / nist-data-mirror

A simple Java command-line utility to mirror the CVE JSON data from NIST.
Apache License 2.0
206 stars 93 forks source link

Allow to add volume and configure DNS in HELM chart. #58

Closed mookkiah closed 3 years ago

mookkiah commented 4 years ago

Problem 1: The java command which runs to update the mirror is failing due to certificates issue. We have our internal proxy which uses internal CA which needs to be installed in host machine.

#java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -jar -Dhttp.proxyHost="${proxy_host}" -Dhttp.proxyPort="${proxy_port}" /usr/local/bin/nist-data-mirror.jar /tmp/nvd 
Downloading https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2011.meta
Download failed : java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Solutions:

    • extend the image and add certificate.
    • mount the /etc/pki/java/cacerts file.

For solution 2, helm chart should support additional volume.

Problem 2: The java command for downloading mirror failed. The reason for this, the nvd.nist.gov is not resolvable. This is due to the nature of base image

Not able to resolve hostname
Downloading https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2020.json.gz
Download failed : nvd.nist.gov
bash-4.4# nslookup nvd.nist.gov
nslookup: can't resolve '(null)': Name does not resolve

nslookup: can't resolve 'nvd.nist.gov': Name does not resolve
bash-4.4# nslookup nvd.nist.gov.
nslookup: can't resolve '(null)': Name does not resolve

Name:      nvd.nist.gov.
Address 1: 54.85.30.225 ec2-54-85-30-225.compute-1.amazonaws.com
Address 2: 2600:1f18:268d:1d01:f609:5e91:8a48:f546

Solution: Change dns config (/etc/resolve.conf) with proper ndots value. HELM chart should support configuring dns config

mookkiah commented 4 years ago

@stevespringett , I will make the pull request for this issue in few hours.

mookkiah commented 4 years ago

Pull request created - https://github.com/stevespringett/nist-data-mirror/pull/59

mookkiah commented 3 years ago

I see the PR merged. closing the issue.