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

Standalone Mode (Beta) (1/3) #86

Merged
merged 23 commits into from
Dec 4, 2024

Conversation

pmarkowsky
Copy link
Contributor

@pmarkowsky pmarkowsky commented Oct 27, 2024

This PR creates a new Santa operating mode -- standalone

This adds a new operating mode to Santa called standalone mode.

When running in standalone mode TouchID can be used to approved binaries. If a
binary is properly signed a SigningID rule is generated otherwise a SHA256 rule
is generated.

When using a sync service standalone mode won't override explicit block rules, but will allow a user to approve anything blocked by default.

Video demo-ing standlone.

Standalone Santa Operation

Note

This lacks a GUI for browsing rules in the local rule db

This supersedes #5.

Also the sync protocol changes are saved for a future PR.

To Do

  • Rework this as a new mode.
  • rework this to use new states for rule creation -- SNTEventAllowLocalSHA256, SNTEventAllowLocalSigningID
  • rework this to emit two events (Future PR)
    • First event is the normal event that is uploaded immediately
    • Create a new event when a new rule is created that is only a subset of the old event data to indicate that the user has created that rule (Future PR)
    • Add a new clean sync type to target standalone rules (Future PR)
    • make sync_type repeatable in sync protocol. (Future PR)
    • make this only apply to unknown blocks.

@pmarkowsky pmarkowsky added this to the 2024.11 milestone Oct 27, 2024
@pmarkowsky pmarkowsky added comp/santad Issues or PRs related to the daemon comp/gui Issues or PRs related to the Santa GUI labels Oct 27, 2024
@pmarkowsky pmarkowsky force-pushed the plm/standalone-mode-swift branch 4 times, most recently from 4689294 to d2b045b Compare November 7, 2024 03:48
@pmarkowsky pmarkowsky marked this pull request as ready for review November 7, 2024 04:14
@pmarkowsky pmarkowsky requested a review from a team as a code owner November 7, 2024 04:14
Source/santad/SNTExecutionController.mm Outdated Show resolved Hide resolved
Source/santad/SNTExecutionController.mm Outdated Show resolved Hide resolved
Source/santad/SNTExecutionController.mm Outdated Show resolved Hide resolved
Source/santad/SNTExecutionController.mm Outdated Show resolved Hide resolved
Source/santad/SNTNotificationQueue.m Show resolved Hide resolved
Source/common/SNTConfigurator.m Outdated Show resolved Hide resolved
Source/gui/SNTBinaryMessageWindowController.m Outdated Show resolved Hide resolved
Source/gui/SNTBinaryMessageWindowView.swift Outdated Show resolved Hide resolved
@pmarkowsky pmarkowsky requested a review from mlw November 7, 2024 22:44
docs/deployment/configuration.md Outdated Show resolved Hide resolved
Source/santad/SNTNotificationQueue.m Outdated Show resolved Hide resolved
Source/santad/SNTExecutionController.mm Outdated Show resolved Hide resolved
Source/santad/SNTExecutionController.mm Outdated Show resolved Hide resolved
@pmarkowsky pmarkowsky force-pushed the plm/standalone-mode-swift branch 2 times, most recently from dae864c to ed1a6a8 Compare November 25, 2024 04:01
@pmarkowsky pmarkowsky requested a review from mlw November 25, 2024 13:53
@pmarkowsky pmarkowsky changed the title Standalone Mode (Beta) Standalone Mode (Beta) (1/3) Nov 25, 2024
This was referenced Nov 26, 2024
pmarkowsky added a commit to northpolesec/protos that referenced this pull request Nov 27, 2024
This PR does the following:
 -  Adds a standalone mode to the ClientMode enum.
 -  Adds a new event type to the EventUpload stage called an audit event

It is part of the Standalone Mode work for
northpolesec/santa#132 and is blocking
northpolesec/santa#86
@pmarkowsky pmarkowsky force-pushed the plm/standalone-mode-swift branch from 9737d34 to feaa11a Compare November 27, 2024 21:35
Copy link
Contributor

