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

Preflight clean_sync has no effect when no rules are sent. #1255

Closed
np5 opened this issue Dec 12, 2023 · 4 comments
Closed

Preflight clean_sync has no effect when no rules are sent. #1255

np5 opened this issue Dec 12, 2023 · 4 comments

Comments

@np5
Copy link
Contributor

np5 commented Dec 12, 2023

See:

if (!rules || rules.count < 1) {
[self fillError:error code:SNTRuleTableErrorEmptyRuleArray message:nil];
return NO;
}

I think I understand the logic behind this. If there is a bug in the sync server, we do not want to wipe all the rules. It is also easy to fix on the server by just adding a single rule. It might be just a documentation issue ?

@pmarkowsky
Copy link
Contributor

Correct if a sync server sends zero rules we simply return out of the function without deleting the rules in the database. If you look at the lines below that check you'll see that we start a database transaction. It's in that transaction that we delete the rules from the database.

Can you elaborate on what you're looking to do that would require sending zero rules?

As you pointed out if you wanted to achieve this you could send a ALLOWLIST rule for something like a platform binary in which case, you'd achieve the same effect.

In general sending zero rules could be especially troublesome in lockdown mode as the client would effectively only be able to run critical system binaries or any static rules it has.

@np5
Copy link
Contributor Author

np5 commented Dec 13, 2023

The only use-case is for the test devices that are always being re-enrolled. The risks clearly outweigh the benefits. This is why I suggested maybe just adding a warning in the docs.

@pmarkowsky
Copy link
Contributor

Agreed this needs to be better documented. But wanted to make sure we weren't precluding a specific use case.

@pmarkowsky
Copy link
Contributor

This is addressed via #1259. Marking as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants