diff --git a/backend/go-app/main.go b/backend/go-app/main.go index c1256808..63f20748 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -27,6 +27,9 @@ import ( "os/exec" "path/filepath" + // import httptest + "net/http/httptest" + //"regexp" "strings" "time" @@ -4025,7 +4028,7 @@ func runInitEs(ctx context.Context) { jobret, err := newscheduler.Every(int(interval)).Seconds().NotImmediately().Run(job) if err != nil { - log.Printf("[CRITICAL] Failed to schedule org: %s", err) + log.Printf("[ERROR] Failed to schedule org: %s", err) } else { log.Printf("[INFO] Started sync on interval %d for org %s (%s)", interval, org.Name, org.Id) scheduledOrgs[org.Id] = jobret @@ -4234,6 +4237,32 @@ func runInitEs(ctx context.Context) { log.Printf("[INFO] Skipping download of extra API samples as %d were found", len(workflowapps)) } + + if os.Getenv("SHUFFLE_HEALTHCHECK_DISABLED") != "true" { + healthcheckInterval := 15 + log.Printf("[INFO] Starting healthcheck job every %d minute. Stats available on /api/v1/health/stats. Disable with SHUFFLE_HEALTHCHECK_DISABLED=true", healthcheckInterval) + job := func() { + // Prepare a fake http.responsewriter + resp := httptest.NewRecorder() + + request := http.Request{} + // Add the "force=true" query to the fake request + request.URL, err = url.Parse("/api/v1/health/stats?force=true") + if err != nil { + log.Printf("[ERROR] Failed to parse test url for healthstats: %s", err) + } + + shuffle.RunOpsHealthCheck(resp, &request) + } + + _, err := newscheduler.Every(int(healthcheckInterval)).Minutes().Run(job) + if err != nil { + log.Printf("[ERROR] Failed to schedule healthcheck: %s", err) + } else { + log.Printf("[DEBUG] Successfully started healthcheck interval of %d minutes", healthcheckInterval) + } + } + log.Printf("[INFO] Finished INIT (ES)") } @@ -4731,9 +4760,9 @@ func runInit(ctx context.Context) { jobret, err := newscheduler.Every(int(interval)).Seconds().NotImmediately().Run(job) if err != nil { - log.Printf("[CRITICAL] Failed to schedule org: %s", err) + log.Printf("[ERROR] Failed to schedule org: %s", err) } else { - log.Printf("Started sync on interval %d for org %s", interval, org.Name) + log.Printf("[INFO] Started sync on interval %d for org %s", interval, org.Name) scheduledOrgs[org.Id] = jobret } } @@ -5281,7 +5310,7 @@ func handleCloudSetup(resp http.ResponseWriter, request *http.Request) { jobret, err := newscheduler.Every(int(interval)).Seconds().NotImmediately().Run(job) if err != nil { - log.Printf("[CRITICAL] Failed to schedule org: %s", err) + log.Printf("[ERROR] Failed to schedule org: %s", err) } else { log.Printf("[INFO] Started sync on interval %d for org %s", interval, org.Name) scheduledOrgs[org.Id] = jobret diff --git a/frontend/src/components/AppSelection.jsx b/frontend/src/components/AppSelection.jsx index bea2cc54..5ead4f9a 100644 --- a/frontend/src/components/AppSelection.jsx +++ b/frontend/src/components/AppSelection.jsx @@ -48,12 +48,20 @@ const AppSelection = props => { const [selectionOpen, setSelectionOpen] = React.useState(false) const [newSelectedApp, setNewSelectedApp] = React.useState({}) const [finishedApps, setFinishedApps] = React.useState([]) + const [appName, setAppName] = React.useState(); const [moreButton, setMoreButton] = useState(false); - const [mouseHoverIndex, setMouseHoverIndex] = useState(-1) + + // const [mouseHoverIndex, setMouseHoverIndex] = useState(-1) const ref = useRef() let navigate = useNavigate(); const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io"; + const mouseOver = (e) => { + e.target.style.border = "1px solid #f85a3e"; + } + const mouseOut = (e) => { + e.target.style.border = "1px solid rgb(33, 33, 33)"; + } const setFrameworkItem = (data) => { console.log("Setting framework item: ", data, isCloud) // if (!isCloud) { @@ -89,7 +97,6 @@ const AppSelection = props => { } } - //setFrameworkLoaded(true) //setFrameworkData(responseJson) }) @@ -118,7 +125,6 @@ const AppSelection = props => { setDiscoveryData(label) setSelectionOpen(true) setNewSelectedApp({}) - setDefaultSearch(label.charAt(0).toUpperCase() + (label.substring(1)).toLowerCase()) }; @@ -140,13 +146,13 @@ const AppSelection = props => { appFramework.siem = submitNewApp } else if (discoveryData === "ERADICATION") { - appFramework.eradication = submitNewApp + appFramework.edr = submitNewApp } else if (discoveryData === "INTEL") { appFramework.intel = submitNewApp } else if (discoveryData === "EMAIL") { - appFramework.email = submitNewApp + appFramework.communication = submitNewApp } else if (discoveryData === "NETWORK") { appFramework.network = submitNewApp @@ -158,27 +164,27 @@ const AppSelection = props => { appFramework.iam = submitNewApp } setFrameworkItem(submitNewApp); - setSelectionOpen(false); console.log("Selected app changed (effect)"); - }, [newSelectedApp]); - const sizing = 510; - const buttonWidth = 450; - const buttonMargin = 10; + const sizing = moreButton ? 510 : 480; + const buttonWidth = 450; + const buttonMargin = 10; const bottomButtonStyle = { borderRadius: 200, marginTop: moreButton ? 44 : "", height: 51, - width: 464, + width: 510, fontSize: 16, // background: "linear-gradient(89.83deg, #FF8444 0.13%, #F2643B 99.84%)", background: "linear-gradient(90deg, #F86744 0%, #F34475 100%)", padding: "16px 24px", // top: 20, // margin: "auto", + textTransform: 'capitalize', itemAlign: "center", + // marginTop: 25 // marginLeft: "65px", }; const buttonStyle = { @@ -191,18 +197,18 @@ const AppSelection = props => { fontSize: 17, background: "rgba(33, 33, 33, 1)", textTransform: 'capitalize', - border: mouseHoverIndex ? "1px solid rgba(33, 33, 33, 1)" : "1px solid #f85a3e", + border: "1px solid rgba(33, 33, 33, 1)", borderRadius: 8, marginRight: 8, }; - + // console.log("appFramework",appFramework.cases.name) return (
@@ -223,8 +229,8 @@ const AppSelection = props => { }} >
-
- {discoveryData} +
+ {discoveryData}
{ setFrameworkItem(submitDeletedApp) setNewSelectedApp({}) }, 1000) + //setAppName(discoveryData.cases.name) }} > @@ -319,14 +326,9 @@ const AppSelection = props => { Select the apps you work with and we will connect the for you. + {/*Find your integrations!*/} -
{ - setMouseHoverIndex() - }} onMouseOut={() => { - setMouseHoverIndex(-1) - }} - > +
-
+
-
+
{moreButton ? ( -
{ - setMouseHoverIndex() - }} onMouseOut={() => { - setMouseHoverIndex(-1) - }} - > +
) : -
+
} - - {/* - What do you want to automate first ? - - { onNodeSelect("Email") }} />} - label="Email" - labelPlacement="Email" - /> - { onNodeSelect("SIEM") }} />} - label="SIEM" - labelPlacement="SIEM" - /> - { onNodeSelect("EDR") }} />} - label="EDR" - labelPlacement="EDR" - /> - - */}
diff --git a/frontend/src/components/Appsearch.jsx b/frontend/src/components/Appsearch.jsx index 87851541..1879d0ef 100644 --- a/frontend/src/components/Appsearch.jsx +++ b/frontend/src/components/Appsearch.jsx @@ -54,14 +54,14 @@ const Appsearch = props => {
@@ -71,7 +71,8 @@ const Appsearch = props => { type="search" color="primary" defaultValue={defaultSearch} - placeholder={`Find ${defaultSearch} Apps...`} + // placeholder={`Find ${defaultSearch} Apps...`} + placeholder= {defaultSearch ? `${defaultSearch}` : "Search Cases "} id="shuffle_workflow_search_field" onChange={(event) => { refine(event.currentTarget.value) @@ -92,9 +93,9 @@ const Appsearch = props => { {hits.map((data, index) => { const paperStyle = { - backgroundColor: index === mouseHoverIndex ? "rgba(255,255,255,0.8)" : theme.palette.inputColor, + backgroundColor: index === mouseHoverIndex ? "rgba(255,255,255,0.8)" : "#2F2F2F", color: index === mouseHoverIndex ? theme.palette.inputColor : "rgba(255,255,255,0.8)", - border: newSelectedApp.objectID !== data.objectID ? `1px solid rgba(255,255,255,0.2)` : "2px solid #f86a3e", + // border: newSelectedApp.objectID !== data.objectID ? `1px solid rgba(255,255,255,0.2)` : "2px solid #f86a3e", textAlign: "left", padding: 10, cursor: "pointer", @@ -183,7 +184,7 @@ const Appsearch = props => { } }}>
- {data.name} + {data.name} {parsedname} diff --git a/frontend/src/components/ExploreWorkflow.jsx b/frontend/src/components/ExploreWorkflow.jsx index fc3c2d32..95b464e7 100644 --- a/frontend/src/components/ExploreWorkflow.jsx +++ b/frontend/src/components/ExploreWorkflow.jsx @@ -295,7 +295,7 @@ const ExploreWorkflow = (props) => { Start using workflows - Based on what you selected here’s our recommendations! + Based on what you selected workflows, here are our recommendations! You will see more of these later.
diff --git a/frontend/src/components/Priority.jsx b/frontend/src/components/Priority.jsx index c81086e8..3f167982 100644 --- a/frontend/src/components/Priority.jsx +++ b/frontend/src/components/Priority.jsx @@ -112,7 +112,7 @@ const Priority = (props) => { {priority.type === "usecase" && priority.description.includes("&") ? - {priority.name} + {priority.name} {newdescription.split("&")[0]} @@ -120,7 +120,7 @@ const Priority = (props) => { {newdescription.split("&").length > 3 ? - {priority.name+"2"} + {priority.name+"2"} {newdescription.split("&")[2]} diff --git a/frontend/src/components/WelcomeForm2.jsx b/frontend/src/components/WelcomeForm2.jsx index b2f40193..f0b71273 100644 --- a/frontend/src/components/WelcomeForm2.jsx +++ b/frontend/src/components/WelcomeForm2.jsx @@ -200,20 +200,10 @@ const WelcomeForm = (props) => { }, [discoveryWrapper]); useEffect(() => { - if ( - window.location.search !== undefined && - window.location.search !== null - ) { + if (window.location.search !== undefined && window.location.search !== null) { + const urlSearchParams = new URLSearchParams(window.location.search); const params = Object.fromEntries(urlSearchParams.entries()); - const foundTab = params["tab"]; - if (foundTab !== null && foundTab !== undefined && !isNaN(foundTab)) { - if (foundTab === 3 || foundTab === "3") { - //console.log("Set search!") - } - } else { - //navigate(`/welcome?tab=1`) - } const foundTemplate = params["workflow_template"]; if (foundTemplate !== null && foundTemplate !== undefined) { @@ -730,77 +720,6 @@ const WelcomeForm = (props) => { ) : (
{getStepContent(activeStep)} - {/*
- {activeStep === 2 || activeStep === 1 ? -
- - -
- : -
- - // (commented) isStepOptional(activeStep) && ( - - ) //commented - - {activeStep === 0 ? - - : null} -
- }*/}
)}
diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 1dd3eb87..55051fe7 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -13321,7 +13321,7 @@ const AngularWorkflow = (defaultprops) => { - {workflow.errors.slice(0,4).map((error) => { + {workflow.errors.slice(0,3).map((error) => { return (
- {error} diff --git a/frontend/src/views/Welcome.jsx b/frontend/src/views/Welcome.jsx index 7683f826..97fed9f4 100644 --- a/frontend/src/views/Welcome.jsx +++ b/frontend/src/views/Welcome.jsx @@ -42,7 +42,6 @@ const Welcome = (props) => { let navigate = useNavigate(); useEffect(() => { - console.log("IN USEEFFECT FOR ACTIVESTEP: ", activeStep, " and with login: ", checkLogin) if (checkLogin !== undefined) { checkLogin() } @@ -280,7 +279,7 @@ const Welcome = (props) => { const urlSearchParams = new URLSearchParams(window.location.search); const params = Object.fromEntries(urlSearchParams.entries()); const foundTab = params["tab"]; - if (foundTab !== null && foundTab !== undefined && !isNaN(foundTab)) { + if (foundTab !== null && foundTab !== undefined && !isNaN(foundTab) && foundTab >= 1 && foundTab <= 3) { setShowWelcome(true) if (foundTab === 3 || foundTab === "3") { handleSetSearch(usecaseButtons[0].name, usecaseButtons[0].usecase) @@ -288,8 +287,7 @@ const Welcome = (props) => { setActiveStep(foundTab-1) } else { - //navigate(`/welcome?tab=1`) - navigate(`/welcome?tab=2`) + navigate(`/welcome?tab=2`) } } }, []) @@ -528,6 +526,8 @@ const Welcome = (props) => {