1"use strict";(self.webpackChunkbrandsek=self.webpackChunkbrandsek||[]).push([[2866],{60378(e,t,s){s.d(t,{A6:()=>T,Ct:()=>_,D2:()=>E,F$:()=>b,Fs:()=>C,GG:()=>I,Hl:()=>R,Qd:()=>d,R0:()=>i,RG:()=>N,TR:()=>G,U2:()=>M,U5:()=>u,VD:()=>y,Vi:()=>x,W_:()=>w,Yq:()=>j,_d:()=>P,e7:()=>g,f9:()=>m,fA:()=>D,h1:()=>p,jY:()=>q,l6:()=>k,qk:()=>F,rU:()=>S,sF:()=>A,v7:()=>h,we:()=>f,xI:()=>v});var r=s(89379),a=s(93151),o=s(47139);const c=a.A.create({baseURL:o.H$});function n(e){return e.then(e=>{const t=null===e||void 0===e?void 0:e.data;if(t&&"object"===typeof t&&"error"in t&&"data"in t){if(t.error){var s;const e=new Error(t.userMessage||"Request failed");throw e.code=null===(s=t.errors)||void 0===s?void 0:s.code,e.httpStatus=t.status,e.payload=t,e}return t.data}return t})}c.interceptors.request.use(e=>(e.headers=(0,r.A)((0,r.A)({},e.headers),(()=>{const e=localStorage.getItem("session");return{Authorization:"Bearer ".concat(e)}})()),e));const l=()=>{const e=(()=>{const e=e=>{const t=localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(s){return t}},t=e=>e?"string"===typeof e?e:e._id||e.id||"":"";let s=t(e("org"));if(s)return s;const r=e("user");return r&&"object"===typeof r&&(s=t(r.organisationId)||t(r.organisation),s)?s:""})();if(!e){const e='CSPM: no organisation id in localStorage. Looked at "org", "user.organisationId", "user.organisation". Re-login or pick an org from the sidebar before opening /cspm/*.';throw window.__CSPM_NO_ORG_WARNED||(console.error(e,{org:localStorage.getItem("org"),user:localStorage.getItem("user")}),window.__CSPM_NO_ORG_WARNED=!0),new Error(e)}return"/cspm/".concat(e)},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(c.get("".concat(l(),"/providers"),{params:e}))},d=e=>n(c.post("".concat(l(),"/providers"),e)),m=(e,t)=>n(c.patch("".concat(l(),"/providers/").concat(e),t)),p=e=>n(c.delete("".concat(l(),"/providers/").concat(e))),u=e=>n(c.post("".concat(l(),"/providers/").concat(e,"/test-connection"))),x=e=>n(c.get("".concat(l(),"/providers/aws/onboarding"),{params:e?{accountId:e}:{}})),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(c.get("".concat(l(),"/scans"),{params:e}))},g=e=>n(c.post("".concat(l(),"/scans"),{accountId:e})),f=e=>n(c.delete("".concat(l(),"/scans/").concat(e))),v=()=>n(c.post("".concat(l(),"/scans/all/queue"))),k=e=>n(c.post("".concat(l(),"/providers/aws/bulk"),e)),j=e=>c.get("".concat(l(),"/scans/").concat(e,"/report"),{responseType:"blob"}),b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(c.get("".concat(l(),"/findings"),{params:e}))},w=e=>n(c.get("".concat(l(),"/findings/").concat(e))),N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(c.get("".concat(l(),"/schedules"),{params:e}))},A=e=>n(c.post("".concat(l(),"/schedules"),e)),C=(e,t)=>n(c.patch("".concat(l(),"/schedules/").concat(e),t)),y=e=>n(c.delete("".concat(l(),"/schedules/").concat(e))),S=()=>n(c.get("".concat(l(),"/overview/severity"))),I=()=>n(c.get("".concat(l(),"/overview/services"))),_=()=>n(c.get("".concat(l(),"/overview/providers"))),R=()=>n(c.get("".concat(l(),"/overview/providers/count"))),T=()=>n(c.get("".concat(l(),"/overview/threat-score"))),E=()=>
1n(c.get("".concat(l(),"/compliance/frameworks"))),F=e=>n(c.get("".concat(l(),"/compliance/frameworks/").concat(encodeURIComponent(e)))),M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(c.get("".concat(l(),"/resources"),{params:e}))},q=()=>n(c.get("".concat(l(),"/mute-rules"))),P=e=>n(c.post("".concat(l(),"/mute-rules"),e)),D=(e,t)=>n(c.patch("".concat(l(),"/mute-rules/").concat(e),t)),G=e=>n(c.delete("".concat(l(),"/mute-rules/").concat(e)))},2866(e,t,s){s.r(t),s.d(t,{default:()=>d});var r=s(5544),a=s(9950),o=s(99415),c=s(60378),n=s(8719),l=s(44414);const i=e=>{let t=e.framework,s=e.onClose;const i=(0,a.useState)([]),d=(0,r.A)(i,2),m=d[0],p=d[1],u=(0,a.useState)(!0),x=(0,r.A)(u,2),h=x[0],g=x[1];return(0,a.useEffect)(()=>{g(!0),(0,c.qk)(t).then(e=>p(Array.isArray(null===e||void 0===e?void 0:e.items)?e.items:[])).catch(e=>o.ih.error("CSPM",(null===e||void 0===e?void 0:e.message)||"Failed to load controls.")).finally(()=>g(!1))},[t]),(0,l.jsxs)(n._s,{open:!0,onClose:s,width:620,children:[(0,l.jsxs)(n.BE,{onClose:s,children:[(0,l.jsx)(n.eN,{className:"mb-1",children:"Compliance framework"}),(0,l.jsx)("h2",{className:"m-0 text-xl font-extrabold tracking-tight text-cspm-ink dark:text-cspm-ink-dark",children:t})]}),(0,l.jsx)(n.ys,{className:"p-0",children:h?(0,l.jsx)("div",{className:"p-6 flex flex-col gap-3",children:Array(6).fill(0).map((e,t)=>(0,l.jsx)(n.EA,{h:40},t))}):0===m.length?(0,l.jsx)(n.pp,{icon:"fa-list",iconClass:"text-cspm-mute",title:"No controls found"}):(0,l.jsxs)("table",{className:"w-full border-collapse",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)(n.Th,{children:"Control"}),(0,l.jsx)(n.Th,{children:"Section"}),(0,l.jsx)(n.Th,{align:"right",children:"Passed"}),(0,l.jsx)(n.Th,{align:"right",children:"Failed"})]})}),(0,l.jsx)("tbody",{children:m.map((e,t)=>(0,l.jsxs)("tr",{"data-testid":"cspm-compliance-row",children:[(0,l.jsxs)(n.Td,{children:[(0,l.jsx)("div",{className:"text-[13px] font-bold text-cspm-ink dark:text-cspm-ink-dark",children:e.controlTitle||e.controlId}),e.controlId&&(0,l.jsx)(n.NA,{className:"text-[13px] text-cspm-mute dark:text-cspm-mute-dark",children:e.controlId})]}),(0,l.jsx)(n.Td,{className:"text-xs text-cspm-mute dark:text-cspm-mute-dark",children:e.section||"\u2014"}),(0,l.jsx)(n.Td,{align:"right",className:"text-sev-pass font-extrabold tabular-nums",children:e.passed}),(0,l.jsx)(n.Td,{align:"right",className:(0,n.cn)("font-extrabold tabular-nums",e.failed>0?"text-sev-critical":"text-cspm-mute dark:text-cspm-mute-dark"),children:e.failed})]},(e.controlId||"")+t))})]})})]})},d=()=>{const e=(0,a.useState)([]),t=(0,r.A)(e,2),s=t[0],d=t[1],m=(0,a.useState)(!0),p=(0,r.A)(m,2),u=p[0],x=p[1],h=(0,a.useState)(null),g=(0,r.A)(h,2),f=g[0],v=g[1];return(0,a.useEffect)(()=>{(0,c.D2)().then(e=>d(Array.isArray(null===e||void 0===e?void 0:e.items)?e.items:[])).catch(e=>o.ih.error("CSPM",(null===e||void 0===e?void 0:e.message)||"Failed to load frameworks.")).finally(()=>x(!1))},[]),(0,l.jsxs)("div",{className:"cspm-scope bg-cspm-bg dark:bg-cspm-bg-dark min-h-full px-5 py-6 animate-cspm-fade",children:[(0,l.jsx)(n.zY,{crumbs:[{label:"Home",to:"/"},{label:"CSPM",to:"/cspm/dashboard"},{label:"Compliance"}],title:"Compliance",subtitle:"Continuous posture mapped to industry frameworks"}),u?(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:Array(6).fill(0).map((e,t)=>(0,l.jsx)(n.Zp,{children:(0,l.jsx)(n.EA,{h:90})},t))}):0===s.length?(0,l.jsx)(n.Zp,{children:(0,l.jsx)(n.pp,{icon:"fa-check-square",iconClass:"text-cspm-mute",title:"No compliance data yet",hint:"Run a scan to map findings to frameworks."})}):(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:s.map(e=>{const t=(e.passed||0)+(e.failed||0),s=t>0?Math.round(e.passed/t*100):0,r=(e=>e>=80?{color:"#127A4E",tone:"pass",label:"Compliant"}:e>=65?{color:"#C77700",tone:"warn",label:"In progress"}:{color:"#C0261B",tone:"danger",label:"At risk"})(s);return(0,l.jsx)(n.Zp,{hover:!0,className:"cursor-pointer",children:(0,l.jsxs)("div",{onClick:()=>v(e.framework),children:[(0,l.jsxs)("div",{className:"flex items-start justify-between mb-4 gap-3",children:[(0,l.jsx)("div",{className:"text-[15px] font-extrabold text-cspm-ink dark:text-cspm-ink-dark leading-snug min-w-0",children:e.framework}
1),(0,l.jsx)(n.ab,{tone:r.tone,round:!0,dot:!0,children:r.label})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)(n.Jn,{pct:s,color:r.color,size:76,children:(0,l.jsxs)("span",{className:"text-[15px] font-extrabold",style:{color:r.color},children:[s,"%"]})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"text-xl font-extrabold text-cspm-ink dark:text-cspm-ink-dark",children:[e.passed,(0,l.jsxs)("span",{className:"text-sm font-bold text-cspm-mute dark:text-cspm-mute-dark",children:[" / ",t]})]}),(0,l.jsx)("div",{className:"text-[13px] font-semibold text-cspm-mute dark:text-cspm-mute-dark mt-0.5",children:"controls passing"}),e.failed>0&&(0,l.jsxs)("div",{className:"flex items-center gap-1.5 text-[13px] font-bold text-sev-critical dark:text-[#FF8A80] mt-2",children:[(0,l.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-current"}),e.failed," need attention"]})]})]})]})},e.framework)})}),f&&(0,l.jsx)(i,{framework:f,onClose:()=>v(null)})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.