Git Product home page Git Product logo

Comments (5)

hidekuno avatar hidekuno commented on July 19, 2024
alter table jvn_vulnerability rename to jvn_vulnerability_old;
insert into jvn_vulnerability(
identifier,title,link,description,issued_date,modified_date,public_date,ticket_modified_date)
select * from jvn_vulnerability_old;

\copy jvn_cwe_work FROM '/var/jvn/cwe.txt';

update jvn_vulnerability a
set    cweid = b.cweid, cwetitle=b.cwetitle
from   jvn_cwe_work as b
where  a.identifier = b.identifier;

drop table jvn_vulnerability_old;

from jvn.

hidekuno avatar hidekuno commented on July 19, 2024
select cwetitle, count(cwetitle) as c from jvn_vulnerability group by cwetitle order by c desc;

from jvn.

hidekuno avatar hidekuno commented on July 19, 2024
cd ~/JVNDB/work/
cat cwe_kind.txt  | while read LINE; do rec=($LINE); grep "${rec[1]}" no_cwe.txt; [ $? -eq 0 ] && echo $LINE; done|tac
cat result.txt | awk -F, '/^CWE.[0-9]*/{cwe=$1}/^JVNDB/{print $1 "\t" cwe;}'

from jvn.

hidekuno avatar hidekuno commented on July 19, 2024
CREATE TEMPORARY TABLE jvn_cwe_master (
 id serial NOT NULL PRIMARY KEY,
 cweid       varchar(32),
 cwetitle    text
);
insert into jvn_cwe_master(cweid, cwetitle) select distinct cweid, cwetitle from jvn_vulnerability order by cweid;
select identifier, title, cweid, cwetitle from jvn_vulnerability a
where  cweid is not null
and not exists (select 1 from jvn_cwe_master b where a.cweid = b.cweid and a.cwetitle = b.cwetitle)

from jvn.

hidekuno avatar hidekuno commented on July 19, 2024
 for FILE in `ls CWE-*`; do CODE=`echo $FILE | sed 's/.txt//'`;  sed "s/\$/\t$CODE\t/" $FILE ; done

from jvn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.