/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.cloudSecurityPosture_bundle_jsonpfunction=window.cloudSecurityPosture_bundle_jsonpfunction||[]).push([[1],Array(38).concat([function(e,t,s){"use strict";s.d(t,"o",(function(){return g})),s.d(t,"a",(function(){return M})),s.d(t,"k",(function(){return I})),s.d(t,"b",(function(){return x})),s.d(t,"i",(function(){return m})),s.d(t,"h",(function(){return b})),s.d(t,"j",(function(){return L})),s.d(t,"f",(function(){return y})),s.d(t,"g",(function(){return E})),s.d(t,"n",(function(){return N})),s.d(t,"e",(function(){return O})),s.d(t,"l",(function(){return f})),s.d(t,"m",(function(){return S})),s.d(t,"d",(function(){return A})),s.d(t,"c",(function(){return h}));var a=s(4),i=s(22),n=s(3),o=s(41),c=s.n(o),r=s(45),l=s.n(r),u=s(46),d=s.n(u),p=s(42),j=s.n(p);const g={passed:i.euiThemeVars.euiColorSuccess,failed:i.euiThemeVars.euiColorVis9},M="MMMM D, YYYY @ HH:mm:ss.SSS",I=500,x=25,m="cloudPosture:findings:pageSize",b="cloudPosture:benchmark:pageSize",L="cloudPosture:rules:pageSize",y="cloudPosture:complianceDashboard:clusterSort",E="cloudPosture:findings:lastSelectedTab",N={cspm:{policyTemplate:n.r,name:a.i18n.translate("xpack.csp.cspmIntegration.integration.nameTitle",{defaultMessage:"Cloud Security Posture Management"}),shortName:a.i18n.translate("xpack.csp.cspmIntegration.integration.shortNameTitle",{defaultMessage:"CSPM"}),options:[{type:n.g,name:a.i18n.translate("xpack.csp.cspmIntegration.awsOption.nameTitle",{defaultMessage:"AWS"}),benchmark:a.i18n.translate("xpack.csp.cspmIntegration.awsOption.benchmarkTitle",{defaultMessage:"CIS AWS"}),icon:"logoAWS"},{type:n.j,name:a.i18n.translate("xpack.csp.cspmIntegration.gcpOption.nameTitle",{defaultMessage:"GCP"}),benchmark:a.i18n.translate("xpack.csp.cspmIntegration.gcpOption.benchmarkTitle",{defaultMessage:"CIS GCP"}),icon:j.a,isBeta:!0},{type:n.h,name:a.i18n.translate("xpack.csp.cspmIntegration.azureOption.nameTitle",{defaultMessage:"Azure"}),benchmark:a.i18n.translate("xpack.csp.cspmIntegration.azureOption.benchmarkTitle",{defaultMessage:"CIS Azure"}),disabled:!0,icon:"logoAzure",tooltip:a.i18n.translate("xpack.csp.cspmIntegration.azureOption.tooltipContent",{defaultMessage:"Coming soon"})}]},kspm:{policyTemplate:n.D,name:a.i18n.translate("xpack.csp.kspmIntegration.integration.nameTitle",{defaultMessage:"Kubernetes Security Posture Management"}),shortName:a.i18n.translate("xpack.csp.kspmIntegration.integration.shortNameTitle",{defaultMessage:"KSPM"}),options:[{type:n.l,name:a.i18n.translate("xpack.csp.kspmIntegration.vanillaOption.nameTitle",{defaultMessage:"Self-Managed"}),benchmark:a.i18n.translate("xpack.csp.kspmIntegration.vanillaOption.benchmarkTitle",{defaultMessage:"CIS Kubernetes"}),icon:"logoKubernetes"},{type:n.i,name:a.i18n.translate("xpack.csp.kspmIntegration.eksOption.nameTitle",{defaultMessage:"EKS"}),benchmark:a.i18n.translate("xpack.csp.kspmIntegration.eksOption.benchmarkTitle",{defaultMessage:"CIS EKS"}),icon:c.a,tooltip:a.i18n.translate("xpack.csp.kspmIntegration.eksOption.tooltipContent",{defaultMessage:"Elastic Kubernetes Service"})},{type:n.f,name:a.i18n.translate("xpack.csp.kspmIntegration.aksOption.nameTitle",{defaultMessage:"AKS"}),benchmark:a.i18n.translate("xpack.csp.kspmIntegration.aksOption.benchmarkTitle",{defaultMessage:"CIS AKS"}),disabled:!0,icon:l.a,tooltip:a.i18n.translate("xpack.csp.kspmIntegration.aksOption.tooltipContent",{defaultMessage:"Azure Kubernetes Service - Coming soon"})},{type:n.k,name:a.i18n.translate("xpack.csp.kspmIntegration.gkeOption.nameTitle",{defaultMessage:"GKE"}),benchmark:a.i18n.translate("xpack.csp.kspmIntegration.gkeOption.benchmarkTitle",{defaultMessage:"CIS GKE"}),disabled:!0,icon:d.a,tooltip:a.i18n.translate("xpack.csp.kspmIntegration.gkeOption.tooltipContent",{defaultMessage:"Google Kubernetes Engine - Coming soon"})}]},vuln_mgmt:{policyTemplate:n.W,name:"Vulnerability Management",shortName:"VULN_MGMT",options:[{type:n.m,name:a.i18n.translate("xpack.csp.vulnMgmtIntegration.awsOption.nameTitle",{defaultMessage:"Amazon Web Services"}),icon:"logoAWS",benchmark:"N/A"},{type:n.o,name:a.i18n.translate("xpack.csp.vulnMgmtIntegration.gcpOption.nameTitle",{defaultMessage:"GCP"}),disabled:!0,icon:j.a,tooltip:a.i18n.translate("xpack.csp.vulnMgmtIntegration.gcpOption.tooltipContent",{defaultMessage:"Coming soon"}),benchmark:"N/A"},{type:n.n,name:a.i18n.translate("xpack.csp.vulnMgmtIntegration.azureOption.nameTitle",{defaultMessage:"Azure"}),disabled:!0,icon:"logoAzure",tooltip:a.i18n.translate("xpack.csp.vulnMgmtIntegration.azureOption.tooltipContent",{defaultMessage:"Coming soon"}),benchmark:"N/A"}]}},O="https://ela.st/findings",f="1.5.2",S=1e4,A="detection_engine_rules",h="detection_engine_alerts"},,function(e,t,s){"use strict";s.d(t,"e",(function(){return n})),s.d(t,"c",(function(){return o})),s.d(t,"a",(function(){return c})),s.d(t,"b",(function(){return r})),s.d(t,"d",(function(){return l}));var a=s(24),i=s(3);const n=e=>!!e,o=(e,t="Unknown Error")=>e instanceof Error?e.message:"string"==typeof e?e:t;function c(e,t){if(!e)throw new Error(t)}a.PACKAGE_POLICY_SAVED_OBJECT_TYPE,i.p;const r=(e,t)=>{const s=e+t;return 0===s?s:Number((e/(e+t)*100).toFixed(1))},l=(e,t)=>{if(t){const s=t.indicesDetails.find((t=>-1!==t.index.indexOf(e)));if(s)return s.status}return"unknown"}},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5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NCAwIDAgMCAzLjMwOCA2LjczbDMuNzc5LTMuODE1Yy0xLjY0LS43NDgtMi4zNjktMi42OTYtMS42MjgtNC4zNTJhMy4yNDUgMy4yNDUgMCAwIDEgNS45MzcgMGwzLjc4LTMuODE1YTguNDM1IDguNDM1IDAgMCAwLTYuNzU0LTMuMzU0WiIvPgogIDwvZz4KICA8ZGVmcz4KICAgIDxjbGlwUGF0aCBpZD0iYSI+CiAgICAgIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xIDRoMzB2MjQuMzc1SDF6Ii8+CiAgICA8L2NsaXBQYXRoPgogIDwvZGVmcz4KPC9zdmc+Cgo="},,function(e,t,s){const a=s(50),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=s(51),{safeRe:o,t:c}=s(52),r=s(64),{compareIdentifiers:l}=s(65);class SemVer{constructor(e,t){if(t=r(t),e instanceof SemVer){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const s=e.trim().match(t.loose?o[c.LOOSE]:o[c.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===s)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===s&&(a=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=SemVer},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBmaWxsPSIjODA0OTk4IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im03LjQxMiA0LjkxLTIuMTU2LjkyOVYybDIuMTU2LjgzNlY0LjkxWk0zLjMyNCAyLjY1djIuNTA4bDEuNTk2LjY4VjIuMDMybC0xLjU5Ni42MlptLjE2OCAyLjMyMi0uMDg0LS4wMzFWMi44NjdsLjA4NC0uMDMxLjA4NC0uMDMxLjA4NC0uMDMxdjIuMjZsLS4wODQtLjAzMS0uMDg0LS4wMzFabS40Mi4xMjRMMy44IDUuMDY1VjIuNzQzbC4xMTItLjAzLjExMi0uMDMyLjExMi0uMDN2Mi41MzhsLS4xMTItLjAzMS0uMTEyLS4wNjJabS41MDQuMTg2LS4xNC0uMDYyVjIuNTg4bC4xNC0uMDMuMTQtLjA2My4xNjgtLjA2MnYyLjk0MWwtLjE2OC0uMDYxLS4xNC0uMDMxWm04LjAwOC0uMzcyLTIuMTU2LjkyOVYybDIuMTU2LjgzNlY0LjkxWk04LjMzNiAyLjY1djIuNTA4bDEuNTk2LjY4VjIuMDMybC0xLjU5Ni42MlptLjE2OCAyLjMyMi0uMDg0LS4wMzFWMi44NjdsLjA4NC0uMDMxLjA4NC0uMDMxLjA4NC0uMDMxdjIuMjZsLS4wODQtLjAzMS0uMDg0LS4wMzFabS40Mi4xMjQtLjExMi0uMDMxVjIuNzQzbC4xMTItLjAzLjExMi0uMDMyLjExMi0uMDN2Mi41MzhsLS4xMTItLjAzMS0u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BUTABLE:"true"})&&Object({IS_KIBANA_DISTRIBUTABLE:"true"}).NODE_DEBUG&&/\bsemver\b/i.test(Object({IS_KIBANA_DISTRIBUTABLE:"true"}).NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=s}).call(this,s(63))},function(e,t){const s=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:s,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},function(e,t,s){const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=s(51),o=s(50),c=(t=e.exports={}).re=[],r=t.safeRe=[],l=t.src=[],u=t.t={};let d=0;const p="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",n],[p,i]],g=(e,t,s)=>{const a=(e=>{for(const[t,s]of j)e=e.split(`${t}*`).join(`${t}{0,${s}}`).split(`${t}+`).join(`${t}{1,${s}}`);return e})(t),i=d++;o(e,i,t),u[e]=i,l[i]=t,c[i]=new RegExp(t,s?"g":void 0),r[i]=new RegExp(a,s?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),g("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${p}+`),g("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),g("FULL",`^${l[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),g("LOOSE",`^${l[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),g("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),g("COERCE",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?(?:$|[^\\d])`),g("COERCERTL",l[u.COERCE],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},function(e,t,s){const a=s(54);e.exports=(e,t)=>{const s=a(e,t);return s?s.version:null}},function(e,t,s){const a=s(44);e.exports=(e,t,s=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!s)return null;throw e}}},function(e,t,s){var a=s(69),i=s(70);e.exports=function(e,t,s){(void 0!==s&&!i(e[t],s)||void 0===s&&!(t in e))&&a(e,t,s)}},function(e,t,s){e.exports=s(7)(360)},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,s){e.exports=s(7)(1235)},,,,,function(e,t,s){e.exports=s(7)(448)},function(e,t){const s=Object.freeze({loose:!0}),a=Object.freeze({});e.exports=e=>e?"object"!=typeof e?s:e:a},function(e,t){const s=/^[0-9]+$/,a=(e,t)=>{const a=s.test(e),i=s.test(t);return a&&i&&(e=+e,t=+t),e===t?0:a&&!i?-1:i&&!a?1:ea(t,e)}},function(e,t,s){var a=s(67),i=s(89)((function(e,t,s){a(e,t,s)}));e.exports=i},function(e,t,s){var a=s(68),i=s(55),n=s(71),o=s(73),c=s(56),r=s(58),l=s(57);e.exports=function e(t,s,u,d,p){t!==s&&n(s,(function(n,r){if(p||(p=new a),c(n))o(t,s,r,u,e,d,p);else{var j=d?d(l(t,r),n,r+"",t,s,p):void 0;void 0===j&&(j=n),i(t,r,j)}}),r)}},function(e,t,s){e.exports=s(7)(1599)},function(e,t,s){e.exports=s(7)(1656)},function(e,t,s){e.exports=s(7)(808)},function(e,t,s){var a=s(72)();e.exports=a},function(e,t){e.exports=function(e){return function(t,s,a){for(var i=-1,n=Object(t),o=a(t),c=o.length;c--;){var r=o[e?c:++i];if(!1===s(n[r],r,n))break}return t}}},function(e,t,s){var a=s(55),i=s(74),n=s(75),o=s(76),c=s(77),r=s(78),l=s(79),u=s(80),d=s(83),p=s(84),j=s(56),g=s(85),M=s(86),I=s(57),x=s(87);e.exports=function(e,t,s,m,b,L,y){var E=I(e,s),N=I(t,s),O=y.get(N);if(O)a(e,s,O);else{var f=L?L(E,N,s+"",e,t,y):void 0,S=void 0===f;if(S){var A=l(N),h=!A&&d(N),T=!A&&!h&&M(N);f=N,A||h||T?l(E)?f=E:u(E)?f=o(E):h?(S=!1,f=i(N,!0)):T?(S=!1,f=n(N,!0)):f=[]:g(N)||r(N)?(f=E,r(E)?f=x(E):j(E)&&!p(E)||(f=c(N))):S=!1}S&&(y.set(N,f),b(f,N,m,L,y),y.delete(N)),a(e,s,f)}}},function(e,t,s){e.exports=s(7)(3646)},function(e,t,s){e.exports=s(7)(3655)},function(e,t,s){e.exports=s(7)(3647)},function(e,t,s){e.exports=s(7)(3656)},function(e,t,s){e.exports=s(7)(1608)},function(e,t,s){e.exports=s(7)(284)},function(e,t,s){var a=s(81),i=s(82);e.exports=function(e){return i(e)&&a(e)}},function(e,t,s){e.exports=s(7)(1220)},function(e,t,s){e.exports=s(7)(282)},function(e,t,s){e.exports=s(7)(1216)},function(e,t,s){e.exports=s(7)(938)},function(e,t,s){e.exports=s(7)(3667)},function(e,t,s){e.exports=s(7)(1610)},function(e,t,s){var a=s(88),i=s(58);e.exports=function(e){return a(e,i(e))}},function(e,t,s){e.exports=s(7)(679)},function(e,t,s){var a=s(90),i=s(94);e.exports=function(e){return a((function(t,s){var a=-1,n=s.length,o=n>1?s[n-1]:void 0,c=n>2?s[2]:void 0;for(o=e.length>3&&"function"==typeof o?(n--,o):void 0,c&&i(s[0],s[1],c)&&(o=n<3?void 0:o,n=1),t=Object(t);++aa(e,t,s)<0},function(e,t,s){const a=s(44),i=s(54),{safeRe:n,t:o}=s(52);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let s=null;if((t=t||{}).rtl){let t;for(;(t=n[o.COERCERTL].exec(e))&&(!s||s.index+s[0].length!==e.length);)s&&t.index+t[0].length===s.index+s[0].length||(s=t),n[o.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;n[o.COERCERTL].lastIndex=-1}else s=e.match(n[o.COERCE]);return null===s?null:i(`${s[2]}.${s[3]||"0"}.${s[4]||"0"}`,t)}},,,,,,,,,,,,,,,,,,,,,function(e,t,s){"use strict";s.r(t),s.d(t,"AWS_SINGLE_ACCOUNT",(function(){return De})),s.d(t,"AWS_ORGANIZATION_ACCOUNT",(function(){return Ce})),s.d(t,"GCP_SINGLE_ACCOUNT",(function(){return ve})),s.d(t,"GCP_ORGANIZATION_ACCOUNT",(function(){return ze})),s.d(t,"CspPolicyTemplateForm",(function(){return Pe})),s.d(t,"default",(function(){return Pe}));var a=s(1),i=s.n(a),n=s(49),o=s.n(n),c=s(53),r=s.n(c),l=s(2),u=s(19),d=s(21),p=s(4),j=s(0),g={name:"y1f223",styles:"margin:auto"};const M=({idSelected:e,size:t,options:s,disabled:a,onChange:i})=>{const{euiTheme:n}=Object(l.useEuiTheme)();return Object(j.jsx)("div",{css:Object(j.css)("display:flex;flex-flow:row wrap;gap:",n.size.s,";@media only screen and (max-width: ",n.breakpoint.m,"px){.euiToolTipAnchor{min-width:100%;}}","")},s.map((s=>{const o=s.id===e;return Object(j.jsx)(l.EuiToolTip,{key:s.id,content:s.tooltip,anchorProps:{style:{flex:"1 1 0"}}},Object(j.jsx)(l.EuiButton,{disabled:s.disabled||a,style:{border:`1px solid ${o?n.colors.primary:n.colors.lightShade}`},color:o?"primary":"",onClick:()=>i(s.id),iconType:s.icon,iconSide:"right",contentProps:{style:{justifyContent:"flex-start"}},css:Object(j.css)("width:100%;height:","s"===t?n.size.xxl:n.size.xxxl,";svg,img{margin-left:auto;}&&,&&:hover{text-decoration:none;}&:disabled{svg,img{filter:grayscale(1);}}","")},Object(j.jsx)(l.EuiRadio,{label:s.label,id:s.id,checked:o,onChange:()=>{}}),s.isBeta&&Object(j.jsx)("div",{css:g},Object(j.jsx)(l.EuiBetaBadge,{label:"Beta",alignment:"middle"}))))})))};var I=s(40),x=s(3),m=s(66),b=s.n(m);const L=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.assumeRoleDescription",defaultMessage:"An IAM role Amazon Resource Name (ARN) is an IAM identity that you can create in your AWS account. When creating an IAM role, users can define the role’s permissions. Roles do not have standard long-term credentials such as passwords or access keys."}))),y=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.directAccessKeysDescription",defaultMessage:"Access keys are long-term credentials for an IAM user or the AWS account root user."}))),E=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.temporaryKeysDescription",defaultMessage:"You can configure temporary security credentials in AWS to last for a specified duration. They consist of an access key ID, a secret access key, and a security token, which is typically found using GetSessionToken."}))),N=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.sharedCredentialsDescription",defaultMessage:"If you use different AWS credentials for different tools or applications, you can use profiles to define multiple access keys in the same configuration file."}))),O={access_key_id:p.i18n.translate("xpack.csp.awsIntegration.accessKeyIdLabel",{defaultMessage:"Access Key ID"}),secret_access_key:p.i18n.translate("xpack.csp.awsIntegration.secretAccessKeyLabel",{defaultMessage:"Secret Access Key"})},f="assume_role",S=()=>({assume_role:{label:p.i18n.translate("xpack.csp.awsIntegration.assumeRoleLabel",{defaultMessage:"Assume role"}),info:L,fields:{role_arn:{label:p.i18n.translate("xpack.csp.awsIntegration.roleArnLabel",{defaultMessage:"Role ARN"})}}},direct_access_keys:{label:p.i18n.translate("xpack.csp.awsIntegration.directAccessKeyLabel",{defaultMessage:"Direct access keys"}),info:y,fields:{access_key_id:{label:O.access_key_id},secret_access_key:{label:O.secret_access_key,type:"password"}}},temporary_keys:{info:E,label:p.i18n.translate("xpack.csp.awsIntegration.temporaryKeysLabel",{defaultMessage:"Temporary keys"}),fields:{access_key_id:{label:O.access_key_id},secret_access_key:{label:O.secret_access_key,type:"password"},session_token:{label:p.i18n.translate("xpack.csp.awsIntegration.sessionTokenLabel",{defaultMessage:"Session Token"})}}},shared_credentials:{label:p.i18n.translate("xpack.csp.awsIntegration.sharedCredentialLabel",{defaultMessage:"Shared credentials"}),info:N,fields:{shared_credential_file:{label:p.i18n.translate("xpack.csp.awsIntegration.sharedCredentialFileLabel",{defaultMessage:"Shared Credential File"})},credential_profile_name:{label:p.i18n.translate("xpack.csp.awsIntegration.credentialProfileNameLabel",{defaultMessage:"Credential Profile Name"})}}},cloud_formation:{label:"CloudFormation",info:[],fields:{}}});var A=s(5);const h=e=>{var t;return null===(t=e.streams[0].vars)||void 0===t?void 0:t["aws.credentials.type"].value},T=(e,t,s)=>{null==t||t({...e,inputs:e.inputs.map((e=>e.type===x.g?{...e,config:{cloud_formation_template_url:{value:s}}}:e))})},D=({packageInfo:e,newPolicy:t,updatePolicy:s,setupFormat:i})=>{var n;Object(a.useEffect)((()=>{const a=(e=>{var t,s,a,i;return(null==e||null===(t=e.inputs)||void 0===t||null===(s=t.find((e=>e.type===x.g)))||void 0===s||null===(a=s.config)||void 0===a||null===(i=a.cloud_formation_template_url)||void 0===i?void 0:i.value)||void 0})(t);if("manual"===i)return void(a&&T(t,s,void 0));const n=ne(e);""!==n&&a!==n&&T(t,s,n)}),[null==t||null===(n=t.vars)||void 0===n?void 0:n.cloud_formation_template_url,t,e,i])},C=({integrationLink:e})=>Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiHorizontalRule,{margin:"xxl"}),Object(j.jsx)(l.EuiTitle,{size:"s"},Object(j.jsx)("h2",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.setupInfoContentTitle",defaultMessage:"Setup Access"}))),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.gettingStarted.setupInfoContent",defaultMessage:"Utilize AWS CloudFormation (a built-in AWS tool) or a series of manual steps to set up and deploy CSPM for assessing your AWS environment's security posture. Refer to our {gettingStartedLink} guide for details.",values:{gettingStartedLink:Object(j.jsx)(l.EuiLink,{href:e,target:"_blank"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.gettingStarted.setupInfoContentLink",defaultMessage:"Getting Started"}))}}))),v=e=>ne(e)?"cloud_formation":f;var z={name:"qdust2",styles:"list-style:auto"};const k=({hasCloudFormationTemplate:e,input:t})=>{var s,a,n,o;if(!e)return Object(j.jsx)(l.EuiCallOut,{color:"warning"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.cloudFormationSetupStep.notSupported",defaultMessage:"CloudFormation is not supported on the current Integration version, please upgrade your integration to the latest version to use CloudFormation"}));const c=null===(s=t.streams)||void 0===s||null===(a=s[0])||void 0===a||null===(n=a.vars)||void 0===n||null===(o=n["aws.account_type"])||void 0===o?void 0:o.value;return Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)("ol",{css:z},c===Ce?Object(j.jsx)("li",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.cloudFormationSetupStep.organizationLogin",defaultMessage:"Log in as an admin in your organization's AWS management account"})):Object(j.jsx)("li",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.cloudFormationSetupStep.login",defaultMessage:"Log in as an admin to the AWS Account you want to onboard"})),Object(j.jsx)("li",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.cloudFormationSetupStep.save",defaultMessage:"Click the Save and continue button on the bottom right of this page"})),Object(j.jsx)("li",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.cloudFormationSetupStep.launch",defaultMessage:"On the subsequent pop-up modal, click the Launch CloudFormation button."})))),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(_,{url:w}))},w="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-howdoesitwork.html",R=({children:e,url:t})=>Object(j.jsx)(l.EuiLink,{href:t,target:"_blank",rel:"noopener nofollow noreferrer","data-test-subj":"externalLink"},e),_=({url:e})=>Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.awsIntegration.cloudFormationSetupNote",defaultMessage:"Read the {documentation} for more details",values:{documentation:Object(j.jsx)(R,{url:e},p.i18n.translate("xpack.csp.awsIntegration.documentationLinkText",{defaultMessage:"documentation"}))}})),P=({input:e,newPolicy:t,updatePolicy:s,packageInfo:n,onChange:o,setIsValid:c})=>{const{awsCredentialsType:r,setupFormat:u,group:d,fields:g,integrationLink:I,hasCloudFormationTemplate:x,onSetupFormatChange:m}=(({newPolicy:e,input:t,packageInfo:s,onChange:i,setIsValid:n,updatePolicy:o})=>{const c=h(t)||f,r=S(),l=!!ne(s),u=((e,t)=>{const s=h(e);return!s&&t?"cloud_formation":"cloud_formation"!==s?"manual":"cloud_formation"})(t,l),d=r[c],p=((e,t)=>Object.entries(e.streams[0].vars||{}).filter((([e])=>e in t)).map((([e,s])=>{const a=t[e];return{id:e,label:a.label,type:a.type||"text",value:s.value}})))(t,d.fields),j=Object(a.useRef)({}),g=Object(a.useRef)(void 0);Object(a.useEffect)((()=>{const t="cloud_formation"===u&&!l;n(!t),i({isValid:!t,updatedPolicy:e})}),[u,t.type]);const M=A.d.cspm.getStartedPath;return D({packageInfo:s,newPolicy:e,updatePolicy:o,setupFormat:u}),{awsCredentialsType:c,setupFormat:u,group:d,fields:p,integrationLink:M,hasCloudFormationTemplate:l,onSetupFormatChange:s=>{"cloud_formation"===s?(j.current=Object.fromEntries(p.map((e=>[e.id,{value:e.value}]))),g.current=h(t),o(ae(e,t.type,{"aws.credentials.type":{value:"cloud_formation",type:"text"},...Object.fromEntries(p.map((e=>[e.id,{value:void 0}])))}))):o(ae(e,t.type,{"aws.credentials.type":{value:g.current||f,type:"text"},...j.current}))}}})({newPolicy:t,input:e,packageInfo:n,onChange:o,setIsValid:c,updatePolicy:s});return Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(C,{integrationLink:I}),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(M,{size:"m",options:[{id:"cloud_formation",label:"CloudFormation"},{id:"manual",label:p.i18n.translate("xpack.csp.awsIntegration.setupFormatOptions.manual",{defaultMessage:"Manual"})}],idSelected:u,onChange:e=>e!==u&&m(e)}),Object(j.jsx)(l.EuiSpacer,{size:"l"}),"cloud_formation"===u&&Object(j.jsx)(k,{hasCloudFormationTemplate:x,input:e}),"manual"===u&&Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(F,{type:r,onChange:a=>{s(ae(t,e.type,{"aws.credentials.type":{value:a}}))}}),Object(j.jsx)(l.EuiSpacer,{size:"m"}),d.info,Object(j.jsx)(l.EuiSpacer,{size:"m"}),Object(j.jsx)(_,{url:I}),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(Y,{fields:g,onChange:(a,i)=>{s(ae(t,e.type,{[a]:{value:i}}))}})),Object(j.jsx)(l.EuiSpacer,null))},F=({type:e,onChange:t})=>Object(j.jsx)(l.EuiFormRow,{fullWidth:!0,label:p.i18n.translate("xpack.csp.awsIntegration.awsCredentialTypeSelectorLabel",{defaultMessage:"Preferred manual method"})},Object(j.jsx)(l.EuiSelect,{fullWidth:!0,options:Object.entries(S()).map((([e,t])=>({value:e,text:t.label}))).filter((({value:e})=>"cloud_formation"!==e)),value:e,onChange:e=>{t(e.target.value)}})),Y=({fields:e,onChange:t})=>Object(j.jsx)("div",null,e.map((e=>Object(j.jsx)(l.EuiFormRow,{key:e.id,label:e.label,fullWidth:!0,hasChildLabel:!0,id:e.id},Object(j.jsx)(i.a.Fragment,null,"password"===e.type&&Object(j.jsx)(l.EuiFieldPassword,{id:e.id,type:"dual",fullWidth:!0,value:e.value||"",onChange:s=>t(e.id,s.target.value)}),"text"===e.type&&Object(j.jsx)(l.EuiFieldText,{id:e.id,fullWidth:!0,value:e.value||"",onChange:s=>t(e.id,s.target.value)}))))));var G=s(38);const U=()=>Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiHorizontalRule,{margin:"xxl"}),Object(j.jsx)(l.EuiTitle,{size:"s"},Object(j.jsx)("h2",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.eksIntegration.setupInfoContentTitle",defaultMessage:"Setup Access"}))),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.eksIntegration.setupInfoContent",defaultMessage:"The integration will need elevated access to run some CIS benchmark rules. Select your preferred method of providing the AWS credentials this integration will use. You can follow these step-by-step instructions to generate the necessary credentials."}))),W=Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.eksIntegration.docsLink",defaultMessage:"Read the {docs} for more details",values:{docs:Object(j.jsx)(l.EuiLink,{href:"https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html",external:!0},"documentation")}})),Z=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.eksIntegration.assumeRoleDescription",defaultMessage:"An IAM role Amazon Resource Name (ARN) is an IAM identity that you can create in your AWS account. When creating an IAM role, users can define the role’s permissions. Roles do not have standard long-term credentials such as passwords or access keys."}))),$=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.eksIntegration.directAccessKeysDescription",defaultMessage:"Access keys are long-term credentials for an IAM user or the AWS account root user."}))),Q=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.eksIntegration.temporaryKeysDescription",defaultMessage:"You can configure temporary security credentials in AWS to last for a specified duration. They consist of an access key ID, a secret access key, and a security token, which is typically found using GetSessionToken."}))),V=Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.eksIntegration.sharedCredentialsDescription",defaultMessage:"If you use different AWS credentials for different tools or applications, you can use profiles to define multiple access keys in the same configuration file."}))),B={access_key_id:p.i18n.translate("xpack.csp.eksIntegration.accessKeyIdLabel",{defaultMessage:"Access Key ID"}),secret_access_key:p.i18n.translate("xpack.csp.eksIntegration.secretAccessKeyLabel",{defaultMessage:"Secret Access Key"})},X={assume_role:{label:p.i18n.translate("xpack.csp.eksIntegration.assumeRoleLabel",{defaultMessage:"Assume role"}),info:Z,fields:{role_arn:{label:p.i18n.translate("xpack.csp.eksIntegration.roleArnLabel",{defaultMessage:"Role ARN"})}}},direct_access_keys:{label:p.i18n.translate("xpack.csp.eksIntegration.directAccessKeyLabel",{defaultMessage:"Direct access keys"}),info:$,fields:{access_key_id:{label:B.access_key_id},secret_access_key:{label:B.secret_access_key,type:"password"}}},temporary_keys:{info:Q,label:p.i18n.translate("xpack.csp.eksIntegration.temporaryKeysLabel",{defaultMessage:"Temporary keys"}),fields:{access_key_id:{label:B.access_key_id},secret_access_key:{label:B.secret_access_key,type:"password"},session_token:{label:p.i18n.translate("xpack.csp.eksIntegration.sessionTokenLabel",{defaultMessage:"Session Token"})}}},shared_credentials:{label:p.i18n.translate("xpack.csp.eksIntegration.sharedCredentialLabel",{defaultMessage:"Shared credentials"}),info:V,fields:{shared_credential_file:{label:p.i18n.translate("xpack.csp.eksIntegration.sharedCredentialFileLabel",{defaultMessage:"Shared Credential File"})},credential_profile_name:{label:p.i18n.translate("xpack.csp.eksIntegration.credentialProfileNameLabel",{defaultMessage:"Credential Profile Name"})}}}},H=Object.keys(X).map((e=>({id:e,label:X[e].label}))),K=({input:e,newPolicy:t,updatePolicy:s})=>{const a=(e=>{var t;return null===(t=e.streams[0].vars)||void 0===t?void 0:t["aws.credentials.type"].value})(e)||H[0].id,n=X[a],o=((e,t)=>Object.entries(e.streams[0].vars||{}).filter((([e])=>e in t)).map((([e,s])=>{const a=t[e];return{id:e,label:a.label,type:a.type||"text",value:s.value}})))(e,n.fields);return Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(U,null),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(J,{type:a,onChange:a=>s(ae(t,e.type,{"aws.credentials.type":{value:a}}))}),Object(j.jsx)(l.EuiSpacer,{size:"m"}),n.info,Object(j.jsx)(l.EuiSpacer,{size:"s"}),W,Object(j.jsx)(l.EuiSpacer,null),Object(j.jsx)(q,{fields:o,onChange:(a,i)=>s(ae(t,e.type,{[a]:{value:i}}))}),Object(j.jsx)(l.EuiSpacer,null))},J=({type:e,onChange:t})=>Object(j.jsx)(M,{size:"s",options:[...H],idSelected:e,onChange:e=>t(e)}),q=({fields:e,onChange:t})=>Object(j.jsx)("div",null,e.map((e=>Object(j.jsx)(l.EuiFormRow,{key:e.id,label:e.label,fullWidth:!0,hasChildLabel:!0,id:e.id},Object(j.jsx)(i.a.Fragment,null,"password"===e.type&&Object(j.jsx)(l.EuiFieldPassword,{id:e.id,type:"dual",fullWidth:!0,value:e.value||"",onChange:s=>t(e.id,s.target.value)}),"text"===e.type&&Object(j.jsx)(l.EuiFieldText,{id:e.id,fullWidth:!0,value:e.value||"",onChange:s=>t(e.id,s.target.value)})))))),ee="default",te=e=>{switch(e){case x.g:case x.h:case x.j:return"cspm";case x.l:case x.i:return"kspm";case x.m:return"vuln_mgmt";default:return"n/a"}},se=e=>{switch(e){case x.g:case x.m:return"aws";case x.h:return"azure";case x.j:return"gcp";case x.l:return"self_managed";case x.i:return"eks";default:return"n/a"}},ae=(e,t,s)=>({...e,namespace:ee,inputs:e.inputs.map((e=>((e,t,s)=>{const a=e.type===t;return{...e,enabled:a,streams:e.streams.map((e=>({...e,enabled:a,...a&&e.vars&&s&&{vars:{...e.vars,...s}}})))}})(e,t,s))),vars:b()({},e.vars,{deployment:{value:se(t)},posture:{value:te(t)}})}),ie=e=>e.hasOwnProperty("inputs"),ne=e=>{if(!e.policy_templates)return"";const t=e.policy_templates.find((e=>e.name===x.r));if(!t)return"";const s=ie(t)&&t.inputs;return s?s.reduce(((e,t)=>{var s;if(!t.vars)return e;const a=null===(s=t.vars.find((e=>"cloud_formation_template"===e.name)))||void 0===s?void 0:s.default;return a?String(a):e}),""):""};var oe=s(6),ce=s.n(oe),re=s(95),le=s.n(re),ue=s(96),de=s.n(ue);const pe=()=>Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiHorizontalRule,{margin:"xxl"}),Object(j.jsx)(l.EuiSpacer,{size:"s"}),Object(j.jsx)(l.EuiTitle,{size:"s"},Object(j.jsx)("h2",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.gcpIntegration.setupInfoContentTitle",defaultMessage:"Setup Access"}))),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.gcpIntegration.setupInfoContent",defaultMessage:"The integration will need elevated access to run some CIS benchmark rules. Select your preferred method of providing the GCP credentials this integration will use. You can follow these step-by-step instructions to generate the necessary credentials."})));var je={name:"qdust2",styles:"list-style:auto"};const ge=()=>Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s","data-test-subj":"google_cloud_shell_setup_test_id"},Object(j.jsx)("ol",{css:je},Object(j.jsx)("li",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.gcpIntegration.cloudShellSetupStep.login",defaultMessage:"Log into your Google Cloud Console"})),Object(j.jsx)("li",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.gcpIntegration.cloudShellSetupStep.save",defaultMessage:"Note down the GCP project ID of the project you wish to monitor"})),Object(j.jsx)("li",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.gcpIntegration.cloudShellSetupStep.launch",defaultMessage:'Click "Save and Continue" at the bottom right of the page. Then, on the pop-up modal, click "Launch Google Cloud Shell"'})))),Object(j.jsx)(l.EuiSpacer,{size:"l"})),Me=[{text:p.i18n.translate("xpack.csp.gcpIntegration.credentialsFileOption",{defaultMessage:"Credentials File"}),value:"credentials-file"},{text:p.i18n.translate("xpack.csp.gcpIntegration.credentialsJsonOption",{defaultMessage:"Credentials JSON"}),value:"credentials-json"}],Ie={fields:{"gcp.project_id":{label:p.i18n.translate("xpack.csp.gcpIntegration.projectidFieldLabel",{defaultMessage:"Project ID"}),type:"text"},"gcp.credentials.file":{label:p.i18n.translate("xpack.csp.findings.gcpIntegration.gcpInputText.credentialFileText",{defaultMessage:"Path to JSON file containing the credentials and key used to subscribe"}),type:"text"},"gcp.credentials.json":{label:p.i18n.translate("xpack.csp.findings.gcpIntegration.gcpInputText.credentialJSONText",{defaultMessage:"JSON blob containing the credentials and key used to subscribe"}),type:"text"},"gcp.credentials.type":{label:p.i18n.translate("xpack.csp.findings.gcpIntegration.gcpInputText.credentialSelectBoxTitle",{defaultMessage:"Credential"}),type:"text"}}},xe=(e,t,s)=>{null==t||t({...e,inputs:e.inputs.map((e=>e.type===x.j?{...e,config:{cloud_shell_url:{value:s}}}:e))})},me=({input:e,newPolicy:t,updatePolicy:s,packageInfo:n,setIsValid:o,onChange:c})=>{const d=((e,t)=>Object.entries(e.streams[0].vars||{}).filter((([e])=>e in t)).map((([e,s])=>{const a=t[e];return{id:e,label:a.label,type:a.type||"text",value:s.value}})))(e,Ie.fields),g=r()(n.version),I=de()(g)||"",m=le()(I,G.l),b=Object(a.useRef)({}),L=Object(a.useRef)(void 0),y=(e=>{var t,s;const a=null===(t=e.streams[0].vars)||void 0===t||null===(s=t.setup_access)||void 0===s?void 0:s.value;return a&&a!==x.L?x.M:x.L})(e);return(({packageInfo:e,newPolicy:t,updatePolicy:s,setupFormat:i})=>{var n;Object(a.useEffect)((()=>{const a=(e=>{var t,s,a,i;return(null==e||null===(t=e.inputs)||void 0===t||null===(s=t.find((e=>e.type===x.j)))||void 0===s||null===(a=s.config)||void 0===a||null===(i=a.cloud_shell_url)||void 0===i?void 0:i.value)||void 0})(t);if(i===x.M)return void(a&&xe(t,s,void 0));const n=(e=>{if(!e.policy_templates)return"";const t=e.policy_templates.find((e=>e.name===x.r));if(!t)return"";const s=ie(t)&&t.inputs;return s?s.reduce(((e,t)=>{var s;if(!t.vars)return e;const a=null===(s=t.vars.find((e=>"cloud_shell_url"===e.name)))||void 0===s?void 0:s.default;return a?String(a):e}),""):""})(e);""!==n&&a!==n&&xe(t,s,n)}),[null==t||null===(n=t.vars)||void 0===n?void 0:n.cloud_shell_url,t,e,i])})({packageInfo:n,newPolicy:t,updatePolicy:s,setupFormat:y}),Object(a.useEffect)((()=>{var e;const s=y===x.M&&!(null!==("gcp.project_id",e=d.find((e=>"gcp.project_id"===e.id)))&&void 0!==e&&e.value);const a=m||s;o(!a),c({isValid:!a,updatedPolicy:t})}),[e,n,y]),m?Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(l.EuiCallOut,{color:"warning"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.gcpIntegration.gcpNotSupportedMessage",defaultMessage:"CIS GCP is not supported on the current Integration version, please upgrade your integration to the latest version to use CIS GCP"}))):Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(pe,null),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(M,{size:"s",options:[{id:x.L,label:p.i18n.translate("xpack.csp.gcpIntegration.setupFormatOptions.googleCloudShell",{defaultMessage:"Google Cloud Shell"}),disabled:!1},{id:x.M,label:p.i18n.translate("xpack.csp.gcpIntegration.setupFormatOptions.manual",{defaultMessage:"Manual"}),disabled:!1}],idSelected:y,onChange:a=>{var i,n;a===x.L?(b.current=Object.fromEntries(d.map((e=>[e.id,{value:e.value}]))),L.current=null===(i=e.streams[0].vars)||void 0===i||null===(n=i.setup_access)||void 0===n?void 0:n.value,s(ae(t,e.type,{setup_access:{value:x.L,type:"text"},...Object.fromEntries(d.map((e=>[e.id,{value:void 0}])))}))):s(ae(t,e.type,{setup_access:{value:x.M,type:"text"},...b.current}))}}),Object(j.jsx)(l.EuiSpacer,{size:"l"}),y===x.M?Object(j.jsx)(be,{fields:d,onChange:(a,i)=>s(ae(t,e.type,{[a]:{value:i}}))}):Object(j.jsx)(ge,null),Object(j.jsx)(l.EuiSpacer,{size:"s"}),Object(j.jsx)(_,{url:A.d.cspm.getStartedPath}),Object(j.jsx)(l.EuiSpacer,null))},be=({fields:e,onChange:t})=>{const s=t=>e.find((e=>e.id===t)),a=s("gcp.project_id"),i=s("gcp.credentials.type"),n=s("gcp.credentials.file"),o=s("gcp.credentials.json"),c=Me[0].value,r=Me[1].value,u=(null==i?void 0:i.value)||Me[0].value;return Object(j.jsx)("div",null,Object(j.jsx)(l.EuiForm,{component:"form"},a&&Object(j.jsx)(l.EuiFormRow,{fullWidth:!0,label:Ie.fields["gcp.project_id"].label},Object(j.jsx)(l.EuiFieldText,{"data-test-subj":"project_id_test_id",id:a.id,fullWidth:!0,value:a.value||"",onChange:e=>t(a.id,e.target.value)})),i&&n&&o&&Object(j.jsx)(l.EuiFormRow,{fullWidth:!0,label:Ie.fields["gcp.credentials.type"].label},Object(j.jsx)(l.EuiSelect,{"data-test-subj":"credentials_type_test_id",fullWidth:!0,options:Me,value:(null==i?void 0:i.value)||Me[0].value,onChange:e=>{t(null==i?void 0:i.id,e.target.value)}})),u===c&&n&&Object(j.jsx)(l.EuiFormRow,{fullWidth:!0,label:Ie.fields["gcp.credentials.file"].label},Object(j.jsx)(l.EuiFieldText,{"data-test-subj":"credentials_file_test_id",id:n.id,fullWidth:!0,value:n.value||"",onChange:e=>t(n.id,e.target.value)})),u===r&&o&&Object(j.jsx)(l.EuiFormRow,{fullWidth:!0,label:Ie.fields["gcp.credentials.json"].label},Object(j.jsx)(l.EuiTextArea,{"data-test-subj":"credentials_json_test_id",id:o.id,fullWidth:!0,value:o.value||"",onChange:e=>t(o.id,e.target.value)}))))},Le=({policy:e,selectedTemplate:t,setPolicyTemplate:s,disabled:a})=>{const i=new Set(e.inputs.map((e=>e.policy_template)));return Object(j.jsx)("div",null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.selectIntegrationTypeTitle",defaultMessage:"Select the type of security posture management integration you want to configure"})),Object(j.jsx)(l.EuiSpacer,{size:"m"}),Object(j.jsx)(M,{options:Array.from(i,(e=>{return{id:e,label:(t=e,t===x.W?x.q.toUpperCase():t.toUpperCase())};var t})),idSelected:t,onChange:e=>s(e),disabled:a}))},ye=({input:e,...t})=>{switch(e.type){case"cloudbeat/cis_aws":return Object(j.jsx)(P,ce()({},t,{input:e}));case"cloudbeat/cis_eks":return Object(j.jsx)(K,ce()({},t,{input:e}));case"cloudbeat/cis_gcp":return Object(j.jsx)(me,ce()({},t,{input:e}));default:return null}},Ee=({postureType:e})=>Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},e===x.D&&Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.configureKspmIntegrationDescription",defaultMessage:"Select the Kubernetes cluster type you want to monitor and then fill in the name and description to help identify this integration"}),e===x.r&&Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.configureCspmIntegrationDescription",defaultMessage:"Select the cloud service provider (CSP) you want to monitor and then fill in the name and description to help identify this integration"}),e===x.W&&Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiCallOut,{iconType:"iInCircle",color:"primary",title:Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.cnvm.additionalChargesCalloutTitle",defaultMessage:"Additional charges on cloud provider billing account."})},Object(j.jsx)(l.EuiText,{size:"s"},Object(j.jsx)("p",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.cnvm.additionalChargesCalloutDescription",defaultMessage:"Please note that using this service may result in additional charges on your next cloud provider billing statement due to increased usage."})))),Object(j.jsx)(l.EuiSpacer,{size:"m"}),Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.cnvm.configureIntegrationDescription",defaultMessage:"Select the cloud service provider (CSP) you want to monitor and then fill in the name and description to help identify this integration"}))),Ne=({input:e,disabled:t,setInput:s})=>{var a;const i=(a=e.policy_template,G.n[a].options.map((e=>({tooltip:e.tooltip,value:e.type,id:e.type,label:e.name,icon:e.icon,disabled:e.disabled,isBeta:e.isBeta})))).map((e=>({...e,disabled:e.disabled||t,label:e.label,icon:e.icon})));return Object(j.jsx)(M,{disabled:t,idSelected:e.type,options:i,onChange:e=>s(e),size:"m"})};var Oe=s(24),fe=s(20),Se=s(8);const Ae=["packagePolicyList"],he={kspm:x.l,cspm:x.g,vuln_mgmt:x.m},Te=()=>Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiTitle,{size:"s"},Object(j.jsx)("h4",null,Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.integrationSettingsTitle",defaultMessage:"Integration Settings"}))),Object(j.jsx)(l.EuiSpacer,null)),De="single-account",Ce="organization-account",ve="single-account-gcp",ze="organization-account-gcp",ke=e=>{var t,s;return null===(t=e.streams[0].vars)||void 0===t||null===(s=t["aws.account_type"])||void 0===s?void 0:s.value},we=({input:e,newPolicy:t,updatePolicy:s,packageInfo:n})=>{const c=!r()(n.version)||o()(n.version,"1.5.0-preview20")<0,d=Object(a.useMemo)((()=>(e=>[{id:Ce,label:p.i18n.translate("xpack.csp.fleetIntegration.awsAccountType.awsOrganizationLabel",{defaultMessage:"AWS Organization"}),disabled:e,tooltip:e?p.i18n.translate("xpack.csp.fleetIntegration.awsAccountType.awsOrganizationDisabledTooltip",{defaultMessage:"Supported from integration version 1.5.0 and above"}):void 0},{id:De,label:p.i18n.translate("xpack.csp.fleetIntegration.awsAccountType.singleAccountLabel",{defaultMessage:"Single Account"})}])(c)),[c]);return Object(a.useEffect)((()=>{ke(e)||s(ae(t,e.type,{"aws.account_type":{value:c?De:Ce,type:"text"}}))}),[e]),Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.awsAccountTypeDescriptionLabel",defaultMessage:"Select between single account or organization, and then fill in the name and description to help identify this integration."})),Object(j.jsx)(l.EuiSpacer,{size:"l"}),c&&Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiCallOut,{color:"warning"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.awsAccountType.awsOrganizationNotSupportedMessage",defaultMessage:"AWS Organization not supported in current integration version. Please upgrade to the latest version to enable AWS Organizations integration."})),Object(j.jsx)(l.EuiSpacer,{size:"l"})),Object(j.jsx)(M,{idSelected:ke(e)||"",options:d,onChange:a=>{s(ae(t,e.type,{"aws.account_type":{value:a,type:"text"}}))},size:"m"}),ke(e)===Ce&&Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.awsAccountType.awsOrganizationDescription",defaultMessage:"Connect Elastic to every AWS Account (current and future) in your environment by providing Elastic with read-only (configuration) access to your AWS organization."}))),ke(e)===De&&Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.awsAccountType.singleAccountDescription",defaultMessage:"Deploying to a single account is suitable for an initial POC. To ensure complete coverage, it is strongly recommended to deploy CSPM at the organization-level, which automatically connects all accounts (both current and future)."}))),Object(j.jsx)(l.EuiSpacer,{size:"l"}))},Re=({input:e,newPolicy:t,updatePolicy:s,packageInfo:a})=>Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.gcpAccountTypeDescriptionLabel",defaultMessage:"Select between single account or organization, and then fill in the name and description to help identify this integration."})),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(M,{idSelected:ve,options:[{id:ze,label:p.i18n.translate("xpack.csp.fleetIntegration.gcpAccountType.gcpOrganizationLabel",{defaultMessage:"GCP Organization"}),disabled:!0,tooltip:p.i18n.translate("xpack.csp.fleetIntegration.gcpAccountType.gcpOrganizationDisabledTooltip",{defaultMessage:"Coming Soon"})},{id:ve,label:p.i18n.translate("xpack.csp.fleetIntegration.gcpAccountType.gcpSingleAccountLabel",{defaultMessage:"Single Account"})}],onChange:a=>{s(ae(t,e.type,{gcp_account_type:{value:a,type:"text"}}))},size:"m"}),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(l.EuiText,{color:"subdued",size:"s"},Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.gcpAccountType.singleAccountDescription",defaultMessage:"Deploying to a single account is suitable for an initial POC. To ensure complete coverage, it is strongly recommended to deploy CSPM at the organization-level, which automatically connects all accounts (both current and future)."})),Object(j.jsx)(l.EuiSpacer,{size:"l"})),_e=({onChange:e,fields:t})=>Object(j.jsx)("div",null,t.map((({value:t,id:s,label:a,error:i})=>Object(j.jsx)(l.EuiFormRow,{key:s,id:s,fullWidth:!0,label:a,isInvalid:!!i,error:i},Object(j.jsx)(l.EuiFieldText,{isInvalid:!!i,fullWidth:!0,value:t,onChange:t=>e(s,t.target.value)}))))),Pe=Object(a.memo)((({newPolicy:e,onChange:t,validationResults:s,isEditPage:n,packageInfo:o})=>{const c=Object(d.useParams)().integration,r=x.R.includes(c)?c:void 0,[p,g]=Object(a.useState)(!0),M=Ge(e.inputs,r),I=Object(a.useCallback)((e=>t({isValid:p,updatedPolicy:e})),[t,p]),m=Object(a.useCallback)((t=>{const s=((e,t)=>{switch(e){case"cloudbeat/cis_aws":return{"aws.credentials.type":{value:v(t),type:"text"}};case"cloudbeat/cis_eks":return{"aws.credentials.type":{value:"assume_role",type:"text"}};default:return}})(t,o),a=ae(e,t,s);I(a)}),[e,I,o]),b=Object.keys((null==s?void 0:s.vars)||{}).filter((e=>null!==((null==s?void 0:s.vars)||{})[e])),[L,y]=Object(a.useState)(b.length>0),[E,N]=Object(a.useState)(!0);Object(a.useEffect)((()=>{b.length>0&&y(!0),setTimeout((()=>y(!1)),200)}),[b]);const{data:O,refetch:f}=((e,{enabled:t=!0})=>{const{http:s}=Object(Se.useKibana)().services;return Object(fe.useQuery)(Ae,(async()=>{try{return await s.get(Oe.packagePolicyRouteService.getListPath(),{query:{perPage:Oe.SO_SEARCH_LIMIT,page:1,kuery:`${Oe.PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name:${e}`}})}catch(e){throw new Error(`Failed to fetch package policy list: ${e.message}`)}}),{enabled:t,refetchOnMount:!1,refetchOnWindowFocus:!1})})(o.name,{enabled:E});if(Object(a.useEffect)((()=>{n||L||(m(he[M.policy_template]),f())}),[L,M.policy_template,n]),Fe({newPolicy:e,input:M,updatePolicy:I}),Ue({packageInfo:o,updatePolicy:I,newPolicy:e}),Ye({packagePolicyList:null==O?void 0:O.items,isEditPage:n,isLoading:L,integration:r,newPolicy:e,updatePolicy:I,setCanFetchIntegration:N}),L)return Object(j.jsx)(l.EuiFlexGroup,{justifyContent:"spaceAround"},Object(j.jsx)(l.EuiFlexItem,{grow:!1},Object(j.jsx)(l.EuiLoadingSpinner,{size:"xl"})));const S=[{id:"name",value:e.name,error:(null==s?void 0:s.name)||null,label:Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.integrationNameLabel",defaultMessage:"Name"})},{id:"description",value:e.description||"",error:(null==s?void 0:s.description)||null,label:Object(j.jsx)(u.FormattedMessage,{id:"xpack.csp.fleetIntegration.integrationDescriptionLabel",defaultMessage:"Description"})}];return Object(j.jsx)(i.a.Fragment,null,n&&Object(j.jsx)(Te,null),!r&&Object(j.jsx)(i.a.Fragment,null,Object(j.jsx)(Le,{selectedTemplate:M.policy_template,policy:e,setPolicyTemplate:e=>m(he[e]),disabled:n}),Object(j.jsx)(l.EuiSpacer,{size:"l"})),Object(j.jsx)(Ee,{postureType:M.policy_template}),Object(j.jsx)(l.EuiSpacer,{size:"l"}),Object(j.jsx)(Ne,{input:M,setInput:m,disabled:n}),Object(j.jsx)(l.EuiSpacer,{size:"l"}),"cloudbeat/cis_aws"===M.type&&Object(j.jsx)(we,{input:M,newPolicy:e,updatePolicy:I,packageInfo:o}),"cloudbeat/cis_gcp"===M.type&&Object(j.jsx)(Re,{input:M,newPolicy:e,updatePolicy:I,packageInfo:o}),Object(j.jsx)(_e,{fields:S,onChange:(t,s)=>I({...e,[t]:s})}),Object(j.jsx)(ye,{input:M,newPolicy:e,updatePolicy:I,packageInfo:o,onChange:t,setIsValid:g}),Object(j.jsx)(l.EuiSpacer,null))}));Pe.displayName="CspPolicyTemplateForm";const Fe=({newPolicy:e,input:t,updatePolicy:s})=>{Object(a.useEffect)((()=>{if(e.namespace===ee)return;const a={...ae(e,t.type),namespace:ee};s(a)}),[e,t,s])},Ye=({isEditPage:e,isLoading:t,integration:s,newPolicy:i,packagePolicyList:n,updatePolicy:o,setCanFetchIntegration:c})=>{Object(a.useEffect)((()=>{if(!s)return;if(e)return;if(t)return;const a=null==n?void 0:n.filter((e=>{var t,a;return(null==e||null===(t=e.vars)||void 0===t||null===(a=t.posture)||void 0===a?void 0:a.value)===s})),r=((e,t)=>{const s=new RegExp(`${e}-(\\d+)`);return`${e}-${Math.max(...(null!=t?t:[]).filter((e=>Boolean(e.name.match(s)))).map((e=>parseInt(e.name.match(s)[1],10))),0)+1}`})(s,a);i.name!==r&&(o({...i,name:r}),c(!1))}),[t,s,e,n])},Ge=(e,t=x.r)=>{const s=e.find((e=>e.enabled))||e.find((e=>e.policy_template===t))||e[0];var a;return Object(I.a)(s,"Failed to determine selected option"),Object(I.a)((a=s,x.R.includes(a.policy_template)&&x.Q.includes(a.type)),"Unknown option: "+s.type),s},Ue=({packageInfo:e,newPolicy:t,updatePolicy:s})=>{var i;Object(a.useEffect)((()=>{var a,i,n,o;const c=(e=>{if(!e.policy_templates)return"";const t=e.policy_templates.find((e=>e.name===x.W));if(!t)return"";const s=ie(t)&&t.inputs;return s?s.reduce(((e,t)=>{var s;if(!t.vars)return e;const a=null===(s=t.vars.find((e=>"cloud_formation_template"===e.name)))||void 0===s?void 0:s.default;return a?String(a):e}),""):""})(e);""!==c&&(null==t||null===(a=t.inputs)||void 0===a||null===(i=a.find((e=>e.type===x.m)))||void 0===i||null===(n=i.config)||void 0===n||null===(o=n.cloud_formation_template_url)||void 0===o?void 0:o.value)!==c&&(null==s||s({...t,inputs:t.inputs.map((e=>e.type===x.m?{...e,config:{cloud_formation_template_url:{value:c}}}:e))}))}),[null==t||null===(i=t.vars)||void 0===i?void 0:i.cloud_formation_template_url,t,e])}}])]);