-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[EDR Workflows] Option to sync antivirus registration with malware settings #180484
[EDR Workflows] Option to sync antivirus registration with malware settings #180484
Conversation
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
Pinging @elastic/fleet (Team:Fleet) |
… src/core/server/integration_tests/ci_checks'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fleet changes 🚀
@elasticmachine merge upstream |
… src/core/server/integration_tests/ci_checks'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested flow locally, everything propagates up to agent policy as expected.
I guess Endpoint doesn't mind this extra field in the config? :)
Great job 🚀 !
@@ -1000,6 +1000,7 @@ export interface PolicyConfig { | |||
}; | |||
}; | |||
antivirus_registration: { | |||
mode?: AntivirusRegistrationModes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is mode
truly optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is optional only for one release cycle, afterwards it will be required - this is for supporting serverless rollout, see this comment: #179176 (comment)
import type { PolicyConfig } from '../types'; | ||
import { ProtectionModes, AntivirusRegistrationModes } from '../types'; | ||
|
||
export const updateAntivirusRegistrationEnabledInPlace = (policy: PolicyConfig): PolicyConfig => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe drop InPlace
from the name? Spent way too much time trying to figure out what does it mean :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, also added JSOC 3d1bdba
), | ||
[AntivirusRegistrationModes.sync]: i18n.translate( | ||
'xpack.securitySolution.endpoint.policy.details.antivirusRegistration.syncWithMalwarePrevent', | ||
{ defaultMessage: 'Sync with Malware Prevent' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ defaultMessage: 'Sync with Malware Prevent' } | |
{ defaultMessage: 'Sync with Malware Protection level' } |
Either way, I believe we could use a popover of sorts to explain what will happen on Prevent
and Detect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, also added hint 3f23c6d
if (antivirusRegistrationMode) { | ||
// calculate only if `mode` exists | ||
policy.windows.antivirus_registration.enabled = | ||
modeToEnabled[antivirusRegistrationMode] ?? false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can modeToEnabled[antivirusRegistrationMode]
be undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, if there is an invalid value in antivirusRegistrationMode
. so it should not happen, but if it happens because of reasons, the safest is to keep antivirus registration disabled
@caitlinbetz @joepeeples @ferullo what do you think about the tooltip text? also, I've displayed the current outcome of antivirus registration, so the user can see immediately what setting the antivirus registration to sync with malware results in. should we go with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Left one question, but nothing that should hold this back. Thanks for all of the test coverage 🤩
'aria-checked', | ||
'false' | ||
); | ||
expect(renderResult.getByTestId(antivirusTestSubj.radioButtons)).toBeTruthy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change in this test case? it now just seem to be checking that its in the DOM and not really checking what state it is in (checked or unchecked)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point - I forgot to check it :)
fixed here 2b457bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for including me in the review, @gergoabraham! Left a couple suggested edits, just let me know if you need anything else.
...ment/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.tsx
Outdated
Show resolved
Hide resolved
...ment/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.tsx
Outdated
Show resolved
Hide resolved
...ment/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Joe Peeples <[email protected]>
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
…n.mode` from optional to required (#181986) ## Summary `antivirus_registration.mode` field was added to Endpoint integration policy config in this PR: #180484 It was optional to support roll-out, now it's changed to required as it has been released since. Co-authored-by: Kibana Machine <[email protected]>
Summary
Adds option to Defend integration's Antivirus Registration card to sync registration with Malware settings.
Details:
PolicyConfig
:antivirus_registration.mode
, which can beenabled
,disabled
orsync_with_malware_prevent
antivirus_registration.enabled
field is derived from this field, so it's compatible with older Endpoints, tooantivirus_registration.enabled
happens both on client side and on server side (in Fleet'spackagePolicyUpdate
ingest callback)disabled
, as in previous versionChecklist
Delete any items that are not applicable to this PR.