From d938ee1e0d530b37bbf4c426878011841ba158ef Mon Sep 17 00:00:00 2001 From: Ruben Romero Montes Date: Wed, 6 Sep 2023 16:51:02 +0200 Subject: [PATCH] fix: split CVEs in multiple lines Signed-off-by: Ruben Romero Montes --- src/main/resources/freemarker/templates/generated/main.js | 2 +- ui/src/components/TransitiveDependenciesTable.tsx | 2 +- ui/src/components/VulnerabilitiesTable.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/freemarker/templates/generated/main.js b/src/main/resources/freemarker/templates/generated/main.js index 3111a5a3..da636b73 100644 --- a/src/main/resources/freemarker/templates/generated/main.js +++ b/src/main/resources/freemarker/templates/generated/main.js @@ -1 +1 @@ -!function(){"use strict";var e={3960:function(e,n,r){var t=r(8963),i=r(3609),s=(r(3218),r(9559)),a=r(9714),l=r(4187),c=r(8437),o=r(6798),d=r(2996),u=r(3324),h=r(6363),x=r(4223),p=r(7987),g=r(1858),j=r(493),v=r(7941),f=r(2355),m=r(3020),y=r(9361),b=r(7137),T=r(1188),S=r(9090),C=r(5859),P=function(){var e=Le().report;return(0,C.jsxs)(c.Z,{isFlat:!0,isFullHeight:!0,children:[(0,C.jsx)(o.O,{children:(0,C.jsxs)(d.l,{children:[(0,C.jsx)(u.J,{isInline:!0,status:"info",children:(0,C.jsx)(S.ZP,{style:{fill:"#f0ab00"}})})," ","Security Issues"]})}),(0,C.jsx)(h.i,{}),(0,C.jsx)(x.e,{children:(0,C.jsxs)(p.o,{columnModifier:{default:"2Col"},children:[(0,C.jsx)(g.g,{children:(0,C.jsx)(j.b,{children:(0,C.jsx)(v.aV,{isPlain:!0,children:(0,C.jsx)(f.H,{children:"Below is a list of dependencies affected with CVE, as well as vulnerability only found using Snyk's vulnerability database."})})})}),(0,C.jsxs)(g.g,{children:[(0,C.jsx)(m.M,{children:"Dependencies with security issues in your stack."}),(0,C.jsx)(j.b,{children:(0,C.jsxs)(v.aV,{isPlain:!0,children:[(0,C.jsx)(f.H,{children:"Dependencies with high common vulnerabilities and exposures (CVE) score."}),(0,C.jsx)(f.H,{children:(0,C.jsx)(y.D,{children:(0,C.jsxs)(b.x,{component:"p",children:[(0,C.jsx)(u.J,{isInline:!0,status:"info",children:(0,C.jsx)(T.ZP,{})})," ","Total vulnerabilities: ",e.summary.vulnerabilities.total]})})}),(0,C.jsx)(f.H,{children:(0,C.jsx)(y.D,{children:(0,C.jsxs)(b.x,{component:"p",children:[(0,C.jsx)(u.J,{isInline:!0,status:"warning",children:(0,C.jsx)(T.ZP,{})})," ","Vulnerable dependencies: ",e.summary.vulnerabilities.direct]})})})]})})]})]})})]})},w=r(1413),k=r(885),I=r(6989),E=r(8395),B=r(3647),D=r(5644),Z=r(8573),_=r(9809),O=r(7554),F=r(3442),N=r(2e3),R=r(5653),M=r(7338),L=r(9626),V=r(3610),H=r(7990),A=r(711),G=r(6056),q=r(1915),z=r(1178),J=r(7942),U=r(7102),W=r(5020),Y=r(2982),$=r(1917),K=function(e){return e[e.SET_PAGE=0]="SET_PAGE",e[e.SET_SORT_BY=1]="SET_SORT_BY",e}(K||{}),Q={changed:!1,currentPage:{page:1,perPage:10},sortBy:void 0},X=function(e,n){switch(n.type){case K.SET_PAGE:var r=n.payload;return(0,w.Z)((0,w.Z)({},e),{},{changed:!0,currentPage:{page:r.page,perPage:r.perPage}});case K.SET_SORT_BY:var t=n.payload;return(0,w.Z)((0,w.Z)({},e),{},{changed:!0,sortBy:{index:t.index,direction:t.direction}});default:return e}},ee=r(2570),ne=r(4794),re=r(8649),te=r(7514),ie=function(e){var n=e.numRenderedColumns,r=e.isLoading,t=void 0!==r&&r,i=e.isError,s=void 0!==i&&i,a=e.isNoData,l=void 0!==a&&a,c=e.errorEmptyState,o=void 0===c?null:c,d=e.noDataEmptyState,u=void 0===d?null:d,h=e.children,x=(0,C.jsxs)(_.u,{variant:_.I.sm,children:[(0,C.jsx)(O.k,{icon:re.ZP,color:te.a.value}),(0,C.jsx)(F.D,{headingLevel:"h2",size:"lg",children:"Unable to connect"}),(0,C.jsx)(N.B,{children:"There was an error retrieving data. Check your connection and try again."})]}),p=(0,C.jsxs)(_.u,{variant:_.I.sm,children:[(0,C.jsx)(O.k,{icon:W.ZP}),(0,C.jsx)(F.D,{headingLevel:"h2",size:"lg",children:"No data available"}),(0,C.jsx)(N.B,{children:"No data available to be shown here."})]});return(0,C.jsx)(C.Fragment,{children:t?(0,C.jsx)(G.p,{children:(0,C.jsx)(H.Tr,{children:(0,C.jsx)(q.Td,{colSpan:n,children:(0,C.jsx)(ee.b,{children:(0,C.jsx)(ne.$,{size:"xl"})})})})}):s?(0,C.jsx)(G.p,{"aria-label":"Table error",children:(0,C.jsx)(H.Tr,{children:(0,C.jsx)(q.Td,{colSpan:n,children:(0,C.jsx)(ee.b,{children:o||x})})})}):l?(0,C.jsx)(G.p,{"aria-label":"Table no data",children:(0,C.jsx)(H.Tr,{children:(0,C.jsx)(q.Td,{colSpan:n,children:(0,C.jsx)(ee.b,{children:u||p})})})}):h})},se=r(9960),ae=r(500),le=function(e){var n,r=e.count,t=e.params,i=e.isTop,s=e.isCompact,a=e.perPageOptions,l=e.onChange,c=function(){return t.perPage||10};return(0,C.jsx)(se.t,{itemCount:r,page:t.page||1,perPage:c(),onPageInput:function(e,n){l({page:n,perPage:c()})},onSetPage:function(e,n){l({page:n,perPage:c()})},onPerPageSelect:function(e,n){l({page:1,perPage:n})},isCompact:i||s,widgetId:"pagination-options-menu",variant:i?se.a.top:se.a.bottom,perPageOptions:(n=a||[10,20,50,100],n.map((function(e){return{title:String(e),value:e}}))),toggleTemplate:function(e){return(0,C.jsx)(ae.v,(0,w.Z)({},e))}})},ce="https://app.snyk.io/login?utm_campaign=Code-Ready-Analytics-2020&utm_source=code_ready&code_ready=FF1B53D9-57BE-4613-96D7-1D06066C38C9",oe="pkg:maven",de="pkg:npm",ue="pkg:pypi",he="pkg:golang",xe=function(e){return e.startsWith(oe)?oe:e.startsWith(de)?de:e.startsWith(ue)?ue:e.startsWith(he)?he:e},pe=function(e){switch(e){case oe:return"https://central.sonatype.com/artifact/";case de:return"https://www.npmjs.com/package/";case ue:return"https://pypi.org/project/";case he:return"https://pkg.go.dev/";default:return""}},ge=function(e){return e.substring(0,e.lastIndexOf("@")).substring(xe(e).length+1,e.length).replace(/\//g,":")},je=function(e){var n=xe(e);switch(n){case oe:case ue:return pe(n)+e.replace(/@([^@]*)$/,"/$1").substring(n.length+1,e.length);case de:return pe(n)+e.replace(/@([^@]*)$/,"/v/$1").substring(n.length+1,e.length+2);case he:return pe(n)+e.substring(n.length+1,e.length)}return e},ve=function(e,n){switch(e){case"snyk":return"https://security.snyk.io/vuln/".concat(n,"?utm_medium=Partner&utm_source=RedHat&utm_campaign=Code-Ready-Analytics-2020&utm_content=vuln/").concat(n);case"oss-index":return"http://ossindex.sonatype.org/vulnerability/".concat(n)}},fe=function(e){return e.toLowerCase().replace(/./,(function(e){return e.toUpperCase()}))},me=function(e){var n=e.name;return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("a",{href:je(n),target:"_blank",rel:"noreferrer",children:ge(n)})})},ye=r(736),be=r(5351),Te=r(975),Se=r(6647),Ce=function(e){var n,r=e.vulnerability;switch(r.severity){case"CRITICAL":case"HIGH":n=ye.n9.danger;break;default:n=ye.n9.warning}return(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(be.P,{hasGutter:!0,children:[(0,C.jsx)(Te.J,{children:"".concat(r.cvssScore,"/10")}),(0,C.jsx)(Te.J,{isFilled:!0,children:(0,C.jsx)(Se.E,{"aria-label":"cvss-score",value:r.cvssScore,min:0,max:10,size:Se.L.sm,variant:n,measureLocation:ye.nK.none})})]})})},Pe=function(){var e=Le().providerPrivateData;return{hideIssue:function(n,r){return console.log("providerData: ".concat(e," - providerName: ").concat(n," - unique: ").concat(r)),!(!e||-1===e.indexOf(n))&&r}}},we=function(e){var n=e.providerName,r=e.vulnerability,t=Pe();return(0,C.jsx)(C.Fragment,{children:t.hideIssue(n,r.unique)?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("a",{href:ce,target:"_blank",rel:"noreferrer",children:"Sign up for a Snyk account"})," ","to learn about the vulnerabilities found"]}):(0,C.jsx)("a",{href:ve(n,r.id),target:"_blank",rel:"noreferrer",children:r.id})})},ke=r(205),Ie=r(2449),Ee=function(e){var n,r=e.vulnerability;switch(r.severity){case"CRITICAL":case"HIGH":n="red";break;case"MEDIUM":n="orange";break;case"LOW":n="gold";break;default:n="grey"}return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(Ie._,{color:n,isCompact:!0,children:fe(r.severity)})})},Be=r(3424),De=function(e){var n=e.providerName,r=(e.dependency,e.transitiveDependencies),i=(Le().providerPrivateData,Pe()),s=(0,t.useReducer)((function(e){return!e}),!1),a=(0,k.Z)(s,2),l=a[0],u=a[1];return(0,C.jsxs)(c.Z,{isExpanded:l,isCompact:!0,isFlat:!0,children:[(0,C.jsx)(o.O,{onExpand:u,toggleButtonProps:{"aria-expanded":l},children:(0,C.jsx)(d.l,{children:"Transitive dependencies with vulnerabilities"})}),(0,C.jsx)(Be.K,{children:(0,C.jsx)(x.e,{children:(0,C.jsx)("div",{style:{backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:(0,C.jsxs)(L.i,{variant:ke.B.compact,children:[(0,C.jsx)(V.h,{children:(0,C.jsxs)(H.Tr,{children:[(0,C.jsx)(A.Th,{width:20,children:"Dependency"}),(0,C.jsx)(A.Th,{children:"Severity"}),(0,C.jsx)(A.Th,{children:"Exploit Maturity"}),(0,C.jsx)(A.Th,{width:20,children:"Description"}),(0,C.jsx)(A.Th,{width:15,children:"CVSS"}),(0,C.jsx)(A.Th,{width:10,children:"CVE"}),(0,C.jsx)(A.Th,{width:20,children:"Remediation"})]})}),(0,C.jsx)(ie,{isNoData:0===r.length,numRenderedColumns:7,children:(0,C.jsx)(G.p,{children:null===r||void 0===r?void 0:r.map((function(e,r){return e.issues.map((function(t,s){var a;return(0,C.jsxs)(H.Tr,{children:[0===s&&(0,C.jsx)(q.Td,{rowSpan:e.issues.length,children:(0,C.jsx)(me,{name:e.ref})}),i.hideIssue(n,t.unique)?(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(q.Td,{colSpan:3,children:[(0,C.jsx)("a",{href:ce,target:"_blank",rel:"noreferrer",children:"Sign up for a Snyk account"})," ","to learn about the vulnerabilities found"]})}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(q.Td,{noPadding:!0,children:(0,C.jsx)(Ee,{vulnerability:t})}),(0,C.jsx)(q.Td,{children:(null===(a=t.cvss)||void 0===a?void 0:a.exploitCodeMaturity)||"No known exploit"}),(0,C.jsx)(q.Td,{children:t.title})]}),(0,C.jsx)(q.Td,{children:(0,C.jsx)(Ce,{vulnerability:t})}),(0,C.jsx)(q.Td,{children:t.cves}),(0,C.jsx)(q.Td,{children:(0,C.jsx)(we,{providerName:n,vulnerability:t})})]},"".concat(r,"-").concat(s))}))}))})})]})})})})]})},Ze=r(8883),_e=function(e){var n=e.providerName,r=(e.dependency,e.vulnerabilities);return(0,C.jsx)("div",{style:{backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:(0,C.jsxs)(L.i,{variant:ke.B.compact,children:[(0,C.jsx)(Ze.Y,{children:"Details of the dependency"}),(0,C.jsx)(V.h,{children:(0,C.jsxs)(H.Tr,{children:[(0,C.jsx)(A.Th,{children:"Severity"}),(0,C.jsx)(A.Th,{children:"Exploit Maturity"}),(0,C.jsx)(A.Th,{width:25,children:"Description"}),(0,C.jsx)(A.Th,{width:15,children:"CVSS"}),(0,C.jsx)(A.Th,{children:"CVE"}),(0,C.jsx)(A.Th,{children:"Remediation"})]})}),(0,C.jsx)(ie,{isNoData:0===r.length,numRenderedColumns:6,children:null===r||void 0===r?void 0:r.map((function(e,r){var t;return(0,C.jsx)(G.p,{children:(0,C.jsxs)(H.Tr,{children:[(0,C.jsx)(q.Td,{children:(0,C.jsx)(Ee,{vulnerability:e})}),(0,C.jsx)(q.Td,{children:(null===(t=e.cvss)||void 0===t?void 0:t.exploitCodeMaturity)||"No known exploit"}),(0,C.jsx)(q.Td,{children:e.title}),(0,C.jsx)(q.Td,{children:(0,C.jsx)(Ce,{vulnerability:e})}),(0,C.jsx)(q.Td,{children:e.cves}),(0,C.jsx)(q.Td,{children:(0,C.jsx)(we,{providerName:n,vulnerability:e})})]})},r)}))})]})})},Oe=function(){var e=Le(),n="snyk",r=e.report.dependencies,i=(0,t.useState)(""),s=(0,k.Z)(i,2),a=s[0],l=s[1],u=function(e){var n=e.items,r=e.initialSelected,i=void 0===r?[]:r,s=e.isEqual,a=void 0===s?function(e,n){return e===n}:s,l=e.isItemSelectable,c=void 0===l?function(){return!0}:l,o=e.externalState,d=t.useState(i),u=o||d,h=(0,k.Z)(u,2),x=h[0],p=h[1],g=t.useMemo((function(){return n.filter(c)}),[n,c]),j=t.useCallback((function(e){return x.some((function(n){return a(e,n)}))}),[a,x]);t.useEffect((function(){x.every(c)||p(x.filter(c))}),[c,x,p]);var v=t.useCallback((function(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:!j(e))&&c(e)?p([].concat((0,Y.Z)(x),[e])):p(x.filter((function(n){return!a(n,e)})))}),[a,c,j,x,p]),f=t.useCallback((function(e,n){var r=x.filter((function(n){return!e.some((function(e){return a(n,e)}))})),t=e.filter(c);p(n?[].concat((0,Y.Z)(r),(0,Y.Z)(t)):r)}),[a,c,x,p]),m=t.useCallback((function(){return p(arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?[]:g)}),[g,p]),y=x.length===g.length;return{selectedItems:t.useMemo((function(){return y?g:x.length>0?g.filter(j):[]}),[y,j,g,x.length]),isItemSelected:j,isItemSelectable:c,toggleItemSelected:v,selectMultiple:f,areAllSelected:y,selectAll:m,setSelectedItems:p}}({items:r,isEqual:function(e,n){return e.ref===n.ref}}),p=u.isItemSelected,g=u.toggleItemSelected,j=function(e){var n=(0,t.useReducer)(X,(0,w.Z)((0,w.Z)({},Q),{},{currentPage:e&&e.page?(0,w.Z)({},e.page):(0,w.Z)({},Q.currentPage),sortBy:e&&e.sortBy?(0,w.Z)({},e.sortBy):Q.sortBy})),r=(0,k.Z)(n,2),i=r[0],s=r[1],a=(0,t.useCallback)((function(e){var n;s({type:K.SET_PAGE,payload:{page:e.page>=1?e.page:1,perPage:null!==(n=e.perPage)&&void 0!==n?n:Q.currentPage.perPage}})}),[]),l=(0,t.useCallback)((function(e,n,r,t){s({type:K.SET_SORT_BY,payload:{index:n,direction:r}})}),[]);return{page:i.currentPage,sortBy:i.sortBy,changePage:a,changeSortBy:l}}(),v=j.page,f=j.sortBy,m=j.changePage,y=j.changeSortBy,b=function(e){var n=e.items,r=e.currentSortBy,i=e.currentPage,s=e.filterItem,a=e.compareToByColumn;return(0,t.useMemo)((function(){var e,t=(0,Y.Z)(n||[]).filter(s),l=!1;return e=(0,Y.Z)(t).sort((function(e,n){var t=a(e,n,null===r||void 0===r?void 0:r.index);return 0!==t&&(l=!0),t})),l&&(null===r||void 0===r?void 0:r.direction)===$.B.desc&&(e=e.reverse()),{pageItems:e.slice((i.page-1)*i.perPage,i.page*i.perPage),filteredItems:t}}),[n,i,r,a,s])}({items:r,currentPage:v,currentSortBy:f,compareToByColumn:function(e,n,r){return 1===r?e.ref.localeCompare(n.ref):0},filterItem:function(e){var n=!0;return a&&a.trim().length>0&&(n=-1!==e.ref.toLowerCase().indexOf(a.toLowerCase())),n}}),T=b.pageItems,S=b.filteredItems;return(0,C.jsxs)(c.Z,{children:[(0,C.jsx)(o.O,{children:(0,C.jsx)(d.l,{children:"Commonly Known Vulnerabilities"})}),(0,C.jsx)(h.i,{}),(0,C.jsx)(x.e,{children:(0,C.jsxs)("div",{style:{backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:[(0,C.jsx)(I.o,{children:(0,C.jsxs)(E.c,{children:[(0,C.jsx)(B.R,{toggleIcon:(0,C.jsx)(U.ZP,{}),breakpoint:"xl",children:(0,C.jsx)(D.E,{variant:"search-filter",children:(0,C.jsx)(Z.M,{style:{width:"250px"},placeholder:"Filter by Dependency name",value:a,onChange:function(e,n){return l(n)},onClear:function(){return l("")}})})}),(0,C.jsx)(D.E,{variant:D.A.pagination,align:{default:"alignRight"},children:(0,C.jsx)(le,{isTop:!0,count:S.length,params:v,onChange:m})})]})}),(0,C.jsxs)(L.i,{isExpandable:!0,children:[(0,C.jsx)(V.h,{children:(0,C.jsxs)(H.Tr,{children:[(0,C.jsx)(A.Th,{}),(0,C.jsx)(A.Th,{width:25,sort:{columnIndex:1,sortBy:(0,w.Z)({},f),onSort:y},children:"Dependency"}),(0,C.jsx)(A.Th,{children:"Direct"}),(0,C.jsx)(A.Th,{children:"Transitive"}),(0,C.jsx)(A.Th,{width:20,children:"Highest CVSS"}),(0,C.jsx)(A.Th,{width:30,children:"Highest Severity"})]})}),(0,C.jsx)(ie,{isNoData:0===S.length,numRenderedColumns:8,noDataEmptyState:(0,C.jsxs)(_.u,{variant:_.I.sm,children:[(0,C.jsx)(O.k,{icon:W.ZP}),(0,C.jsx)(F.D,{headingLevel:"h2",size:"lg",children:"No vulnerabilities found"}),(0,C.jsx)(N.B,{children:"The vulnerability scan did not find any vulnerabilities in your project."})]}),children:null===T||void 0===T?void 0:T.map((function(e,r){var t;return(0,C.jsxs)(G.p,{isExpanded:p(e),children:[(0,C.jsxs)(H.Tr,{children:[(0,C.jsx)(q.Td,{expand:{rowIndex:r,isExpanded:p(e),onToggle:function(){return g(e)}}}),(0,C.jsx)(q.Td,{children:(0,C.jsx)(me,{name:e.ref})}),(0,C.jsx)(q.Td,{children:(null===(t=e.issues)||void 0===t?void 0:t.length)||0}),(0,C.jsx)(q.Td,{children:e.transitive.map((function(e){return e.issues.length})).reduce((function(e,n){return e+n}),0)}),(0,C.jsx)(q.Td,{children:e.highestVulnerability&&(0,C.jsx)(Ce,{vulnerability:e.highestVulnerability})}),(0,C.jsx)(q.Td,{children:e.highestVulnerability&&(0,C.jsx)(we,{providerName:n,vulnerability:e.highestVulnerability})})]}),p(e)?(0,C.jsxs)(H.Tr,{isExpanded:!0,children:[(0,C.jsx)(q.Td,{}),(0,C.jsx)(q.Td,{className:J.Z.pyLg,colSpan:6,children:(0,C.jsx)(z.G,{children:(0,C.jsxs)(R.K,{hasGutter:!0,children:[e.issues&&e.issues.length>0&&(0,C.jsx)(M.v,{children:(0,C.jsx)(_e,{providerName:n,dependency:e,vulnerabilities:e.issues})}),e.transitive&&e.transitive.length>0&&(0,C.jsx)(M.v,{children:(0,C.jsx)(De,{providerName:n,dependency:e,transitiveDependencies:e.transitive})})]})})})]}):null]},r)}))})]}),(0,C.jsx)(le,{isTop:!1,count:S.length,params:v,onChange:m})]})})]})},Fe=r(272),Ne=function(){var e=Le(),n=Object.entries(e.report.summary.providerStatuses).map((function(e){var n=(0,k.Z)(e,2);n[0];return n[1]})).filter((function(e){return!e.ok}));return(0,C.jsx)(C.Fragment,{children:n.map((function(e,n){return(0,C.jsx)(Fe.b,{variant:e.status>=500?Fe.U.danger:e.status>=400?Fe.U.warning:void 0,title:"".concat(fe(e.provider),": ").concat(e.message)},n)}))})},Re=window.report,Me=(0,t.createContext)(Re),Le=function(){return(0,t.useContext)(Me)};var Ve=function(){return(0,C.jsxs)(Me.Provider,{value:Re,children:[(0,C.jsx)(Ne,{}),(0,C.jsx)(s.NP,{variant:s.Dk.light,children:(0,C.jsx)(a.r,{hasGutter:!0,children:(0,C.jsx)(l.P,{children:(0,C.jsx)(P,{})})})}),(0,C.jsx)(s.NP,{variant:s.Dk.default,children:(0,C.jsx)(Oe,{})})]})},He=function(e){e&&e instanceof Function&&r.e(736).then(r.bind(r,599)).then((function(n){var r=n.getCLS,t=n.getFID,i=n.getFCP,s=n.getLCP,a=n.getTTFB;r(e),t(e),i(e),s(e),a(e)}))};i.createRoot(document.getElementById("root")).render((0,C.jsx)(t.StrictMode,{children:(0,C.jsx)(Ve,{})})),He()}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={id:t,loaded:!1,exports:{}};return e[t](s,s.exports,r),s.loaded=!0,s.exports}r.m=e,function(){var e=[];r.O=function(n,t,i,s){if(!t){var a=1/0;for(d=0;d=s)&&Object.keys(r.O).every((function(e){return r.O[e](t[c])}))?t.splice(c--,1):(l=!1,s0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[t,i,s]}}(),r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,{a:n}),n},r.d=function(e,n){for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.e=function(){return Promise.resolve()},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){var e={179:0};r.O.j=function(n){return 0===e[n]};var n=function(n,t){var i,s,a=t[0],l=t[1],c=t[2],o=0;if(a.some((function(n){return 0!==e[n]}))){for(i in l)r.o(l,i)&&(r.m[i]=l[i]);if(c)var d=c(r)}for(n&&n(t);o1&&void 0!==arguments[1]?arguments[1]:!j(e))&&c(e)?p([].concat((0,$.Z)(x),[e])):p(x.filter((function(n){return!a(n,e)})))}),[a,c,j,x,p]),f=t.useCallback((function(e,n){var r=x.filter((function(n){return!e.some((function(e){return a(n,e)}))})),t=e.filter(c);p(n?[].concat((0,$.Z)(r),(0,$.Z)(t)):r)}),[a,c,x,p]),m=t.useCallback((function(){return p(arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?[]:g)}),[g,p]),y=x.length===g.length;return{selectedItems:t.useMemo((function(){return y?g:x.length>0?g.filter(j):[]}),[y,j,g,x.length]),isItemSelected:j,isItemSelectable:c,toggleItemSelected:v,selectMultiple:f,areAllSelected:y,selectAll:m,setSelectedItems:p}}({items:r,isEqual:function(e,n){return e.ref===n.ref}}),p=u.isItemSelected,g=u.toggleItemSelected,j=function(e){var n=(0,t.useReducer)(X,(0,w.Z)((0,w.Z)({},Q),{},{currentPage:e&&e.page?(0,w.Z)({},e.page):(0,w.Z)({},Q.currentPage),sortBy:e&&e.sortBy?(0,w.Z)({},e.sortBy):Q.sortBy})),r=(0,k.Z)(n,2),i=r[0],s=r[1],a=(0,t.useCallback)((function(e){var n;s({type:K.SET_PAGE,payload:{page:e.page>=1?e.page:1,perPage:null!==(n=e.perPage)&&void 0!==n?n:Q.currentPage.perPage}})}),[]),l=(0,t.useCallback)((function(e,n,r,t){s({type:K.SET_SORT_BY,payload:{index:n,direction:r}})}),[]);return{page:i.currentPage,sortBy:i.sortBy,changePage:a,changeSortBy:l}}(),v=j.page,f=j.sortBy,m=j.changePage,y=j.changeSortBy,b=function(e){var n=e.items,r=e.currentSortBy,i=e.currentPage,s=e.filterItem,a=e.compareToByColumn;return(0,t.useMemo)((function(){var e,t=(0,$.Z)(n||[]).filter(s),l=!1;return e=(0,$.Z)(t).sort((function(e,n){var t=a(e,n,null===r||void 0===r?void 0:r.index);return 0!==t&&(l=!0),t})),l&&(null===r||void 0===r?void 0:r.direction)===q.B.desc&&(e=e.reverse()),{pageItems:e.slice((i.page-1)*i.perPage,i.page*i.perPage),filteredItems:t}}),[n,i,r,a,s])}({items:r,currentPage:v,currentSortBy:f,compareToByColumn:function(e,n,r){return 1===r?e.ref.localeCompare(n.ref):0},filterItem:function(e){var n=!0;return a&&a.trim().length>0&&(n=-1!==e.ref.toLowerCase().indexOf(a.toLowerCase())),n}}),T=b.pageItems,S=b.filteredItems;return(0,C.jsxs)(c.Z,{children:[(0,C.jsx)(o.O,{children:(0,C.jsx)(d.l,{children:"Commonly Known Vulnerabilities"})}),(0,C.jsx)(h.i,{}),(0,C.jsx)(x.e,{children:(0,C.jsxs)("div",{style:{backgroundColor:"var(--pf-v5-global--BackgroundColor--100)"},children:[(0,C.jsx)(I.o,{children:(0,C.jsxs)(E.c,{children:[(0,C.jsx)(B.R,{toggleIcon:(0,C.jsx)(W.ZP,{}),breakpoint:"xl",children:(0,C.jsx)(Z.E,{variant:"search-filter",children:(0,C.jsx)(D.M,{style:{width:"250px"},placeholder:"Filter by Dependency name",value:a,onChange:function(e,n){return l(n)},onClear:function(){return l("")}})})}),(0,C.jsx)(Z.E,{variant:Z.A.pagination,align:{default:"alignRight"},children:(0,C.jsx)(le,{isTop:!0,count:S.length,params:v,onChange:m})})]})}),(0,C.jsxs)(L.i,{isExpandable:!0,children:[(0,C.jsx)(V.h,{children:(0,C.jsxs)(H.Tr,{children:[(0,C.jsx)(A.Th,{}),(0,C.jsx)(A.Th,{width:25,sort:{columnIndex:1,sortBy:(0,w.Z)({},f),onSort:y},children:"Dependency"}),(0,C.jsx)(A.Th,{children:"Direct"}),(0,C.jsx)(A.Th,{children:"Transitive"}),(0,C.jsx)(A.Th,{width:20,children:"Highest CVSS"}),(0,C.jsx)(A.Th,{width:30,children:"Highest Severity"})]})}),(0,C.jsx)(ie,{isNoData:0===S.length,numRenderedColumns:8,noDataEmptyState:(0,C.jsxs)(_.u,{variant:_.I.sm,children:[(0,C.jsx)(O.k,{icon:Y.ZP}),(0,C.jsx)(F.D,{headingLevel:"h2",size:"lg",children:"No vulnerabilities found"}),(0,C.jsx)(N.B,{children:"The vulnerability scan did not find any vulnerabilities in your project."})]}),children:null===T||void 0===T?void 0:T.map((function(e,r){var t;return(0,C.jsxs)(G.p,{isExpanded:p(e),children:[(0,C.jsxs)(H.Tr,{children:[(0,C.jsx)(z.Td,{expand:{rowIndex:r,isExpanded:p(e),onToggle:function(){return g(e)}}}),(0,C.jsx)(z.Td,{children:(0,C.jsx)(me,{name:e.ref})}),(0,C.jsx)(z.Td,{children:(null===(t=e.issues)||void 0===t?void 0:t.length)||0}),(0,C.jsx)(z.Td,{children:e.transitive.map((function(e){return e.issues.length})).reduce((function(e,n){return e+n}),0)}),(0,C.jsx)(z.Td,{children:e.highestVulnerability&&(0,C.jsx)(Ce,{vulnerability:e.highestVulnerability})}),(0,C.jsx)(z.Td,{children:e.highestVulnerability&&(0,C.jsx)(we,{providerName:n,vulnerability:e.highestVulnerability})})]}),p(e)?(0,C.jsxs)(H.Tr,{isExpanded:!0,children:[(0,C.jsx)(z.Td,{}),(0,C.jsx)(z.Td,{className:U.Z.pyLg,colSpan:6,children:(0,C.jsx)(J.G,{children:(0,C.jsxs)(R.K,{hasGutter:!0,children:[e.issues&&e.issues.length>0&&(0,C.jsx)(M.v,{children:(0,C.jsx)(_e,{providerName:n,dependency:e,vulnerabilities:e.issues})}),e.transitive&&e.transitive.length>0&&(0,C.jsx)(M.v,{children:(0,C.jsx)(Ze,{providerName:n,dependency:e,transitiveDependencies:e.transitive})})]})})})]}):null]},r)}))})]}),(0,C.jsx)(le,{isTop:!1,count:S.length,params:v,onChange:m})]})})]})},Fe=r(272),Ne=function(){var e=Le(),n=Object.entries(e.report.summary.providerStatuses).map((function(e){var n=(0,k.Z)(e,2);n[0];return n[1]})).filter((function(e){return!e.ok}));return(0,C.jsx)(C.Fragment,{children:n.map((function(e,n){return(0,C.jsx)(Fe.b,{variant:e.status>=500?Fe.U.danger:e.status>=400?Fe.U.warning:void 0,title:"".concat(fe(e.provider),": ").concat(e.message)},n)}))})},Re=window.report,Me=(0,t.createContext)(Re),Le=function(){return(0,t.useContext)(Me)};var Ve=function(){return(0,C.jsxs)(Me.Provider,{value:Re,children:[(0,C.jsx)(Ne,{}),(0,C.jsx)(s.NP,{variant:s.Dk.light,children:(0,C.jsx)(a.r,{hasGutter:!0,children:(0,C.jsx)(l.P,{children:(0,C.jsx)(P,{})})})}),(0,C.jsx)(s.NP,{variant:s.Dk.default,children:(0,C.jsx)(Oe,{})})]})},He=function(e){e&&e instanceof Function&&r.e(736).then(r.bind(r,599)).then((function(n){var r=n.getCLS,t=n.getFID,i=n.getFCP,s=n.getLCP,a=n.getTTFB;r(e),t(e),i(e),s(e),a(e)}))};i.createRoot(document.getElementById("root")).render((0,C.jsx)(t.StrictMode,{children:(0,C.jsx)(Ve,{})})),He()}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={id:t,loaded:!1,exports:{}};return e[t](s,s.exports,r),s.loaded=!0,s.exports}r.m=e,function(){var e=[];r.O=function(n,t,i,s){if(!t){var a=1/0;for(d=0;d=s)&&Object.keys(r.O).every((function(e){return r.O[e](t[c])}))?t.splice(c--,1):(l=!1,s0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[t,i,s]}}(),r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,{a:n}),n},r.d=function(e,n){for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.e=function(){return Promise.resolve()},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){var e={179:0};r.O.j=function(n){return 0===e[n]};var n=function(n,t){var i,s,a=t[0],l=t[1],c=t[2],o=0;if(a.some((function(n){return 0!==e[n]}))){for(i in l)r.o(l,i)&&(r.m[i]=l[i]);if(c)var d=c(r)}for(n&&n(t);o - {vuln.cves} + {vuln.cves ? vuln.cves.map(i =>

{i}

) : ''} diff --git a/ui/src/components/VulnerabilitiesTable.tsx b/ui/src/components/VulnerabilitiesTable.tsx index b3d4db3e..91450786 100644 --- a/ui/src/components/VulnerabilitiesTable.tsx +++ b/ui/src/components/VulnerabilitiesTable.tsx @@ -51,7 +51,7 @@ export const VulnerabilitiesTable: React.FC = ({ - {vuln.cves} + {vuln.cves ? vuln.cves.map(i =>

{i}

) : ''}