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

feat: BETA: policy service using atServer as backing store; admin API and UI #1314

Closed
wants to merge 47 commits into from

Conversation

gkc
Copy link
Contributor

@gkc gkc commented Sep 5, 2024

- What I did

  • new BETA policy binary, npp_atserver: fetches its rules from atServer as persistent store
  • new BETA binary, np_admin: exposes an API via http for setting policy rules & seeing policy info, events etc
  • new BETA webapp bundled with np_admin to provide a simple illustrative UI

Note that this is still only alpha quality but the intention is that will be beta quality in our 5.7.0 release

- How I did it
See commits

- How to verify it

  • Tests pass
  • multibuild and dockerfile.package work as intended

TODO in subsequent PRs

  • take up an at_client.AtRpc enhancement
  • add concrete types for events, logs etc rather than json/map nonsense
  • add permitOpen to the NPAAuthCheckRequest so we can have policy be able to know if a request should be denied when no matching permitOpen found
  • refactor: rename all the NPA/npa classes/files/directories to NPP/npp
  • UI refactoring - split into pieces, reduce duplicate code
  • UI<->API enhancements re events, logs etc
  • Documentation
  • Postgres impl

gkc added 30 commits July 18, 2024 13:33
…e supplies a permitOpen list

- made daemonAtsigns injectable via npa bootstrapper
- added permitOpen to NPAAuthCheckResponse
- renamed `SshnpdImpl.isFromAuthorizedAtsign` to `authCheck` and have it return an NPAAuthCheckResponse
- use the NPAAuthCheckResponse to further check authorization for npt requests. After the SshnpdImpl checks its own permitOpen list, it will now also check the permitOpen list returned by the npa policy service. This enables nice single-jump-box configurations where the jump-box daemon could have permitOpen "*:*" but individual client atSigns may be restricted to "my_host:3389" or "*:22" or whatever is appropriate
- added policy binary to the buildArchive and buildBinaries scripts, and to the multibuild.yaml workflow definition
fix: fixed a couple of small bugs uncovered during first road-test
…cy-service

# Conflicts:
#	packages/dart/sshnoports/pubspec.lock
- universal.sh
- shell/install.sh
- shell/headless/sshnpd.sh
- shell/launchd/com.atsign.sshnpd.plist
- shell/systemd/sshnpd.service
… this is just the same atSign as the policy service itself) with details of every request received and the decision that was made
gkc and others added 15 commits September 4, 2024 13:39
Had to change docker context from a nested folder to the root of the
repo.
- rename admin_api/bin/admin_api.dart to np_admin.dart (standardize on np prefix for our binaries)
- rename sshnoports/bin/npa_file.dart to npp_file.dart (npp for NoPortsPolicy)
- rename sshnoports/bin/npp.dart to npp_atserver.dart
- update multibuild.yaml
  - reflect the renames from above
  - put the np_admin and npp_atserver binaries into sshnp/beta, and the admin webapp files into sshnp/beta/web
  - add npp_file, npp_atserver and np_admin to the list of binaries for MacOS code signing
- update Dockerfile.package
  - reflect the renames from above
  - put the np_admin and npp_atserver binaries into sshnp/beta, and the admin webapp files into sshnp/beta/web
@@ -85,8 +91,21 @@ jobs:
dart compile exe bin/activate_cli.dart -v -o sshnp/at_activate${{ matrix.ext }}
dart compile exe bin/sshnp.dart -v -o sshnp/sshnp${{ matrix.ext }}
dart compile exe bin/npt.dart -v -o sshnp/npt${{ matrix.ext }}
dart compile exe bin/npp_file.dart -v -o sshnp/npa_file${{ matrix.ext }}
dart compile exe bin/npp_file.dart -v -o sshnp/npp_file${{ matrix.ext }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

standardizing on npp_ prefix for all policy binaries; given we had npa_file out there already, preserving it for now

@gkc gkc marked this pull request as ready for review September 5, 2024 11:44
@gkc gkc requested a review from XavierChanth September 5, 2024 11:45
…tibuild

build(deps): Update dependabot for new Dockerfile location
dart compile exe bin/sshnp.dart -v -o /sshnp/sshnp; \
dart compile exe bin/npt.dart -v -o /sshnp/npt; \
dart compile exe bin/npp_file.dart -v -o /sshnp/npp_file; \
ln -s sshnp/npp_file sshnp/npa_file; \
Copy link
Member

@XavierChanth XavierChanth Sep 5, 2024

Choose a reason for hiding this comment

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

Multibuild did not like this:
https://github.com/atsign-foundation/noports/actions/runs/10721898228/job/29731556532

I think it is okay to make breaking changes in the alpha release and just remove npa_file and leave in npp_file

Copy link
Member

Choose a reason for hiding this comment

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

I see why, needs to be absolute path, but I still don't think a symbolic link in the release is a good idea

@gkc gkc closed this Sep 5, 2024
@gkc gkc deleted the feat/file-based-policy-service branch September 5, 2024 14:31
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

Successfully merging this pull request may close these issues.

3 participants