diff --git a/ant/pom.xml b/ant/pom.xml index 7d496651d73..9f3e8b21a9a 100644 --- a/ant/pom.xml +++ b/ant/pom.xml @@ -89,25 +89,6 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved. - - copy-test-upgrade-script - pre-integration-test - - copy-resources - - - ${project.build.directory}/test-classes/data - - - ${basedir}/../core/src/test/resources/data - false - - upgrade_4.2.sql - - - - - copy-test-resources-1 pre-integration-test @@ -184,26 +165,6 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved. - - copy-data - pre-integration-test - - copy-resources - - - ${project.build.directory}/test-classes - - - ${basedir}/../src/test/resources - false - - db.cve.zip - index.cpe.zip - - - - - diff --git a/core/src/main/resources/data/upgrade_2.9.sql b/core/src/main/resources/data/upgrade_2.9.sql deleted file mode 100644 index 20603809a53..00000000000 --- a/core/src/main/resources/data/upgrade_2.9.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE Properties SET `value`='3.0' WHERE ID='version'; diff --git a/core/src/main/resources/data/upgrade_3.0.sql b/core/src/main/resources/data/upgrade_3.0.sql deleted file mode 100644 index e27316dd158..00000000000 --- a/core/src/main/resources/data/upgrade_3.0.sql +++ /dev/null @@ -1,55 +0,0 @@ -SET REFERENTIAL_INTEGRITY FALSE; -TRUNCATE TABLE reference; -TRUNCATE TABLE vulnerability; -TRUNCATE TABLE software; -TRUNCATE TABLE cpeEntry; -SET REFERENTIAL_INTEGRITY TRUE; - - -ALTER TABLE vulnerability ALTER COLUMN cvssScore RENAME TO cvssV2Score; -ALTER TABLE vulnerability ALTER COLUMN cvssAccessVector RENAME TO cvssV2AccessVector; -ALTER TABLE vulnerability ALTER COLUMN cvssAccessComplexity RENAME TO cvssV2AccessComplexity; -ALTER TABLE vulnerability ALTER COLUMN cvssAuthentication RENAME TO cvssV2Authentication; -ALTER TABLE vulnerability ALTER COLUMN cvssConfidentialityImpact RENAME TO cvssV2ConfidentialityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssIntegrityImpact RENAME TO cvssV2IntegrityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssAvailabilityImpact RENAME TO cvssV2AvailabilityImpact; -ALTER TABLE vulnerability DROP COLUMN cwe; -ALTER TABLE vulnerability ADD COLUMN cvssV2Severity VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3AttackVector VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3AttackComplexity VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3PrivilegesRequired VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3UserInteraction VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3Scope VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3ConfidentialityImpact VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3IntegrityImpact VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3AvailabilityImpact VARCHAR(20); -ALTER TABLE vulnerability ADD COLUMN cvssV3BaseScore DECIMAL(3,1); -ALTER TABLE vulnerability ADD COLUMN cvssV3BaseSeverity VARCHAR(20); - - -CREATE TABLE cweEntry (cveid INT, cwe VARCHAR(20), - CONSTRAINT fkCweEntry FOREIGN KEY (cveid) REFERENCES vulnerability(id) ON DELETE CASCADE); -CREATE INDEX idxCwe ON cweEntry(cveid); - -ALTER TABLE cpeEntry DROP COLUMN cpe; -ALTER TABLE cpeEntry ADD COLUMN version VARCHAR(255); -ALTER TABLE cpeEntry ADD COLUMN update_version VARCHAR(255); -ALTER TABLE cpeEntry ADD COLUMN edition VARCHAR(255); -ALTER TABLE cpeEntry ADD COLUMN lang VARCHAR(20); -ALTER TABLE cpeEntry ADD COLUMN sw_edition VARCHAR(255); -ALTER TABLE cpeEntry ADD COLUMN target_sw VARCHAR(255); -ALTER TABLE cpeEntry ADD COLUMN target_hw VARCHAR(255); -ALTER TABLE cpeEntry ADD COLUMN other VARCHAR(255); -DROP INDEX idxCpeEntry; -CREATE INDEX idxCpeEntry ON cpeEntry(vendor, product, version, update_version, edition, lang, sw_edition, target_sw, target_hw, other); - -ALTER TABLE software DROP COLUMN previousversion; -ALTER TABLE software ADD COLUMN versionEndExcluding VARCHAR(50); -ALTER TABLE software ADD COLUMN versionEndIncluding VARCHAR(50); -ALTER TABLE software ADD COLUMN versionStartExcluding VARCHAR(50); -ALTER TABLE software ADD COLUMN versionStartIncluding VARCHAR(50); -ALTER TABLE software ADD COLUMN vulnerable BOOLEAN; - - -DELETE FROM properties WHERE ID like 'NVD CVE%'; -UPDATE Properties SET `value`='4.0' WHERE ID='version'; \ No newline at end of file diff --git a/core/src/main/resources/data/upgrade_4.0.sql b/core/src/main/resources/data/upgrade_4.0.sql deleted file mode 100644 index bd3210ec226..00000000000 --- a/core/src/main/resources/data/upgrade_4.0.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE cpeEntry ADD COLUMN part CHAR(1); -UPDATE cpeEntry SET part='a'; -CREATE INDEX idxCpeEntry ON cpeEntry(part, vendor, product, version, update_version, edition, lang, sw_edition, target_sw, target_hw, other); - -ALTER TABLE cpeEntry ADD COLUMN ecosystem VARCHAR(255); - -UPDATE Properties SET `value`='4.1' WHERE ID='version'; diff --git a/core/src/main/resources/data/upgrade_4.1.sql b/core/src/main/resources/data/upgrade_4.1.sql deleted file mode 100644 index ec89d1d27c9..00000000000 --- a/core/src/main/resources/data/upgrade_4.1.sql +++ /dev/null @@ -1,34 +0,0 @@ -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='CMAKE'; -UPDATE CPEENTRY SET ECOSYSTEM='php' WHERE ECOSYSTEM='Composer'; -UPDATE CPEENTRY SET ECOSYSTEM='java' WHERE ECOSYSTEM='Java'; -UPDATE CPEENTRY SET ECOSYSTEM='java' WHERE ECOSYSTEM='android'; -UPDATE CPEENTRY SET ECOSYSTEM='nodejs' WHERE ECOSYSTEM='npm'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='windows'; -UPDATE CPEENTRY SET ECOSYSTEM='ios' WHERE ECOSYSTEM='iphone_os'; -UPDATE CPEENTRY SET ECOSYSTEM='nodejs' WHERE ECOSYSTEM='node.js'; -UPDATE CPEENTRY SET ECOSYSTEM='ios' WHERE ECOSYSTEM='mac_os_x'; -UPDATE CPEENTRY SET ECOSYSTEM='php' WHERE ECOSYSTEM='wordpress'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='linux'; -UPDATE CPEENTRY SET ECOSYSTEM='dotnet' WHERE ECOSYSTEM='asp.net'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='linux_kernel'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='c/c++'; -UPDATE CPEENTRY SET ECOSYSTEM='ruby' WHERE ECOSYSTEM='puppet'; -UPDATE CPEENTRY SET ECOSYSTEM='dotnet' WHERE ECOSYSTEM='.net'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='unix'; -UPDATE CPEENTRY SET ECOSYSTEM='dotnet' WHERE ECOSYSTEM='c#'; -UPDATE CPEENTRY SET ECOSYSTEM='php' WHERE ECOSYSTEM='typo3'; -UPDATE CPEENTRY SET ECOSYSTEM='php' WHERE ECOSYSTEM='mybb'; -UPDATE CPEENTRY SET ECOSYSTEM='php' WHERE ECOSYSTEM='joomla!'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='suse_linux'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='redhat_enterprise_linux'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='debian'; -UPDATE CPEENTRY SET ECOSYSTEM='php' WHERE ECOSYSTEM='joomla'; -UPDATE CPEENTRY SET ECOSYSTEM='js' WHERE ECOSYSTEM='jquery'; -UPDATE CPEENTRY SET ECOSYSTEM='php' WHERE ECOSYSTEM='simplesamlphp'; -UPDATE CPEENTRY SET ECOSYSTEM='ruby' WHERE ECOSYSTEM='puppet_enterprise'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='borland_c++'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='visual_c++'; -UPDATE CPEENTRY SET ECOSYSTEM='native' WHERE ECOSYSTEM='gnu_c++'; -UPDATE CPEENTRY SET ECOSYSTEM=null WHERE ECOSYSTEM NOT IN ('ruby', 'dotnet', 'cmake', 'ios', 'php', 'golang', 'java', 'native', 'python', 'js', 'nodejs', 'rust', 'coldfusion', 'perl', 'exlixir'); - -UPDATE Properties SET `value`='4.2' WHERE ID='version'; diff --git a/core/src/main/resources/data/upgrade_5.0.sql b/core/src/main/resources/data/upgrade_5.0.sql deleted file mode 100644 index 0c7231634e1..00000000000 --- a/core/src/main/resources/data/upgrade_5.0.sql +++ /dev/null @@ -1,5 +0,0 @@ -UPDATE cpeecosystemcache SET ecosystem='MULTIPLE' WHERE vendor='tensorflow' AND product='tensorflow'; - -UPDATE cpeecosystemcache SET ecosystem='MULTIPLE' WHERE vendor='scikit-learn' AND product='scikit-learn'; - -UPDATE Properties SET `value`='5.1' WHERE ID='version'; diff --git a/core/src/main/resources/data/upgrade_5.1.sql b/core/src/main/resources/data/upgrade_5.1.sql deleted file mode 100644 index ba0f7e75330..00000000000 --- a/core/src/main/resources/data/upgrade_5.1.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE software ALTER COLUMN versionEndExcluding SET DATA TYPE VARCHAR(60); -ALTER TABLE software ALTER COLUMN versionEndIncluding SET DATA TYPE VARCHAR(60); -ALTER TABLE software ALTER COLUMN versionStartExcluding SET DATA TYPE VARCHAR(60); -ALTER TABLE software ALTER COLUMN versionStartIncluding SET DATA TYPE VARCHAR(60); - -UPDATE Properties SET `value`='5.2' WHERE ID='version'; \ No newline at end of file diff --git a/core/src/main/resources/data/upgrade_5.2.1.sql b/core/src/main/resources/data/upgrade_5.2.1.sql deleted file mode 100644 index a82a2dba76f..00000000000 --- a/core/src/main/resources/data/upgrade_5.2.1.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE software ALTER COLUMN versionEndExcluding SET DATA TYPE VARCHAR(100); -ALTER TABLE software ALTER COLUMN versionEndIncluding SET DATA TYPE VARCHAR(100); -ALTER TABLE software ALTER COLUMN versionStartExcluding SET DATA TYPE VARCHAR(100); -ALTER TABLE software ALTER COLUMN versionStartIncluding SET DATA TYPE VARCHAR(100); - -UPDATE Properties SET `value`='5.3' WHERE ID='version'; \ No newline at end of file diff --git a/core/src/main/resources/data/upgrade_5.2.sql b/core/src/main/resources/data/upgrade_5.2.sql deleted file mode 100644 index 3ff3121a047..00000000000 --- a/core/src/main/resources/data/upgrade_5.2.sql +++ /dev/null @@ -1,4 +0,0 @@ -UPDATE cpeEcosystemCache set ecosystem='MULTIPLE' where vendor = 'icu-project' and product = 'international_components_for_unicode'; -INSERT INTO cpeEcosystemCache (vendor, product, ecosystem) VALUES ('unicode', 'international_components_for_unicode', 'MULTIPLE'); - -UPDATE Properties SET `value`='5.2.1' WHERE ID='version'; \ No newline at end of file diff --git a/core/src/test/resources/data/upgrade_4.2.sql b/core/src/test/resources/data/upgrade_4.2.sql deleted file mode 100644 index 9c59a88ea46..00000000000 --- a/core/src/test/resources/data/upgrade_4.2.sql +++ /dev/null @@ -1,37 +0,0 @@ -ALTER TABLE vulnerability ALTER COLUMN cvssV2Severity RENAME TO v2Severity; -ALTER TABLE vulnerability ALTER COLUMN cvssV2Score RENAME TO v2Score; -ALTER TABLE vulnerability ALTER COLUMN cvssV2AccessVector RENAME TO v2AccessVector; -ALTER TABLE vulnerability ALTER COLUMN cvssV2AccessComplexity RENAME TO v2AccessComplexity; -ALTER TABLE vulnerability ALTER COLUMN cvssV2Authentication RENAME TO v2Authentication; -ALTER TABLE vulnerability ALTER COLUMN cvssV2ConfidentialityImpact RENAME TO v2ConfidentialityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssV2IntegrityImpact RENAME TO v2IntegrityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssV2AvailabilityImpact RENAME TO v2AvailabilityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssV3AttackVector RENAME TO v3AttackVector; -ALTER TABLE vulnerability ALTER COLUMN cvssV3AttackComplexity RENAME TO v3AttackComplexity; -ALTER TABLE vulnerability ALTER COLUMN cvssV3PrivilegesRequired RENAME TO v3PrivilegesRequired; -ALTER TABLE vulnerability ALTER COLUMN cvssV3UserInteraction RENAME TO v3UserInteraction; -ALTER TABLE vulnerability ALTER COLUMN cvssV3Scope RENAME TO v3Scope; -ALTER TABLE vulnerability ALTER COLUMN cvssV3ConfidentialityImpact RENAME TO v3ConfidentialityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssV3IntegrityImpact RENAME TO v3IntegrityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssV3AvailabilityImpact RENAME TO v3AvailabilityImpact; -ALTER TABLE vulnerability ALTER COLUMN cvssV3BaseScore RENAME TO v3BaseScore; -ALTER TABLE vulnerability ALTER COLUMN cvssV3BaseSeverity RENAME TO v3BaseSeverity; -ALTER TABLE vulnerability ADD COLUMN v2ExploitabilityScore DECIMAL(3,1); -ALTER TABLE vulnerability ADD COLUMN v2ImpactScore DECIMAL(3,1); -ALTER TABLE vulnerability ADD COLUMN v2AcInsufInfo BOOLEAN; -ALTER TABLE vulnerability ADD COLUMN v2ObtainAllPrivilege BOOLEAN; -ALTER TABLE vulnerability ADD COLUMN v2ObtainUserPrivilege BOOLEAN; -ALTER TABLE vulnerability ADD COLUMN v2ObtainOtherPrivilege BOOLEAN; -ALTER TABLE vulnerability ADD COLUMN v2UserInteractionRequired BOOLEAN; -ALTER TABLE vulnerability ADD COLUMN v2Version VARCHAR(5); -ALTER TABLE vulnerability ADD COLUMN v3ExploitabilityScore DECIMAL(3,1); -ALTER TABLE vulnerability ADD COLUMN v3ImpactScore DECIMAL(3,1); -ALTER TABLE vulnerability ADD COLUMN v3Version VARCHAR(5); - -CREATE TABLE cpeEcosystemCache (vendor VARCHAR(255), product VARCHAR(255), ecosystem VARCHAR(255), PRIMARY KEY (vendor, product)); -INSERT INTO cpeEcosystemCache (vendor, product, ecosystem) VALUES ('apache', 'zookeeper', 'MULTIPLE'); - -CREATE ALIAS update_vulnerability FOR "org.owasp.dependencycheck.data.nvdcve.H2Functions.updateVulnerability"; -CREATE ALIAS insert_software FOR "org.owasp.dependencycheck.data.nvdcve.H2Functions.insertSoftware"; - -UPDATE Properties SET `value`='5.0' WHERE ID='version'; diff --git a/src/test/resources/data.zip b/src/test/resources/data.zip index a23e70a40e6..6bf98f3eedf 100644 Binary files a/src/test/resources/data.zip and b/src/test/resources/data.zip differ