@conterra/vuln-scan 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +489 -609
- package/dist/add-project-to-vex.js +2 -2
- package/dist/add-project.js +18 -18
- package/dist/add-statement.js +20 -20
- package/dist/auto-vex-creator.js +5 -0
- package/dist/jira-reporter.js +7 -18
- package/dist/remove-project.js +19 -19
- package/dist/schema/auto-vex-config.schema.json +36 -0
- package/dist/schema/conf-schema.json +33 -2
- package/dist/schema/jira-config-schema.json +10 -0
- package/dist/vuln-scan.js +12 -12
- package/package.json +6 -5
package/dist/remove-project.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`,n=await Yt(e,r);await(0,U.writeFile)(e,n,{encoding:"utf-8"})}async function Xt(e){try{return await(0,U.access)(e,U.constants.F_OK),!0}catch{return!1}}async function Yt(e,t){let r=await Qt();if(!r)return t;let n=await r.resolveConfig(e);return n?await r.format(t,{...n,filepath:e}):t}var zt;function Qt(){return zt??=import("prettier").catch(()=>{})}var ye;async function ce(e){if(ye)return ye;let t="https://repository.conterra.de/repository/maven-mirror-ct",r=j(e.workingDir,"input/vex"),n=j(e.workingDir,"output"),i=j(e.workingDir,"cache"),l=["grype","trivy","ossindex"],s=j(e.workingDir,"vuln-scan-conf.json"),o=await J(s);if(!o)throw new Error(`Missing project configuration file '${s}'`);let u=o.findNoLongerDetectedVulnerabilitiesOnlyForSnapshots??!1;return ye={projectConfigFileLocation:s,onNewVulnerabilities:o.onNewVulnerabilities??(o.failOnNewVulnerabilities?"fail":"warn"),onNoLongerDetectedVulnerabilities:o.onNoLongerDetectedVulnerabilities??"ignore",reportNoLongerDetectedVulnerabilities:o.reportNoLongerDetectedVulnerabilities??!0,consoleReport:o.consoleReport||"BY_PROJECT_DETAILED",createSubDirsForProject:o.createSubDirsForProject??!0,mavenRepo:o.mavenRepo??t,vexUrls:o.vexUrls??[],vexDir:j(e.workingDir,o.vexDir)??r,outDir:j(e.workingDir,o.outDir)??n,cacheDir:j(e.workingDir,o.cacheDir)??i,scanners:(o.scanners??l).map(f=>{if(typeof f!="string")throw new Error(`Invalid scanner name '${f}' in configuration file '${s}'`);let a=f.split("@");if(a.length>2)throw new Error(`Invalid scanner name '${f}' in configuration file '${s}'`);let c=a[0],d=a[1]??"";return{name:c,version:d}}),projects:(o.projects??[]).map(f=>{let a=f;if(!a.name)throw new Error("Project name is missing on entry:"+JSON.stringify(a));if(!a.version)throw new Error("Project version is missing on entry:"+JSON.stringify(a));if(!a.purl)throw new Error("Project purl is missing on entry:"+JSON.stringify(a));return a.purlAliases||(a.purlAliases=[]),a.enabled==null&&(a.enabled=!0),a.silent==null&&(a.silent=!1),a.minimumSeverity||(a.minimumSeverity="UNKNOWN"),a.sbomFile?{...a,sbomFile:j(e.workingDir,a.sbomFile)}:(a.detectNoLongerUsedVulnerabilities=u?a.purl.endsWith("-SNAPSHOT"):!0,f)})}}function j(e,t){if(t)return ae.default.isAbsolute(t)?t:(0,ae.resolve)(e,t)}var ue=require("fs/promises"),Le=require("path");var ve=class{constructor(t){this.location=t}location;async read(){let t=await J(this.location);if(!t)throw new Error("Invalid VEX file");return t}async write(t){await le(this.location,t)}async delete(){await(0,ue.unlink)(this.location)}};async function Pe(e,t){for(let r of await(0,ue.readdir)(e,{withFileTypes:!0}))r.name.endsWith(".json")?await t(new ve((0,Le.resolve)(r.parentPath,r.name))):r.isDirectory()&&await Pe((0,Le.resolve)(r.parentPath,r.name),t)}function ze(e){let t=e.vulnerability.name;return new Set([t,...e.vulnerability.aliases??[]])}async function Qe({workingDir:e,projectName:t,projectVersion:r,vulnId:n}){let i=await ce({workingDir:e});if(!i.projectConfigFileLocation)throw new Error("Missing project configuration file.");let l=i.projects.find(s=>s.name===t&&s.version===r);if(!l){console.info(`Project ${t} with version ${r} not found.`);return}n||await Zt(i.projectConfigFileLocation,l),await er(i.vexDir,l.purl,n)}async function Zt(e,t){let r=await J(e),n=r.projects.findIndex(i=>i.name===t.name&&i.version===t.version);r.projects.splice(n,1),console.info(`Remove project ${t.name} with version ${t.version} from ${e}`),await le(e,r)}async function er(e,t,r){await Pe(e,async n=>{let i=await n.read(),l=!1,s=i.statements,o=[];for(let u of s){if(r&&!ze(u).has(r)||!u.products)continue;let f=u.products.findIndex(a=>a["@id"]===t);f!==-1&&(u.products.splice(f,1),l=!0,u.products.length===0&&o.push(u))}if(l){for(let u of o){let f=s.indexOf(u);s.splice(f,1)}if(s.length===0){console.info(`Remove ${t} from ${n.location} and delete file.`),await n.delete();return}console.info(`Remove ${t} from ${n.location}`),await n.write(i)}})}var ee=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",fe=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n";var te=e=>e.name==="backspace",re=e=>e.name==="tab",Te=e=>"1234567890".includes(e.name),V=e=>e.name==="enter"||e.name==="return";var de=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},pe=class extends Error{name="CancelPromptError";message="Prompt was canceled"},ne=class extends Error{name="ExitPromptError"},he=class extends Error{name="HookError"},X=class extends Error{name="ValidationError"};var rt=require("node:async_hooks");var me=require("node:async_hooks");var Ze=new me.AsyncLocalStorage;function tr(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function et(e,t){let r=tr(e);return Ze.run(r,()=>{function n(i){r.handleChange=()=>{r.index=0,i()},r.handleChange()}return t(n)})}function $(){let e=Ze.getStore();if(!e)throw new he("[Inquirer] Hook functions can only be called from within a prompt");return e}function Re(){return $().rl}function Fe(e){let t=(...r)=>{let n=$(),i=!1,l=n.handleChange;n.handleChange=()=>{i=!0};let s=e(...r);return i&&l(),n.handleChange=l,s};return me.AsyncResource.bind(t)}function Y(e){let t=$(),{index:r}=t,n={get(){return t.hooks[r]},set(l){t.hooks[r]=l},initialized:r in t.hooks},i=e(n);return t.index++,i}function tt(){$().handleChange()}var M={queue(e){let t=$(),{index:r}=t;t.hooksEffect.push(()=>{t.hooksCleanup[r]?.();let n=e(Re());if(n!=null&&typeof n!="function")throw new X("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[r]=n})},run(){let e=$();Fe(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=$();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function rr(e){return typeof e=="function"}function L(e){return Y(t=>{let r=rt.AsyncResource.bind(function(l){t.get()!==l&&(t.set(l),tt())});if(t.initialized)return[t.get(),r];let n=rr(e)?e():e;return t.set(n),[n,r]})}function N(e,t){Y(r=>{let n=r.get();(!Array.isArray(n)||t.some((l,s)=>!Object.is(l,n[s])))&&M.queue(e),r.set(t)})}var I=require("node:util");var B=A(require("node:process"),1);function nr(){return B.default.platform.startsWith("win")?!!B.default.env.CI||!!B.default.env.WT_SESSION||!!B.default.env.TERMINUS_SUBLIME||B.default.env.ConEmuTask==="{cmd::Cmder}"||B.default.env.TERM_PROGRAM==="Terminus-Sublime"||B.default.env.TERM_PROGRAM==="vscode"||B.default.env.TERM==="xterm-256color"||B.default.env.TERM==="alacritty"||B.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm":B.default.env.TERM!=="linux"}var nt={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},it={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},ir={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},or={...nt,...it},sr={...nt,...ir},lr=nr(),ar=lr?or:sr,z=ar,tn=Object.entries(it);var ot={prefix:{idle:(0,I.styleText)("blue","?"),done:(0,I.styleText)("green",z.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>(0,I.styleText)("yellow",e))},style:{answer:e=>(0,I.styleText)("cyan",e),message:e=>(0,I.styleText)("bold",e),error:e=>(0,I.styleText)("red",`> ${e}`),defaultAnswer:e=>(0,I.styleText)("dim",`(${e})`),help:e=>(0,I.styleText)("dim",e),highlight:e=>(0,I.styleText)("cyan",e),key:e=>(0,I.styleText)("cyan",(0,I.styleText)("bold",`<${e}>`))}};function st(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function lt(...e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){let l=t[n];t[n]=st(l)&&st(i)?lt(l,i):i}return t}function k(...e){let t=[ot,...e.filter(r=>r!=null)];return lt(...t)}function W({status:e="idle",theme:t}){let[r,n]=L(!1),[i,l]=L(0),{prefix:s,spinner:o}=k(t);return N(()=>{if(e==="loading"){let f,a=-1,c=setTimeout(()=>{n(!0),f=setInterval(()=>{a=a+1,l(a%o.frames.length)},o.interval)},300);return()=>{clearTimeout(c),clearInterval(f)}}else n(!1)},[e]),r?o.frames[i]:typeof s=="string"?s:s[e==="loading"?"idle":e]??s.idle}function ie(e,t){return Y(r=>{let n=r.get();if(!n||n.dependencies.length!==t.length||n.dependencies.some((i,l)=>i!==t[l])){let i=e();return r.set({value:i,dependencies:t}),i}return n.value})}function K(e){return L({current:e})[0]}function H(e){let t=K(e);t.current=e,N(r=>{let n=!1,i=Fe((l,s)=>{n||t.current(s,r)});return r.input.on("keypress",i),()=>{n=!0,r.input.removeListener("keypress",i)}},[])}var vt=A(ct(),1);var ut=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),ft=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,dt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var fr=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,dr=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,pt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,pr=/\t{1,1000}/y,ht=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),hr=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,mr=new RegExp("\\p{M}+","gu"),gr={limit:1/0,ellipsis:""},mt=(e,t={},r={})=>{let n=t.limit??1/0,i=t.ellipsis??"",l=t?.ellipsisWidth??(i?mt(i,gr,r).width:0),s=0,o=r.controlWidth??0,u=r.tabWidth??8,f=r.emojiWidth??2,a=2,c=r.regularWidth??1,d=r.wideWidth??a,x=[[hr,c],[fr,s],[dr,o],[pr,u],[ht,f],[pt,d]],m=0,p=0,h=e.length,b=0,g=!1,D=h,S=Math.max(0,n-l),v=0,P=0,R=0,F=0;e:for(;;){if(P>v||p>=h&&p>m){let w=e.slice(v,P)||e.slice(m,p);b=0;for(let E of w.replaceAll(mr,"")){let y=E.codePointAt(0)||0;if(ft(y)?F=a:dt(y)?F=d:F=c,R+F>S&&(D=Math.min(D,Math.max(v,m)+b)),R+F>n){g=!0;break e}b+=E.length,R+=F}v=P=0}if(p>=h)break e;for(let w=0,E=x.length;w<E;w++){let[y,T]=x[w];if(y.lastIndex=p,y.test(e)){if(b=y===pt?ut(e.slice(p,y.lastIndex)):y===ht?1:y.lastIndex-p,F=b*T,R+F>S&&(D=Math.min(D,p+Math.floor((S-R)/T))),R+F>n){g=!0;break e}R+=F,v=m,P=p,p=m=y.lastIndex;continue e}}p+=1}return{width:g?S:R,index:g?D:h,truncated:g,ellipsed:g&&n>=l}},gt=mt;var wr={limit:1/0,ellipsis:"",ellipsisWidth:0},xr=(e,t={})=>gt(e,wr,t).width,O=xr;var ge="\x1B",St="\x9B",br=39,Ie="\x07",Et="[",Dr="]",yt="m",Ue=`${Dr}8;;`,wt=new RegExp(`(?:\\${Et}(?<code>\\d+)m|\\${Ue}(?<uri>.*)${Ie})`,"y"),xt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},bt=e=>`${ge}${Et}${e}${yt}`,Dt=e=>`${ge}${Ue}${e}${Ie}`,Be=(e,t,r)=>{let n=t[Symbol.iterator](),i=!1,l=!1,s=e.at(-1),o=s===void 0?0:O(s),u=n.next(),f=n.next(),a=0;for(;!u.done;){let c=u.value,d=O(c);o+d<=r?e[e.length-1]+=c:(e.push(c),o=0),(c===ge||c===St)&&(i=!0,l=t.startsWith(Ue,a+1)),i?l?c===Ie&&(i=!1,l=!1):c===yt&&(i=!1):(o+=d,o===r&&!f.done&&(e.push(""),o=0)),u=f,f=n.next(),a+=c.length}s=e.at(-1),!o&&s!==void 0&&s.length&&e.length>1&&(e[e.length-2]+=e.pop())},Sr=e=>{let t=e.split(" "),r=t.length;for(;r&&!O(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Er=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,l,s=e.split(" "),o=[""],u=0;for(let c=0;c<s.length;c++){let d=s[c];if(r.trim!==!1){let m=o.at(-1)??"",p=m.trimStart();m.length!==p.length&&(o[o.length-1]=p,u=O(p))}c!==0&&(u>=t&&(r.wordWrap===!1||r.trim===!1)&&(o.push(""),u=0),(u||r.trim===!1)&&(o[o.length-1]+=" ",u++));let x=O(d);if(r.hard&&x>t){let m=t-u,p=1+Math.floor((x-m-1)/t);Math.floor((x-1)/t)<p&&o.push(""),Be(o,d,t),u=O(o.at(-1)??"");continue}if(u+x>t&&u&&x){if(r.wordWrap===!1&&u<t){Be(o,d,t),u=O(o.at(-1)??"");continue}o.push(""),u=0}if(u+x>t&&r.wordWrap===!1){Be(o,d,t),u=O(o.at(-1)??"");continue}o[o.length-1]+=d,u+=x}r.trim!==!1&&(o=o.map(c=>Sr(c)));let f=o.join(`
|
|
4
|
-
`),
|
|
5
|
-
`){
|
|
6
|
-
`&&(i&&
|
|
7
|
-
`)}function
|
|
8
|
-
`).flatMap(r=>
|
|
2
|
+
"use strict";var Yt=Object.create;var Qe=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var er=Object.getPrototypeOf,tr=Object.prototype.hasOwnProperty;var Ze=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var rr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zt(e))!tr.call(t,i)&&i!==r&&Qe(t,i,{get:()=>e[i],enumerable:!(n=Qt(e,i))||n.enumerable});return t};var V=(t,e,r)=>(r=t!=null?Yt(er(t)):{},rr(e||!t||!t.__esModule?Qe(r,"default",{value:t,enumerable:!0}):r,t));var gt=Ze((Vn,ht)=>{"use strict";ht.exports=xr;function Sr(t){let e={defaultWidth:0,output:process.stdout,tty:require("tty")};return t?(Object.keys(e).forEach(function(r){t[r]||(t[r]=e[r])}),t):e}function xr(t){let e=Sr(t);if(e.output.getWindowSize)return e.output.getWindowSize()[0]||e.defaultWidth;if(e.tty.getWindowSize)return e.tty.getWindowSize()[1]||e.defaultWidth;if(e.output.columns)return e.output.columns;if(process.env.CLI_WIDTH){let r=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(r)&&r!==0)return r}return e.defaultWidth}});var jt=Ze((Zn,Ut)=>{var jr=require("stream"),Oe=class extends jr{#r=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,r){return this._dest?this._dest[e]:this._src?this._src[e]:r}#e(e,...r){typeof this._dest?.[e]=="function"&&this._dest[e](...r),typeof this._src?.[e]=="function"&&this._src[e](...r)}get isTTY(){return this.#r!==null?this.#r:this.#t("isTTY",!1)}set isTTY(e){this.#r=e}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,r){return this._dest=e,super.pipe(e,r)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return e.indexOf(this._prompt)===0&&(e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit("data",e);this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit("data",e)}end(e){this.muted&&(e&&this.replace?e=e.toString().replace(/./g,this.replace):e=null),e&&this.emit("data",e),this.emit("end")}destroy(...e){return this.#e("destroy",...e)}destroySoon(...e){return this.#e("destroySoon",...e)}close(...e){return this.#e("close",...e)}};Ut.exports=Oe});var A=V(require("path")),Le=require("fs/promises");var B=require("fs/promises");async function q(t){try{return await nr(t)?JSON.parse(await(0,B.readFile)(t,{encoding:"utf-8"})):void 0}catch(e){throw new Error(`Error reading JSON file ${t}: ${e}`,{cause:e})}}async function te(t,e){let r=JSON.stringify(e,null,4)+`
|
|
3
|
+
`,n=await ir(t,r);await(0,B.writeFile)(t,n,{encoding:"utf-8"})}async function nr(t){try{return await(0,B.access)(t,B.constants.F_OK),!0}catch{return!1}}async function ir(t,e){let r=await sr();if(!r)return e;let n=await r.resolveConfig(t);return n?await r.format(e,{...n,filepath:t}):e}var or;function sr(){return or??=import("prettier").catch(()=>{})}var re=["UNKNOWN","LOW","MEDIUM","HIGH","CRITICAL"];var Re=class t{constructor(e){this.workingDir=e}workingDir;static DEFAULT_MAVEN_REPO="https://repository.conterra.de/repository/maven-mirror-ct";static DEFAULT_VEX_SUBDIR="input/vex";static DEFAULT_OUT_SUBDIR="output";static DEFAULT_CACHE_SUBDIR="cache";static DEFAULT_SCANNERS=["grype","trivy","ossindex"];normalize(e,r){let n=e.findNoLongerDetectedVulnerabilitiesOnlyForSnapshots??!1;return{projectConfigFileLocation:r,onNewVulnerabilities:e.onNewVulnerabilities??(e.failOnNewVulnerabilities?"fail":"warn"),onNoLongerDetectedVulnerabilities:e.onNoLongerDetectedVulnerabilities??"ignore",reportNoLongerDetectedVulnerabilities:e.reportNoLongerDetectedVulnerabilities??!0,consoleReport:e.consoleReport??"BY_PROJECT_DETAILED",createSubDirsForProject:e.createSubDirsForProject??!0,mavenRepo:e.mavenRepo??t.DEFAULT_MAVEN_REPO,vexUrls:e.vexUrls??[],vexDir:this.resolvePath(e.vexDir)??(0,A.resolve)(this.workingDir,t.DEFAULT_VEX_SUBDIR),outDir:this.resolvePath(e.outDir)??(0,A.resolve)(this.workingDir,t.DEFAULT_OUT_SUBDIR),cacheDir:this.resolvePath(e.cacheDir)??(0,A.resolve)(this.workingDir,t.DEFAULT_CACHE_SUBDIR),scanners:this.normalizeScanners(e.scanners,r),projects:this.normalizeProjects(e.projects??[],n)}}normalizeScanners(e,r){return(e??t.DEFAULT_SCANNERS).map(i=>{if(typeof i!="string")throw new Error(`Invalid scanner name '${String(i)}' in configuration file '${r}'`);let o=i.split("@");if(o.length>2)throw new Error(`Invalid scanner name '${i}' in configuration file '${r}'`);return{name:o[0],version:o[1]??""}})}normalizeProjects(e,r){return e.map(n=>{let i=n;if(!i.name)throw new Error("Project name is missing on entry: "+JSON.stringify(i));if(!i.version)throw new Error("Project version is missing on entry: "+JSON.stringify(i));if(!i.purl)throw new Error("Project purl is missing on entry: "+JSON.stringify(i));let o={...i,purlAliases:i.purlAliases??[],enabled:i.enabled??!0,silent:i.silent??!1,minimumSeverity:i.minimumSeverity??"UNKNOWN"};return o.sbomFile?{...o,sbomFile:this.resolvePath(o.sbomFile)??o.sbomFile}:{...o,detectNoLongerUsedVulnerabilities:r?o.purl.endsWith("-SNAPSHOT"):!0}})}resolvePath(e){if(e)return A.default.isAbsolute(e)?e:(0,A.resolve)(this.workingDir,e)}},X=class{constructor(e){this.workingDir=e;this.normalizer=new Re(e)}workingDir;normalizer;projectConfigCache;async loadProjectConfig(){return this.projectConfigCache??=this.doLoadProjectConfig(),this.projectConfigCache}async doLoadProjectConfig(){let e=(0,A.resolve)(this.workingDir,"vuln-scan-conf.json"),r=await q(e);if(!r)throw new Error(`Missing project configuration file '${e}'`);return this.normalizer.normalize(r,e)}async loadJiraConfig(e){let r=await(0,Le.readFile)(e,"utf8"),n=JSON.parse(r);if(!n.issues&&n.issue&&(n.issues=n.issue),!n.jiraUrl||typeof n.jiraUrl!="string")throw new Error("jira-conf.json: missing or invalid 'jiraUrl' field");if(!Array.isArray(n.issues))throw new Error("jira-conf.json: missing or invalid 'issues' array");this.validateAutoCloseSeverity(n.autoCloseBelowSeverity,"jira-conf.json: invalid 'autoCloseBelowSeverity'");for(let[i,o]of n.issues.entries())o&&typeof o=="object"&&this.validateAutoCloseSeverity(o.autoCloseBelowSeverity,`jira-conf.json: invalid 'issues[${i}].autoCloseBelowSeverity'`);return n}validateAutoCloseSeverity(e,r){if(e!==void 0&&!re.includes(e))throw new Error(`${r} value '${String(e)}'. Must be one of: ${re.join(", ")}`)}async loadAutoVexConfig(e){let r=await(0,Le.readFile)(e,"utf8"),n=JSON.parse(r);if(!n.impactStatement||typeof n.impactStatement!="string")throw new Error("auto-vex-conf.json: missing or invalid 'impactStatement' field (must be a non-empty string)");if(n.maxSeverity!==void 0&&!re.includes(n.maxSeverity))throw new Error(`auto-vex-conf.json: invalid 'maxSeverity' value '${String(n.maxSeverity)}'. Must be one of: ${re.join(", ")}`);return n}};var ue=class{constructor(e){this.configFilePath=e}configFilePath;async readRawConfig(){let e=await q(this.configFilePath);if(!e)throw new Error(`Missing project configuration file '${this.configFilePath}'`);return e}async insertAfter(e,r){let n=await this.readRawConfig(),i=n.projects??[],o=i.findIndex(s=>s.name===e.name&&s.version===e.version);if(o===-1)throw new Error(`Reference project ${e.name}@${e.version} not found in config`);i.splice(o+1,0,r),n.projects=i,await te(this.configFilePath,n)}async remove(e,r){let n=await this.readRawConfig(),i=n.projects??[],o=i.findIndex(s=>s.name===e&&s.version===r);return o===-1?!1:(i.splice(o,1),n.projects=i,await te(this.configFilePath,n),!0)}};var it=require("fs/promises"),Ie=require("path");var de=require("fs/promises"),pe=require("path");var et=require("crypto");var ar="https://openvex.dev/ns/v0.2.0";function tt(t,e="conterra"){let n=`https://openvex.dev/docs/public/vex-${(0,et.randomUUID)()}`,i=t.timestamp??new Date().toISOString();return{"@context":ar,"@id":n,author:e,timestamp:i,last_updated:i,version:1,statements:[t]}}function rt(t,e){let r=e.timestamp??new Date().toISOString();return{...t,last_updated:r,version:t.version+1,statements:[...t.statements,e]}}var fe=class{constructor(e){this.location=e}location;_content=void 0;_exists=!1;get exists(){return this._exists}get content(){return this._content}set content(e){this._content=e,this._exists=e!==void 0}async read(){let e=await q(this.location);this._content=e??void 0,this._exists=this._content!==void 0}async write(){if(this._content===void 0)throw new Error(`Cannot write VexFile: content is undefined (${this.location})`);await(0,de.mkdir)((0,pe.dirname)((0,pe.resolve)(this.location)),{recursive:!0}),await te(this.location,this._content)}async delete(){await(0,de.unlink)(this.location),this._exists=!1}upsert(e,r){return this._content===void 0?(this._content=tt(e,r),this._exists=!0,{created:!0}):(this._content=rt(this._content,e),{created:!1})}addProductId(e,r){this.assertContentLoaded("addProductId");let n=!1;for(let i of this._content.statements){if(!i.products||i.products.some(s=>s["@id"]===r))continue;let o=i.products.findIndex(s=>s["@id"]===e);o!==-1&&(i.products.splice(o+1,0,{"@id":r}),n=!0)}return n}removeProductId(e,r){this.assertContentLoaded("removeProductId");let n=this._content.statements,i=[],o=!1;for(let s of n){if(r&&!nt(s).has(r)||!s.products)continue;let a=s.products.findIndex(u=>u["@id"]===e);a!==-1&&(s.products.splice(a,1),o=!0,s.products.length===0&&i.push(s))}if(!o)return"unchanged";for(let s of i)n.splice(n.indexOf(s),1);return n.length===0?"emptied":"changed"}hasStatementForProduct(e){return this.assertContentLoaded("hasStatementForProduct"),this._content.statements.some(r=>r.products?.some(n=>n["@id"]===e)??!1)}assertContentLoaded(e){if(this._content===void 0)throw new Error(`VexFile.${e}(): content is not loaded. Call read() first (${this.location})`)}};async function Ce(t,e){for(let r of await(0,it.readdir)(t,{withFileTypes:!0}))r.name.endsWith(".json")?await e(new fe((0,Ie.resolve)(r.parentPath,r.name))):r.isDirectory()&&await Ce((0,Ie.resolve)(r.parentPath,r.name),e)}function nt(t){let e=t.vulnerability.name;return new Set([e,...t.vulnerability.aliases??[]])}async function ot({workingDir:t,projectName:e,projectVersion:r,vulnId:n}){let i=await new X(t).loadProjectConfig();if(!i.projectConfigFileLocation)throw new Error("Missing project configuration file.");let o=i.projects.find(s=>s.name===e&&s.version===r);if(!o){console.info(`Project ${e} with version ${r} not found.`);return}n||await lr(i.projectConfigFileLocation,o),await cr(i.vexDir,o.purl,n)}async function lr(t,e){await new ue(t).remove(e.name,e.version)&&console.info(`Remove project ${e.name} with version ${e.version} from ${t}`)}async function cr(t,e,r){await Ce(t,async n=>{await n.read();let i=n.removeProductId(e,r);i==="emptied"?(console.info(`Remove ${e} from ${n.location} and delete file.`),await n.delete()):i==="changed"&&(console.info(`Remove ${e} from ${n.location}`),await n.write())})}var ne=(t,e=[])=>t.name==="up"||e.includes("vim")&&t.name==="k"||e.includes("emacs")&&t.ctrl&&t.name==="p",me=(t,e=[])=>t.name==="down"||e.includes("vim")&&t.name==="j"||e.includes("emacs")&&t.ctrl&&t.name==="n";var ie=t=>t.name==="backspace",oe=t=>t.name==="tab",Fe=t=>"1234567890".includes(t.name),k=t=>t.name==="enter"||t.name==="return";var he=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}},ge=class extends Error{name="CancelPromptError";message="Prompt was canceled"},se=class extends Error{name="ExitPromptError"},we=class extends Error{name="HookError"},z=class extends Error{name="ValidationError"};var ct=require("node:async_hooks");var Se=require("node:async_hooks");var st=new Se.AsyncLocalStorage;function ur(t){return{rl:t,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function at(t,e){let r=ur(t);return st.run(r,()=>{function n(i){r.handleChange=()=>{r.index=0,i()},r.handleChange()}return e(n)})}function $(){let t=st.getStore();if(!t)throw new we("[Inquirer] Hook functions can only be called from within a prompt");return t}function Te(){return $().rl}function Be(t){let e=(...r)=>{let n=$(),i=!1,o=n.handleChange;n.handleChange=()=>{i=!0};let s=t(...r);return i&&o(),n.handleChange=o,s};return Se.AsyncResource.bind(e)}function Y(t){let e=$(),{index:r}=e,n={get(){return e.hooks[r]},set(o){e.hooks[r]=o},initialized:r in e.hooks},i=t(n);return e.index++,i}function lt(){$().handleChange()}var M={queue(t){let e=$(),{index:r}=e;e.hooksEffect.push(()=>{e.hooksCleanup[r]?.();let n=t(Te());if(n!=null&&typeof n!="function")throw new z("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[r]=n})},run(){let t=$();Be(()=>{t.hooksEffect.forEach(e=>{e()}),t.hooksEffect.length=0})()},clearAll(){let t=$();t.hooksCleanup.forEach(e=>{e?.()}),t.hooksEffect.length=0,t.hooksCleanup.length=0}};function fr(t){return typeof t=="function"}function D(t){return Y(e=>{let r=ct.AsyncResource.bind(function(o){e.get()!==o&&(e.set(o),lt())});if(e.initialized)return[e.get(),r];let n=fr(t)?t():t;return e.set(n),[n,r]})}function _(t,e){Y(r=>{let n=r.get();(!Array.isArray(n)||e.some((o,s)=>!Object.is(o,n[s])))&&M.queue(t),r.set(e)})}var T=require("node:util");var F=V(require("node:process"),1);function dr(){return F.default.platform.startsWith("win")?!!F.default.env.CI||!!F.default.env.WT_SESSION||!!F.default.env.TERMINUS_SUBLIME||F.default.env.ConEmuTask==="{cmd::Cmder}"||F.default.env.TERM_PROGRAM==="Terminus-Sublime"||F.default.env.TERM_PROGRAM==="vscode"||F.default.env.TERM==="xterm-256color"||F.default.env.TERM==="alacritty"||F.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm":F.default.env.TERM!=="linux"}var ut={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},ft={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},pr={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},mr={...ut,...ft},hr={...ut,...pr},gr=dr(),wr=gr?mr:hr,Q=wr,bn=Object.entries(ft);var dt={prefix:{idle:(0,T.styleText)("blue","?"),done:(0,T.styleText)("green",Q.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(t=>(0,T.styleText)("yellow",t))},style:{answer:t=>(0,T.styleText)("cyan",t),message:t=>(0,T.styleText)("bold",t),error:t=>(0,T.styleText)("red",`> ${t}`),defaultAnswer:t=>(0,T.styleText)("dim",`(${t})`),help:t=>(0,T.styleText)("dim",t),highlight:t=>(0,T.styleText)("cyan",t),key:t=>(0,T.styleText)("cyan",(0,T.styleText)("bold",`<${t}>`))}};function pt(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function mt(...t){let e={};for(let r of t)for(let[n,i]of Object.entries(r)){let o=e[n];e[n]=pt(o)&&pt(i)?mt(o,i):i}return e}function N(...t){let e=[dt,...t.filter(r=>r!=null)];return mt(...e)}function W({status:t="idle",theme:e}){let[r,n]=D(!1),[i,o]=D(0),{prefix:s,spinner:a}=N(e);return _(()=>{if(t==="loading"){let c,f=-1,l=setTimeout(()=>{n(!0),c=setInterval(()=>{f=f+1,o(f%a.frames.length)},a.interval)},300);return()=>{clearTimeout(l),clearInterval(c)}}else n(!1)},[t]),r?a.frames[i]:typeof s=="string"?s:s[t==="loading"?"idle":t]??s.idle}function ae(t,e){return Y(r=>{let n=r.get();if(!n||n.dependencies.length!==e.length||n.dependencies.some((i,o)=>i!==e[o])){let i=t();return r.set({value:i,dependencies:e}),i}return n.value})}function H(t){return D({current:t})[0]}function K(t){let e=H(t);e.current=t,_(r=>{let n=!1,i=Be((o,s)=>{n||e.current(s,r)});return r.input.on("keypress",i),()=>{n=!0,r.input.removeListener("keypress",i)}},[])}var Bt=V(gt(),1);var wt=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let r=0;for(t.lastIndex=0;t.test(e);)r+=1;return e.length-r}})(),St=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,xt=t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141;var yr=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,br=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,yt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,vr=/\t{1,1000}/y,bt=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),Er=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Dr=new RegExp("\\p{M}+","gu"),Pr={limit:1/0,ellipsis:""},vt=(t,e={},r={})=>{let n=e.limit??1/0,i=e.ellipsis??"",o=e?.ellipsisWidth??(i?vt(i,Pr,r).width:0),s=0,a=r.controlWidth??0,u=r.tabWidth??8,c=r.emojiWidth??2,f=2,l=r.regularWidth??1,p=r.wideWidth??f,S=[[Er,l],[yr,s],[br,a],[vr,u],[bt,c],[yt,p]],h=0,d=0,m=t.length,x=0,g=!1,y=m,b=Math.max(0,n-o),P=0,L=0,I=0,C=0;e:for(;;){if(L>P||d>=m&&d>h){let w=t.slice(P,L)||t.slice(h,d);x=0;for(let v of w.replaceAll(Dr,"")){let E=v.codePointAt(0)||0;if(St(E)?C=f:xt(E)?C=p:C=l,I+C>b&&(y=Math.min(y,Math.max(P,h)+x)),I+C>n){g=!0;break e}x+=v.length,I+=C}P=L=0}if(d>=m)break e;for(let w=0,v=S.length;w<v;w++){let[E,R]=S[w];if(E.lastIndex=d,E.test(t)){if(x=E===yt?wt(t.slice(d,E.lastIndex)):E===bt?1:E.lastIndex-d,C=x*R,I+C>b&&(y=Math.min(y,d+Math.floor((b-I)/R))),I+C>n){g=!0;break e}I+=C,P=h,L=d,d=h=E.lastIndex;continue e}}d+=1}return{width:g?b:I,index:g?y:m,truncated:g,ellipsed:g&&n>=o}},Et=vt;var Lr={limit:1/0,ellipsis:"",ellipsisWidth:0},Rr=(t,e={})=>Et(t,Lr,e).width,O=Rr;var xe="\x1B",It="\x9B",Ir=39,je="\x07",Ct="[",Cr="]",Ft="m",_e=`${Cr}8;;`,Dt=new RegExp(`(?:\\${Ct}(?<code>\\d+)m|\\${_e}(?<uri>.*)${je})`,"y"),Pt=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},Lt=t=>`${xe}${Ct}${t}${Ft}`,Rt=t=>`${xe}${_e}${t}${je}`,Ue=(t,e,r)=>{let n=e[Symbol.iterator](),i=!1,o=!1,s=t.at(-1),a=s===void 0?0:O(s),u=n.next(),c=n.next(),f=0;for(;!u.done;){let l=u.value,p=O(l);a+p<=r?t[t.length-1]+=l:(t.push(l),a=0),(l===xe||l===It)&&(i=!0,o=e.startsWith(_e,f+1)),i?o?l===je&&(i=!1,o=!1):l===Ft&&(i=!1):(a+=p,a===r&&!c.done&&(t.push(""),a=0)),u=c,c=n.next(),f+=l.length}s=t.at(-1),!a&&s!==void 0&&s.length&&t.length>1&&(t[t.length-2]+=t.pop())},Fr=t=>{let e=t.split(" "),r=e.length;for(;r&&!O(e[r-1]);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},Tr=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=t.split(" "),a=[""],u=0;for(let l=0;l<s.length;l++){let p=s[l];if(r.trim!==!1){let h=a.at(-1)??"",d=h.trimStart();h.length!==d.length&&(a[a.length-1]=d,u=O(d))}l!==0&&(u>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),u=0),(u||r.trim===!1)&&(a[a.length-1]+=" ",u++));let S=O(p);if(r.hard&&S>e){let h=e-u,d=1+Math.floor((S-h-1)/e);Math.floor((S-1)/e)<d&&a.push(""),Ue(a,p,e),u=O(a.at(-1)??"");continue}if(u+S>e&&u&&S){if(r.wordWrap===!1&&u<e){Ue(a,p,e),u=O(a.at(-1)??"");continue}a.push(""),u=0}if(u+S>e&&r.wordWrap===!1){Ue(a,p,e),u=O(a.at(-1)??"");continue}a[a.length-1]+=p,u+=S}r.trim!==!1&&(a=a.map(l=>Fr(l)));let c=a.join(`
|
|
4
|
+
`),f=!1;for(let l=0;l<c.length;l++){let p=c[l];if(n+=p,f)f=!1;else if(f=p>="\uD800"&&p<="\uDBFF",f)continue;if(p===xe||p===It){Dt.lastIndex=l+1;let h=Dt.exec(c)?.groups;if(h?.code!==void 0){let d=Number.parseFloat(h.code);i=d===Ir?void 0:d}else h?.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}if(c[l+1]===`
|
|
5
|
+
`){o&&(n+=Rt(""));let S=i?Pt(i):void 0;i&&S&&(n+=Lt(S))}else p===`
|
|
6
|
+
`&&(i&&Pt(i)&&(n+=Lt(i)),o&&(n+=Rt(o)))}return n},Br=/\r?\n/;function Tt(t,e,r){return String(t).normalize().split(Br).map(n=>Tr(n,e,r)).join(`
|
|
7
|
+
`)}function le(t,e){return t.split(`
|
|
8
|
+
`).flatMap(r=>Tt(r,e,{trim:!1,hard:!0}).split(`
|
|
9
9
|
`).map(n=>n.trimEnd())).join(`
|
|
10
|
-
`)}function
|
|
11
|
-
`)),u=
|
|
12
|
-
`)}var
|
|
13
|
-
`).length,
|
|
14
|
-
`).pop()??"",
|
|
15
|
-
`);let
|
|
16
|
-
`+r:""),
|
|
17
|
-
`,r+=
|
|
18
|
-
at ${w}`)}let[
|
|
19
|
-
`).trimEnd()}${
|
|
20
|
-
if empty the project is complete removed.:`,required:!1});return await
|
|
21
|
-
Do you want to proceed?`})||(console.log("Aborted."),process.exit(0)),{projectName:
|
|
10
|
+
`)}function ye(){return(0,Bt.default)({defaultWidth:80,output:Te().output})}function Ur({active:t,renderedItems:e,pageSize:r,loop:n}){let i=H({lastPointer:t,lastActive:void 0}),{lastPointer:o,lastActive:s}=i.current,a=Math.floor(r/2),u=e.reduce((l,p)=>l+p.length,0),c=e.slice(0,t).reduce((l,p)=>l+p.length,0),f=c;if(u>r)if(n)f=o,s!=null&&s<t&&t-s<r&&(f=Math.min(a,Math.abs(t-s)===1?Math.min(o+(e[s]?.length??0),Math.max(c,o)):o+t-s));else{let l=e.slice(t).reduce((p,S)=>p+S.length,0);f=l<r-a?r-l:Math.min(c,a)}return i.current.lastPointer=f,i.current.lastActive=t,f}function Ne({items:t,active:e,renderItem:r,pageSize:n,loop:i=!0}){let o=ye(),s=x=>(x%t.length+t.length)%t.length,a=t.map((x,g)=>x==null?[]:le(r({item:x,index:g,isActive:g===e}),o).split(`
|
|
11
|
+
`)),u=a.reduce((x,g)=>x+g.length,0),c=x=>a[x]??[],f=Ur({active:e,renderedItems:a,pageSize:n,loop:i}),l=c(e).slice(0,n),p=f+l.length<=n?f:n-l.length,S=Array.from({length:n});S.splice(p,l.length,...l);let h=new Set([e]),d=p+l.length,m=s(e+1);for(;d<n&&!h.has(m)&&(i&&u>n?m!==e:m>e);){let g=c(m).slice(0,n-d);S.splice(d,g.length,...g),h.add(m),d+=g.length,m=s(m+1)}for(d=p-1,m=s(e-1);d>=0&&!h.has(m)&&(i&&u>n?m!==e:m<e);){let x=c(m),g=x.slice(Math.max(0,x.length-d-1));S.splice(d-g.length+1,g.length,...g),h.add(m),d-=g.length,m=s(m-1)}return S.filter(x=>typeof x=="string").join(`
|
|
12
|
+
`)}var $t=V(require("node:readline"),1),Mt=require("node:async_hooks"),Wt=V(jt(),1);var G=[];G.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&G.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&G.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var be=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ae=Symbol.for("signal-exit emitter"),Ve=globalThis,_r=Object.defineProperty.bind(Object),ke=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ve[Ae])return Ve[Ae];_r(Ve,Ae,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},ve=class{},Nr=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),$e=class extends ve{onExit(){return()=>{}}load(){}unload(){}},Me=class extends ve{#r=We.platform==="win32"?"SIGINT":"SIGHUP";#t=new ke;#e;#o;#s;#i={};#n=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of G)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#t,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#t.emit("exit",null,r),a=r==="SIGHUP"?this.#r:r;s||e.kill(e.pid,a)}};this.#s=e.reallyExit,this.#o=e.emit}onExit(e,r){if(!be(this.#e))return()=>{};this.#n===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#n){this.#n=!0,this.#t.count+=1;for(let e of G)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#l(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#n&&(this.#n=!1,G.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#s,this.#t.count-=1)}#a(e){return be(this.#e)?(this.#e.exitCode=e||0,this.#t.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#l(e,...r){let n=this.#o;if(e==="exit"&&be(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#t.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},We=globalThis.process,{onExit:_t,load:ri,unload:ni}=Nr(be(We)?new Me(We):new $e);var kt=require("node:util");var Ot="\x1B[?25l",At="\x1B[?25h",He=(t=1)=>t>0?`\x1B[${t}A`:"",Ke=(t=1)=>t>0?`\x1B[${t}B`:"",Ge=(t,e)=>typeof e=="number"&&!Number.isNaN(e)?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`,Nt="\x1B[2K",Je=t=>t>0?(Nt+He(1)).repeat(t-1)+Nt+"\x1B[G":"";var Vt=t=>t.split(`
|
|
13
|
+
`).length,Or=t=>t.split(`
|
|
14
|
+
`).pop()??"",ce=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,r=""){let n=Or(e),i=(0,kt.stripVTControlCharacters)(n),o=i;this.rl.line.length>0&&(o=o.slice(0,-this.rl.line.length)),this.rl.setPrompt(o),this.cursorPos=this.rl.getCursorPos();let s=ye();e=le(e,s),r=le(r,s),i.length%s===0&&(e+=`
|
|
15
|
+
`);let a=e+(r?`
|
|
16
|
+
`+r:""),c=Math.floor(i.length/s)-this.cursorPos.rows+(r?Vt(r):0);c>0&&(a+=He(c)),a+=Ge(this.cursorPos.cols),this.write(Ke(this.extraLinesUnderPrompt)+Je(this.height)+a),this.extraLinesUnderPrompt=c,this.height=Vt(a)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(Ge(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let r=Ke(this.extraLinesUnderPrompt);r+=e?Je(this.height):`
|
|
17
|
+
`,r+=At,this.write(r),this.rl.close()}};var Ee=class extends Promise{static withResolver(){let e,r;return{promise:new Promise((i,o)=>{e=i,r=o}),resolve:e,reject:r}}};var Ht=V(require("node:path"),1),Ar=globalThis.setImmediate;function Vr(){let t=Error.prepareStackTrace,e=[];try{Error.prepareStackTrace=(r,n)=>{let i=n.slice(1);return e=i,i},new Error().stack}catch{return e}return Error.prepareStackTrace=t,e}function J(t){let e=Vr();return(n,i={})=>{let{input:o=process.stdin,signal:s}=i,a=new Set,u=new Wt.default;u.pipe(i.output??process.stdout);let c=$t.createInterface({terminal:!0,input:o,output:u});u.mute();let f=new ce(c),{promise:l,resolve:p,reject:S}=Ee.withResolver(),h=()=>S(new ge);if(s){let m=()=>S(new he({cause:s.reason}));if(s.aborted)return m(),Object.assign(l,{cancel:h});s.addEventListener("abort",m),a.add(()=>s.removeEventListener("abort",m))}a.add(_t((m,x)=>{S(new se(`User force closed the prompt with ${m} ${x}`))}));let d=()=>S(new se("User force closed the prompt with SIGINT"));return c.on("SIGINT",d),a.add(()=>c.removeListener("SIGINT",d)),at(c,m=>{let x=Mt.AsyncResource.bind(()=>M.clearAll());c.on("close",x),a.add(()=>c.removeListener("close",x));let g=()=>{let y=()=>f.checkCursorPos();c.input.on("keypress",y),a.add(()=>c.input.removeListener("keypress",y));let b=null;m(()=>{let P=!1;try{let L=t(n,w=>{P?p(w):b={value:w}});if(L===void 0){let w=e[1]?.getFileName();throw w&&!w.startsWith("file://")&&(w=Ht.default.resolve(w)),new Error(`Prompt functions must return a string.
|
|
18
|
+
at ${w}`)}let[I,C]=typeof L=="string"?[L]:L;f.render(I,C),M.run()}catch(L){S(L)}if(P=!0,b!==null){let{value:L}=b;b=null,p(L)}})};return"readableFlowing"in o?Ar(g):g(),Object.assign(l.then(y=>(M.clearAll(),y),y=>{throw M.clearAll(),y}).finally(()=>{a.forEach(y=>y()),f.done({clearContent:!!i.clearPromptOnDone}),u.end()}).then(()=>l),{cancel:h})})}}var Kt=require("node:util");var U=class{separator=(0,Kt.styleText)("dim",Array.from({length:15}).join(Q.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="separator")}};function Gt(t,e){let r=e!==!1;return/^(y|yes)/i.test(t)?r=!0:/^(n|no)/i.test(t)&&(r=!1),r}function Jt(t){return t?"Yes":"No"}var qe=J((t,e)=>{let{transformer:r=Jt}=t,[n,i]=D("idle"),[o,s]=D(""),a=N(t.theme),u=W({status:n,theme:a});K((p,S)=>{if(n==="idle")if(k(p)){let h=Gt(o,t.default);s(r(h)),i("done"),e(h)}else if(oe(p)){let h=Jt(!Gt(o,t.default));S.clearLine(0),S.write(h),s(h)}else s(S.line)});let c=o,f="";n==="done"?c=a.style.answer(o):f=` ${a.style.defaultAnswer(t.default===!1?"y/N":"Y/n")}`;let l=a.style.message(t.message,n);return`${u} ${l}${f} ${c}`});var kr={validationFailureMode:"keep"},Xe=J((t,e)=>{let{prefill:r="tab"}=t,n=N(kr,t.theme),[i,o]=D("idle"),[s,a]=D(String(t.default??"")),[u,c]=D(),[f,l]=D(""),p=W({status:i,theme:n});async function S(g){let{required:y,pattern:b,patternError:P="Invalid input"}=t;return y&&!g?"You must provide a value":b&&!b.test(g)?P:typeof t.validate=="function"?await t.validate(g)||"You must provide a valid value":!0}K(async(g,y)=>{if(i==="idle")if(k(g)){let b=f||s;o("loading");let P=await S(b);P===!0?(l(b),o("done"),e(b)):(n.validationFailureMode==="clear"?l(""):y.write(f),c(P),o("idle"))}else ie(g)&&!f?a(""):oe(g)&&!f?(a(""),y.clearLine(0),y.write(s),l(s)):(l(y.line),c(void 0))}),_(g=>{r==="editable"&&s&&(g.write(s),l(s))},[]);let h=n.style.message(t.message,i),d=f;typeof t.transformer=="function"?d=t.transformer(f,{isFinal:i==="done"}):i==="done"&&(d=n.style.answer(f));let m;s&&i!=="done"&&!f&&(m=n.style.defaultAnswer(s));let x="";return u&&(x=n.style.error(u)),[[p,h,m,d].filter(g=>g!==void 0).join(" "),x]});var Z=require("node:util");var $r={icon:{cursor:Q.pointer},style:{disabled:t=>(0,Z.styleText)("dim",t),description:t=>(0,Z.styleText)("cyan",t),keysHelpTip:t=>t.map(([e,r])=>`${(0,Z.styleText)("bold",e)} ${(0,Z.styleText)("dim",r)}`).join((0,Z.styleText)("dim"," \u2022 "))},i18n:{disabledError:"This option is disabled and cannot be selected."},indexMode:"hidden",keybindings:[]};function ze(t){return!U.isSeparator(t)&&!t.disabled}function Ye(t){return!U.isSeparator(t)}function Mr(t){return t.map(e=>{if(U.isSeparator(e))return e;if(typeof e!="object"||e===null||!("value"in e)){let i=String(e);return{value:e,name:i,short:i,disabled:!1}}let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var De=J((t,e)=>{let{loop:r=!0,pageSize:n=7}=t,i=N($r,t.theme),{keybindings:o}=i,[s,a]=D("idle"),u=W({status:s,theme:i}),c=H(),f=!o.includes("vim"),l=ae(()=>Mr(t.choices),[t.choices]),p=ae(()=>{let w=l.findIndex(Ye),v=l.findLastIndex(Ye);if(w===-1)throw new z("[select prompt] No selectable choices. All choices are disabled.");return{first:w,last:v}},[l]),S=ae(()=>"default"in t?l.findIndex(w=>ze(w)&&w.value===t.default):-1,[t.default,l]),[h,d]=D(S===-1?p.first:S),m=l[h];if(m==null||U.isSeparator(m))throw new Error("Active index does not point to a choice");let[x,g]=D();K((w,v)=>{if(clearTimeout(c.current),x&&g(void 0),k(w))m.disabled?g(i.i18n.disabledError):(a("done"),e(m.value));else if(ne(w,o)||me(w,o)){if(v.clearLine(0),r||ne(w,o)&&h!==p.first||me(w,o)&&h!==p.last){let E=ne(w,o)?-1:1,R=h;do R=(R+E+l.length)%l.length;while(!Ye(l[R]));d(R)}}else if(Fe(w)&&!Number.isNaN(Number(v.line))){let E=Number(v.line)-1,R=-1,j=l.findIndex(ee=>U.isSeparator(ee)?!1:(R++,R===E)),Pe=l[j];Pe!=null&&ze(Pe)&&d(j),c.current=setTimeout(()=>{v.clearLine(0)},700)}else if(ie(w))v.clearLine(0);else if(f){let E=v.line.toLowerCase(),R=l.findIndex(j=>U.isSeparator(j)||!ze(j)?!1:j.name.toLowerCase().startsWith(E));R!==-1&&d(R),c.current=setTimeout(()=>{v.clearLine(0)},700)}}),_(()=>()=>{clearTimeout(c.current)},[]);let y=i.style.message(t.message,s),b=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),P=0,L=Ne({items:l,active:h,renderItem({item:w,isActive:v,index:E}){if(U.isSeparator(w))return P++,` ${w.separator}`;let R=v?i.icon.cursor:" ",j=i.indexMode==="number"?`${E+1-P}. `:"";if(w.disabled){let ee=typeof w.disabled=="string"?w.disabled:"(disabled)",zt=v?i.icon.cursor:"-";return i.style.disabled(`${zt} ${j}${w.name} ${ee}`)}return(v?i.style.highlight:ee=>ee)(`${R} ${j}${w.name}`)},pageSize:n,loop:r});if(s==="done")return[u,y,i.style.answer(m.short)].filter(Boolean).join(" ");let{description:I}=m;return`${[[u,y].filter(Boolean).join(" "),L," ",I?i.style.description(I):"",x?i.style.error(x):"",b].filter(Boolean).join(`
|
|
19
|
+
`).trimEnd()}${Ot}`});async function qt(t){let e=new Map;for(let s of t.projects){let a=e.get(s.name);a?a.push(s.version):e.set(s.name,[s.version])}let r=Array.from(e.keys()).sort(),n=await De({message:"Choose project name:",choices:r.map(s=>({name:s,value:s})),pageSize:15}),i=(e.get(n)??[]).sort(),o=await De({message:"Choose project version:",choices:i.map(s=>({name:s,value:s})),pageSize:15});return{projectName:n,projectVersion:o}}var Xt=process.cwd();(async()=>{let{projectName:t,projectVersion:e,vulnId:r}=await Wr();await ot({workingDir:Xt,projectName:t,projectVersion:e,vulnId:r})})();async function Wr(){let t=process.argv[2];if(!t)return Hr();let e=process.argv[3];if(!e)throw new Error("Missing project version.");let r=process.argv[4];return{projectName:t,projectVersion:e,vulnId:r}}async function Hr(){try{let t=await new X(Xt).loadProjectConfig(),{projectName:e,projectVersion:r}=await qt(t),n=await Xe({message:`Enter a CVE name from where the project should be removed (e.g. CVE-2023-52070)
|
|
20
|
+
if empty the project is complete removed.:`,required:!1});return await qe({message:`The project ${e}@${r} will be removed${n?`from ${n}`:" completely"}.
|
|
21
|
+
Do you want to proceed?`})||(console.log("Aborted."),process.exit(0)),{projectName:e,projectVersion:r,vulnId:n}}catch(t){console.error(`Error: ${t}`),process.exitCode=1;return}}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "auto-vex-conf.schema.json",
|
|
4
|
+
"title": "AutoVexConfig",
|
|
5
|
+
"description": "Configuration file (auto-vex-conf.json) for the ct-vuln-auto-vex tool. Controls automatic creation of OpenVEX 'not_affected' statements for newly detected vulnerabilities below a configurable severity threshold.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["impactStatement"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": {
|
|
11
|
+
"description": "Optional reference to the JSON Schema used to validate this file.",
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"impactStatement": {
|
|
15
|
+
"description": "The impact_statement text written into every auto-generated VEX statement. Must be a non-empty string.",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1
|
|
18
|
+
},
|
|
19
|
+
"maxSeverity": {
|
|
20
|
+
"description": "Exclusive severity threshold. CVEs with a severity strictly below this level receive an auto-generated 'not_affected' statement. CVEs at or above this level are skipped. Defaults to 'HIGH', so UNKNOWN, LOW and MEDIUM are covered but HIGH and CRITICAL are not.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": ["UNKNOWN", "LOW", "MEDIUM", "HIGH", "CRITICAL"],
|
|
23
|
+
"default": "HIGH"
|
|
24
|
+
},
|
|
25
|
+
"author": {
|
|
26
|
+
"description": "Author field placed in the generated OpenVEX document.",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"default": "conterra"
|
|
29
|
+
},
|
|
30
|
+
"subDir": {
|
|
31
|
+
"description": "Sub-directory under the configured vexDir where auto-generated VEX files are written. Defaults to 'auto'.",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"default": "auto"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,32 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "conf-schema.json",
|
|
4
|
+
"title": "VulnScanConfig",
|
|
5
|
+
"description": "Configuration file (vuln-scan-conf.json) for the ct-vuln-scan tool.",
|
|
3
6
|
"type": "object",
|
|
4
7
|
"properties": {
|
|
8
|
+
"$schema": {
|
|
9
|
+
"description": "Optional reference to the JSON Schema used to validate this file.",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
5
12
|
"failOnNewVulnerabilities": {
|
|
13
|
+
"description": "Deprecated. Use 'onNewVulnerabilities' instead.",
|
|
6
14
|
"type": "boolean",
|
|
7
15
|
"default": false,
|
|
8
16
|
"deprecated": true,
|
|
9
17
|
"deprecationMessage": "This property is deprecated, please use 'onNewVulnerabilities' instead."
|
|
10
18
|
},
|
|
11
19
|
"onNewVulnerabilities": {
|
|
20
|
+
"description": "Action to take when newly detected vulnerabilities are found (i.e. vulnerabilities with no matching OpenVEX statement). 'fail' exits with code 1. 'warn' exits with code 0 but marks the Azure DevOps pipeline task as SucceededWithIssues. 'ignore' takes no action.",
|
|
12
21
|
"type": "string",
|
|
13
22
|
"default": "fail",
|
|
14
23
|
"enum": ["fail", "warn", "ignore"]
|
|
15
24
|
},
|
|
16
25
|
"onNoLongerDetectedVulnerabilities": {
|
|
26
|
+
"description": "Action to take when a previously declared vulnerability (one that has a VEX statement) is no longer present in the current scanner output. 'fail' exits with code 1. 'warn' exits with code 0 but marks the Azure DevOps pipeline task as SucceededWithIssues. 'ignore' takes no action.",
|
|
17
27
|
"type": "string",
|
|
18
|
-
"default": "
|
|
28
|
+
"default": "ignore",
|
|
19
29
|
"enum": ["fail", "warn", "ignore"]
|
|
20
30
|
},
|
|
21
31
|
"findNoLongerDetectedVulnerabilitiesOnlyForSnapshots": {
|
|
32
|
+
"description": "When true, the 'no longer detected' check is restricted to projects whose purl ends with '-SNAPSHOT' (Maven snapshot versions). Release projects skip the check entirely. When false (default), all projects are checked.",
|
|
22
33
|
"type": "boolean",
|
|
23
34
|
"default": false
|
|
24
35
|
},
|
|
25
36
|
"reportNoLongerDetectedVulnerabilities": {
|
|
37
|
+
"description": "When true (default), no-longer-detected vulnerabilities are included in the console output and can trigger the 'onNoLongerDetectedVulnerabilities' action. When false, they are suppressed from output and the exit-code signal is not raised. The data is still written to scan-summary.json regardless.",
|
|
26
38
|
"type": "boolean",
|
|
27
39
|
"default": true
|
|
28
40
|
},
|
|
29
41
|
"consoleReport": {
|
|
42
|
+
"description": "Controls the structure of the console and text summary output. The prefix (BY_CVE / BY_PROJECT) sets whether results are grouped by CVE or by project. The suffix (_DETAILED) adds a vulnerability detail block (description, affected components, dependency tree, reference links) printed before the grouped listing.",
|
|
30
43
|
"type": "string",
|
|
31
44
|
"default": "BY_PROJECT_DETAILED",
|
|
32
45
|
"enum": [
|
|
@@ -37,11 +50,13 @@
|
|
|
37
50
|
]
|
|
38
51
|
},
|
|
39
52
|
"mavenRepo": {
|
|
53
|
+
"description": "Base URL of the Maven repository used to download CycloneDX SBOMs for projects configured with 'sbomMavenCoordinates'. Credentials are supplied via the MAVEN_REPO_USER and MAVEN_REPO_PW environment variables. Not used for projects that specify 'sbomFile'.",
|
|
40
54
|
"type": "string",
|
|
41
55
|
"format": "uri",
|
|
42
56
|
"default": "https://repository.conterra.de/repository/maven-mirror-ct"
|
|
43
57
|
},
|
|
44
58
|
"scanners": {
|
|
59
|
+
"description": "List of scanner engines to run. Valid names are 'grype', 'trivy', and 'ossindex'. A specific scanner version can be pinned by appending '@<version>' (e.g. 'trivy@0.69.3'), which fixes the Docker image tag used for that scanner. At least one scanner must be configured.",
|
|
45
60
|
"type": "array",
|
|
46
61
|
"items": {
|
|
47
62
|
"type": "string"
|
|
@@ -49,43 +64,54 @@
|
|
|
49
64
|
"default": ["grype", "trivy", "ossindex"]
|
|
50
65
|
},
|
|
51
66
|
"vexUrls": {
|
|
67
|
+
"description": "List of HTTP/HTTPS URLs pointing to additional OpenVEX JSON files to download at scan startup. These remote documents are merged into the VEX store alongside local files from 'vexDir'. Credentials for all URLs are supplied via the VEX_URLS_USER and VEX_URLS_PW environment variables.",
|
|
52
68
|
"type": "array",
|
|
53
69
|
"items": {
|
|
54
|
-
"type": "string"
|
|
70
|
+
"type": "string",
|
|
71
|
+
"format": "uri"
|
|
55
72
|
},
|
|
56
73
|
"default": []
|
|
57
74
|
},
|
|
58
75
|
"vexDir": {
|
|
76
|
+
"description": "Path to the directory containing local OpenVEX JSON files (resolved relative to the working directory). The directory is walked recursively; all .json files found at any depth are loaded into the VEX store. If the directory does not exist, the store starts empty. This directory is also used by ct-vuln-add-vex and ct-vuln-auto-vex when writing new statements.",
|
|
59
77
|
"type": "string",
|
|
60
78
|
"default": "./input/vex"
|
|
61
79
|
},
|
|
62
80
|
"outDir": {
|
|
81
|
+
"description": "Output directory for scan results (resolved relative to the working directory). This directory is deleted and recreated on every run. It receives scan-summary.json, scan-summary.txt, and per-project artifacts (raw scanner output, aggregated results, SARIF files, per-project VEX files).",
|
|
63
82
|
"type": "string",
|
|
64
83
|
"default": "./output"
|
|
65
84
|
},
|
|
66
85
|
"cacheDir": {
|
|
86
|
+
"description": "Directory used by grype and trivy to cache their vulnerability databases between runs (bind-mounted into the scanner Docker containers). Unlike 'outDir', this directory is not cleared on each run, so database updates persist across scans.",
|
|
67
87
|
"type": "string",
|
|
68
88
|
"default": "./.cache"
|
|
69
89
|
},
|
|
70
90
|
"createSubDirsForProject": {
|
|
91
|
+
"description": "When true (default), per-project output files are placed in a '<name>-<version>/' sub-directory inside 'outDir'. When false, all project files are written flat into 'outDir'.",
|
|
71
92
|
"type": "boolean",
|
|
72
93
|
"default": true
|
|
73
94
|
},
|
|
74
95
|
"projects": {
|
|
96
|
+
"description": "List of projects to scan. Each entry defines one versioned component whose CycloneDX SBOM is fetched and scanned. At least one project is required.",
|
|
75
97
|
"type": "array",
|
|
76
98
|
"items": {
|
|
77
99
|
"type": "object",
|
|
78
100
|
"properties": {
|
|
79
101
|
"name": {
|
|
102
|
+
"description": "Human-readable name of the project. Used as a display label in reports and as part of the output file and directory names.",
|
|
80
103
|
"type": "string"
|
|
81
104
|
},
|
|
82
105
|
"version": {
|
|
106
|
+
"description": "Version string of the project. Used in display labels, output paths, and (together with 'name') as the product identifier when matching VEX statements.",
|
|
83
107
|
"type": "string"
|
|
84
108
|
},
|
|
85
109
|
"purl": {
|
|
110
|
+
"description": "Package URL (PURL) that uniquely identifies this project version, e.g. 'pkg:maven/com.example/my-app@1.0.0'. Used to match VEX statements in the store and as the primary scan-result key.",
|
|
86
111
|
"type": "string"
|
|
87
112
|
},
|
|
88
113
|
"purlAliases": {
|
|
114
|
+
"description": "Additional PURLs that should also match VEX statements for this project. Useful when a project has been renamed or relocated and older VEX statements reference a previous PURL coordinate.",
|
|
89
115
|
"type": "array",
|
|
90
116
|
"items": {
|
|
91
117
|
"type": "string"
|
|
@@ -93,20 +119,25 @@
|
|
|
93
119
|
"default": []
|
|
94
120
|
},
|
|
95
121
|
"sbomMavenCoordinates": {
|
|
122
|
+
"description": "Maven artifact coordinates of the CycloneDX SBOM to download from 'mavenRepo', in the format '<groupId>:<artifactId>:<version>:<classifier>' (e.g. 'com.example:my-app:1.0.0:sbom'). Mutually exclusive with 'sbomFile'.",
|
|
96
123
|
"type": "string"
|
|
97
124
|
},
|
|
98
125
|
"sbomFile": {
|
|
126
|
+
"description": "Path to a local CycloneDX SBOM JSON file (resolved relative to the working directory). When set, no Maven download occurs. Mutually exclusive with 'sbomMavenCoordinates'.",
|
|
99
127
|
"type": "string"
|
|
100
128
|
},
|
|
101
129
|
"enabled": {
|
|
130
|
+
"description": "When false, this project entry is skipped entirely during scanning. Useful for temporarily disabling a project without removing its configuration.",
|
|
102
131
|
"type": "boolean",
|
|
103
132
|
"default": true
|
|
104
133
|
},
|
|
105
134
|
"silent": {
|
|
135
|
+
"description": "When true, the project is scanned but its results are excluded from all reporting and exit-code logic. Its vulnerabilities do not appear in the console summary or scan-summary.json and do not contribute to pipeline failure. Use this to scan a project for informational purposes only.",
|
|
106
136
|
"type": "boolean",
|
|
107
137
|
"default": false
|
|
108
138
|
},
|
|
109
139
|
"minimumSeverity": {
|
|
140
|
+
"description": "Per-project severity floor. Only vulnerabilities at or above this severity level are counted as new findings and can trigger the 'onNewVulnerabilities' action. Vulnerabilities strictly below this threshold are silently ignored for this project. With the default 'UNKNOWN', no vulnerabilities are filtered out.",
|
|
110
141
|
"type": "string",
|
|
111
142
|
"enum": [
|
|
112
143
|
"CRITICAL",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"type": "string",
|
|
17
17
|
"format": "uri"
|
|
18
18
|
},
|
|
19
|
+
"autoCloseBelowSeverity": {
|
|
20
|
+
"description": "Default auto-close threshold inherited by every issues[] entry that does not override it. Newly-created issues whose vulnerability severity is strictly below this value are immediately transitioned to a status whose category is `done`. Existing closed issues are not re-opened when sub-threshold.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": ["UNKNOWN", "LOW", "MEDIUM", "HIGH", "CRITICAL"]
|
|
23
|
+
},
|
|
19
24
|
"issues": {
|
|
20
25
|
"description": "List of routing rules that map scan project identifiers to target Jira projects.",
|
|
21
26
|
"type": "array",
|
|
@@ -62,6 +67,11 @@
|
|
|
62
67
|
"type": "string",
|
|
63
68
|
"description": "Glob pattern for a project identifier. Example: \"mapapps@*\""
|
|
64
69
|
}
|
|
70
|
+
},
|
|
71
|
+
"autoCloseBelowSeverity": {
|
|
72
|
+
"description": "Optional auto-close threshold for this rule. Newly-created issues whose vulnerability severity is strictly below this value are immediately transitioned to a status whose category is `done`. Overrides the top-level autoCloseBelowSeverity. Existing closed issues are not re-opened when sub-threshold.",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": ["UNKNOWN", "LOW", "MEDIUM", "HIGH", "CRITICAL"]
|
|
65
75
|
}
|
|
66
76
|
}
|
|
67
77
|
},
|