-
Notifications
You must be signed in to change notification settings - Fork 2
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
Whole domain authorisation #85
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes for NodeJS 16+ (Flowable test & Future)
Subject property casting convenience function Get-with-property shorthand state method Wiring extensions into engine as single manager object Module refactoring to remove circular dependencies Deps update
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/m-ld/m-ld-js/7f5KSQcdJZpTVXqN3Z3TmVqRN7Ss |
Various fallout: fixing clone & remotes close() bugs that were hidden by process death
5 tasks
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Whole domain authorisation
This feature has been developed as a partial implementation of the Symmetric Unilateral Access Control (SUAC) specification.
A m-ld Access Control List (m-ld ACL) extension has been created, for a new "transport security" extension point. If installed for a clone, the extension controls access to the domain based on security principals (users) registered in the domain data. (This goes beyond the original milestone description which only required hard-coded metadata; see italicised, above). The available control is "whole domain" read/write access permission.
Specification
The m-ld ACL extension implements the following features of the SUAC protocol.
These features are sufficient to prevent unregistered users from:
Module Structure
The feature has been included in the main engine project primarily as an optional extension module,
src/security/MeldAccessControlList.ts
. This is consistent with other optional modules such as Remotes and Constraints. It would be possible to separate the extension to another project if required.The extension uses a new extension point which has been wired into the existing clone bootstrapping code, accommodated by various refactorings. In particular:
MeldExtensions
(insrc/api.ts
), which includes the pre-existing constraints extension point and the newMeldTransportSecurity
extension point.AppPrincipal
and bootstrap extensions are provided as part of theMeldApp
object which is given to the main m-ld entry point method,clone
(insrc/index.ts
).Note that one technical hurdle required for this feature was making a consistent immutable domain state available to the new transport security extension point, which is applied from the remotes implementation. This required refactoring of the remotes base class in
src/engine/remotes/PubsubRemotes.ts
.Verification
Besides various test refactorings required for the changes to the core project, verification of the new extension point feature is based on:
test/AccessControlList.test.ts
. This uses a bare-bones dataset to animate the ACL extension class, to check that it encrypts operations and signs requests as required. Unit tests are currently run as part of the vercel build.compliance/test/1-acl.spec.js
. This uses a full clone, deployed with LevelDB persistence, MQTT remotes and a REST endpoint for animation, as per other compliance tests. Since this security feature is not yet part of the m-ld specification, its compliance test is found in this project rather than them-ld-spec
project. Compliance tests are now run using CircleCI; see the results for this branch.Next Steps
The next part of the project involves extending this prototype to implement SUAC agreements. These are necessary for robust registration of users and the domain secret. They will also support changing the transport security extension during the lifetime of the domain, by also including the extension registration in the domain data (unlike here, where it is set during clone initialisation). And of course, they will also support fine-grained write access controls as described in the SUAC specification.
Further Information
The source code is well-documented with comments. In particular, the compliance test specification in
compliance/test/1-acl.spec.js
comprises a readable walk-through.