@russellhancox russellhancox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits

Source/common/SNTConfigurator.h Outdated Show resolved Hide resolved
Source/common/SNTCommonEnums.h Show resolved Hide resolved
Source/common/SNTConfigurator.m Outdated Show resolved Hide resolved
Source/common/SNTStoredEvent.m Outdated Show resolved Hide resolved
Source/common/SNTXPCNotifierInterface.h Outdated Show resolved Hide resolved
Source/gui/BUILD Outdated Show resolved Hide resolved
Source/santad/SNTPolicyProcessor.mm Outdated Show resolved Hide resolved
Source/gui/SNTMessageView.swift Outdated Show resolved Hide resolved
Source/gui/SNTBinaryMessageWindowController.m Outdated Show resolved Hide resolved
Source/common/SNTXPCNotifierInterface.h Outdated Show resolved Hide resolved
Source/gui/SNTBinaryMessageWindowView.swift Outdated Show resolved Hide resolved
Source/gui/SNTBinaryMessageWindowView.swift Outdated Show resolved Hide resolved
Source/gui/SNTMessageView.swift Outdated Show resolved Hide resolved
Source/gui/SNTNotificationManager.m Outdated Show resolved Hide resolved
Source/gui/SNTNotificationManagerTest.m Outdated Show resolved Hide resolved
Source/santad/SNTExecutionController.mm Outdated Show resolved Hide resolved
Source/santad/SNTNotificationQueue.h Outdated Show resolved Hide resolved
Source/santad/SNTNotificationQueue.m Outdated Show resolved Hide resolved
Source/santad/SNTNotificationQueue.m Outdated Show resolved Hide resolved
@pmarkowsky pmarkowsky force-pushed the plm/standalone-mode-swift branch from 5e31175 to 74d28af Compare December 2, 2024 21:57
Source/common/SNTRule.m Outdated Show resolved Hide resolved
Source/gui/SNTNotificationManager.m Show resolved Hide resolved
tmp-rules.json Outdated Show resolved Hide resolved
Copy link
Contributor

@russellhancox russellhancox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 4 changes go together to avoid blocking the main thread. I've tested them locally

Source/gui/SNTBinaryMessageWindowView.swift Outdated Show resolved Hide resolved
Source/gui/SNTBinaryMessageWindowView.swift Outdated Show resolved Hide resolved
Source/gui/SNTBinaryMessageWindowView.swift Outdated Show resolved Hide resolved
Source/gui/SNTMessageView.swift Outdated Show resolved Hide resolved
pmarkowsky and others added 23 commits December 4, 2024 15:00
When running in standalone mode TouchID can be used to approved binaries. If a
binary is properly signed a SigningID rule is generated otherwise a SHA256 rule
is generated. Note this lacks a GUI for browsing rules in the local rule db.

Also adds localizable strings for Approve button.
Address review feedback.

Make standalone mode only work for unknown blocks.
Co-authored-by: Russell Hancox <[email protected]>
Signed-off-by: Pete Markowsky <[email protected]>
Co-authored-by: Russell Hancox <[email protected]>
Signed-off-by: Pete Markowsky <[email protected]>
Co-authored-by: Russell Hancox <[email protected]>
Signed-off-by: Pete Markowsky <[email protected]>
Co-authored-by: Russell Hancox <[email protected]>
Signed-off-by: Pete Markowsky <[email protected]>
Co-authored-by: Russell Hancox <[email protected]>
Signed-off-by: Pete Markowsky <[email protected]>
@pmarkowsky pmarkowsky force-pushed the plm/standalone-mode-swift branch from aacdd0e to fd6b11b Compare December 4, 2024 20:00
@pmarkowsky pmarkowsky merged commit 7d73fd6 into northpolesec:main Dec 4, 2024
10 checks passed
@pmarkowsky pmarkowsky deleted the plm/standalone-mode-swift branch December 4, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp/gui Issues or PRs related to the Santa GUI comp/santad Issues or PRs related to the daemon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants