Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huntress RogueApps and Bugfixes #2827

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/tables/CellTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ export default function cellTable(
if (columnProp === undefined || columnProp === null) {
columnProp = []
} else {
var objectLength = 1
var lengthText = 'Item'
if (columnProp instanceof Array) {
objectLength = columnProp.length
if (objectLength > 1) {
lengthText = 'Items'
}
}

if (!Array.isArray(columnProp) && typeof columnProp === 'object') {
columnProp = Object.keys(columnProp).map((key) => {
return {
Expand Down Expand Up @@ -93,7 +102,7 @@ export default function cellTable(
size="sm"
onClick={() => handleTable({ columnProp })}
>
{columnProp.length} Items
{objectLength} {lengthText}
</CButton>
)
}
Expand Down
6 changes: 6 additions & 0 deletions src/data/alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,11 @@
"name": "DeviceCompliance",
"label": "Alert on device compliance issues",
"recommendedRunInterval": "4h"
},
{
"name": "HuntressRogueApps",
"label": "Alert on Huntress Rogue Apps detected",
"recommendedRunInterval": "4h",
"description": "Huntress has provided a repository of known rogue apps that are commonly used in BEC, data exfiltration and other Microsoft 365 attacks. This alert will notify you if any of these apps are detected in the selected tenant(s). For more information, see <a href='https://huntresslabs.github.io/rogueapps/' target='_blank'>https://huntresslabs.github.io/rogueapps/</a>."
}
]
24 changes: 24 additions & 0 deletions src/views/tenant/administration/AlertWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import auditLogTemplates from 'src/data/AuditLogTemplates.json'
import Skeleton from 'react-loading-skeleton'
import { required } from 'src/validators'
import HtmlParser from 'react-html-parser'

const AlertWizard = () => {
const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName)
Expand Down Expand Up @@ -112,6 +113,18 @@
}
}

const getScriptDescription = () => {
const values = currentFormState?.values
if (values) {
const command = values.command?.value
if (command?.description) {
return HtmlParser(command.description)
} else {
return null
}
}
}

const setAuditForm = (e) => {
const preset = presetValues.find((p) => p.value === e.value)
setAuditFormState(preset.template)
Expand Down Expand Up @@ -221,7 +234,7 @@
{(props) => {
return (
<RFFSelectSearch
values={getAuditLogSchema(props.values?.logbook?.value)}

Check warning on line 237 in src/views/tenant/administration/AlertWizard.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'values' is missing in props validation

Check warning on line 237 in src/views/tenant/administration/AlertWizard.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'values.logbook' is missing in props validation

Check warning on line 237 in src/views/tenant/administration/AlertWizard.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'values.logbook.value' is missing in props validation
name={`conditions.${i}.Property`}
placeholder={'Select a property to alert on'}
label="When property"
Expand Down Expand Up @@ -255,7 +268,7 @@
{(props) => {
return (
<>
{props.values?.conditions?.[i]?.Property?.value ===

Check warning on line 271 in src/views/tenant/administration/AlertWizard.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'values' is missing in props validation

Check warning on line 271 in src/views/tenant/administration/AlertWizard.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'values.conditions' is missing in props validation

Check warning on line 271 in src/views/tenant/administration/AlertWizard.jsx

View workflow job for this annotation

GitHub Actions / NPM Install and Build (16.x, ubuntu-latest)

'values.conditions[].Property' is missing in props validation
'String' && (
<RFFCFormInput
name={`conditions.${i}.Input.value`}
Expand Down Expand Up @@ -368,6 +381,16 @@
render={({ handleSubmit, submitting, values }) => {
return (
<CForm id="alertForm" onSubmit={handleSubmit}>
{getScriptDescription() && (
<CRow className="mb-3">
<CCol>
<CCallout color="info">
<FontAwesomeIcon icon="info-circle" className="me-2" />
{getScriptDescription()}
</CCallout>
</CCol>
</CRow>
)}
<CRow className="mb-3">
<CCol>
<RFFSelectSearch
Expand All @@ -382,6 +405,7 @@
/>
</CCol>
</CRow>

<Condition when="command.value.requiresInput" is={true}>
<CRow className="mb-3">
<CCol>
Expand Down
Loading