Examples of CveDB


Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

     * @param engine a dependency-check engine
     * @param outDirectory the directory to write the reports to
     */
    private void generateExternalReports(Engine engine, File outDirectory) {
        DatabaseProperties prop = null;
        CveDB cve = null;
        try {
            cve = new CveDB();
            cve.open();
            prop = cve.getDatabaseProperties();
        } catch (DatabaseException ex) {
            LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex);
        } finally {
            if (cve != null) {
                cve.close();
            }
        }
        final ReportGenerator r = new ReportGenerator(this.applicationName, engine.getDependencies(), engine.getAnalyzers(), prop);
        try {
            r.generateReports(outDirectory.getCanonicalPath(), this.reportFormat.name());
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

    protected final void openDataStores() throws UpdateException {
        if (cveDB != null) {
            return;
        }
        try {
            cveDB = new CveDB();
            cveDB.open();
        } catch (DatabaseException ex) {
            closeDataStores();
            LOGGER.log(Level.FINE, "Database Exception opening databases", ex);
            throw new UpdateException("Error updating the CPE/CVE data, please see the log file for more details.");
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

     * @param projectName the name of the project that a report is being generated for
     * @param format the format of the report to generate
     */
    static void generateExternalReports(Engine engine, File outDirectory, String projectName, String format) {
        DatabaseProperties prop = null;
        CveDB cve = null;
        try {
            cve = new CveDB();
            cve.open();
            prop = cve.getDatabaseProperties();
        } catch (DatabaseException ex) {
            LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex);
        } finally {
            if (cve != null) {
                cve.close();
            }
        }
        final ReportGenerator r = new ReportGenerator(projectName, engine.getDependencies(), engine.getAnalyzers(), prop);
        try {
            r.generateReports(outDirectory.getCanonicalPath(), format);
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

     * @throws DatabaseException when the database throws an exception. This usually occurs when the database is in use
     * by another process.
     */
    public void open() throws IOException, DatabaseException {
        LOGGER.log(Level.FINE, "Opening the CVE Database");
        cve = new CveDB();
        cve.open();
        LOGGER.log(Level.FINE, "Creating the Lucene CPE Index");
        cpe = CpeMemoryIndex.getInstance();
        try {
            cpe.open(cve);
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

     * @throws NoDataException thrown if no data exists in the CPE Index
     * @throws DatabaseException thrown if there is an exception opening the database
     */
    private void ensureDataExists() throws NoDataException, DatabaseException {
        final CpeMemoryIndex cpe = CpeMemoryIndex.getInstance();
        final CveDB cve = new CveDB();

        try {
            cve.open();
            cpe.open(cve);
        } catch (IndexException ex) {
            throw new NoDataException(ex.getMessage(), ex);
        } catch (DatabaseException ex) {
            throw new NoDataException(ex.getMessage(), ex);
        } finally {
            cve.close();
        }
        if (cpe.numDocs() <= 0) {
            cpe.close();
            throw new NoDataException("No documents exist");
        }
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

        Engine instance = new Engine();
        Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
        instance.scan(testClasses);
        assertTrue(instance.getDependencies().size() > 0);
        instance.analyzeDependencies();
        CveDB cveDB = new CveDB();
        cveDB.open();
        DatabaseProperties dbProp = cveDB.getDatabaseProperties();
        cveDB.close();
        ReportGenerator rg = new ReportGenerator("DependencyCheck", instance.getDependencies(), instance.getAnalyzers(), dbProp);
        rg.generateReports("./target/", "ALL");
        instance.cleanup();
    }
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

        engine.scan(struts);
        engine.scan(axis);
        engine.scan(jetty);
        engine.analyzeDependencies();

        CveDB cveDB = new CveDB();
        cveDB.open();
        DatabaseProperties dbProp = cveDB.getDatabaseProperties();
        cveDB.close();

        ReportGenerator generator = new ReportGenerator("Test Report", engine.getDependencies(), engine.getAnalyzers(), dbProp);
        generator.generateReport(templateName, writeTo);

        engine.cleanup();
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

     * @throws IOException thrown when there is an IO Exception
     * @throws DatabaseException thrown when there is a database exceptions
     * @throws ClassNotFoundException thrown if the h2 database driver cannot be loaded
     */
    public void open() throws SQLException, IOException, DatabaseException, ClassNotFoundException {
        cveDB = new CveDB();
        cveDB.open();
    }
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

                }
            }
            try {
                engine.analyzeDependencies();
                DatabaseProperties prop = null;
                CveDB cve = null;
                try {
                    cve = new CveDB();
                    cve.open();
                    prop = cve.getDatabaseProperties();
                } catch (DatabaseException ex) {
                    LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex);
                } finally {
                    if (cve != null) {
                        cve.close();
                    }
                }
                final ReportGenerator reporter = new ReportGenerator(applicationName, engine.getDependencies(), engine.getAnalyzers(), prop);
                reporter.generateReports(reportOutputDirectory, reportFormat);
View Full Code Here

Examples of org.owasp.dependencycheck.data.nvdcve.CveDB

            engine.scan(paths);

            engine.analyzeDependencies();
            final List<Dependency> dependencies = engine.getDependencies();
            DatabaseProperties prop = null;
            CveDB cve = null;
            try {
                cve = new CveDB();
                cve.open();
                prop = cve.getDatabaseProperties();
            } catch (DatabaseException ex) {
                LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex);
            } finally {
                if (cve != null) {
                    cve.close();
                }
            }
            final ReportGenerator report = new ReportGenerator(applicationName, dependencies, engine.getAnalyzers(), prop);
            try {
                report.generateReports(reportDirectory, outputFormat);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.