Skip to content

Commit 8b02ceb

Browse files
committed
fix: removed the exposed NodesAuditEventsGet RPC handler that exposed eventually sensitive metadata
It is being removed for now but the handler code itself is being kept. It needs to be protected by some permission system, probably a claim with authority to get audit data for a private network. Updating network version since this breaks an existing RPC handler. However, nothing currently uses it.
1 parent 22c6a4c commit 8b02ceb

File tree

6 files changed

+4
-11
lines changed

6 files changed

+4
-11
lines changed

src/PolykeyAgent.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ class PolykeyAgent {
718718
port: optionsDefaulted.agentServicePort,
719719
ipv6Only: optionsDefaulted.ipv6Only,
720720
agentService: agentServerManifest({
721-
audit: this.audit,
722721
acl: this.acl,
723722
db: this.db,
724723
keyRing: this.keyRing,

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const config = {
3333
* It is only incremented on breaking changes
3434
* Use this to know if you must upgrade your service client
3535
*/
36-
networkVersion: 2,
36+
networkVersion: 3,
3737
/**
3838
* Default provider configuration
3939
* These are managed by Matrix AI and Polykey developers

src/nodes/agent/callers/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { ClientManifest } from '@matrixai/rpc';
22
import nodesAuthenticateConnection from './nodesAuthenticateConnection.js';
3-
import nodesAuditEventsGet from './nodesAuditEventsGet.js';
43
import nodesClaimsGet from './nodesClaimsGet.js';
54
import nodesClosestActiveConnectionsGet from './nodesClosestActiveConnectionsGet.js';
65
import nodesClosestLocalNodesGet from './nodesClosestLocalNodesGet.js';
@@ -40,7 +39,6 @@ type AgentClientManifestNodeManager = typeof manifestClientNodeManager &
4039
const manifestClient = {
4140
...manifestClientNodeConnectionManager,
4241
...manifestClientNodeManager,
43-
nodesAuditEventsGet,
4442
nodesClaimNetworkSign,
4543
nodesClaimNetworkVerify,
4644
notificationsSend,
@@ -57,7 +55,6 @@ export {
5755
manifestClientNodeConnectionManager,
5856
manifestClientNodeManager,
5957
nodesAuthenticateConnection,
60-
nodesAuditEventsGet,
6158
nodesClaimsGet,
6259
nodesClosestActiveConnectionsGet,
6360
nodesClosestLocalNodesGet,

src/nodes/agent/handlers/NodesAuditEventsGet.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import type { AuditEventId } from '../../../ids/index.js';
1313
import { ServerHandler } from '@matrixai/rpc';
1414
import * as auditUtils from '../../../audit/utils.js';
1515

16+
// This is currently not used until security is built into it. It will require some way to verify that the requesting
17+
// node should have access to the information. For that we need a claim that we can verify.
1618
/**
1719
* Gets audit events from a node
1820
*/

src/nodes/agent/handlers/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { DB } from '@matrixai/db';
22
import type Logger from '@matrixai/logger';
33
import type KeyRing from '../../../keys/KeyRing.js';
4-
import type Audit from '../../../audit/Audit.js';
54
import type Sigchain from '../../../sigchain/Sigchain.js';
65
import type ACL from '../../../acl/ACL.js';
76
import type NodeGraph from '../../../nodes/NodeGraph.js';
@@ -11,7 +10,6 @@ import type NotificationsManager from '../../../notifications/NotificationsManag
1110
import type VaultManager from '../../../vaults/VaultManager.js';
1211
import type { AgentClientManifest } from '../callers/index.js';
1312
import NodesAuthenticateConnection from './NodesAuthenticateConnection.js';
14-
import NodesAuditEventsGet from './NodesAuditEventsGet.js';
1513
import NodesClaimsGet from './NodesClaimsGet.js';
1614
import NodesClosestActiveConnectionsGet from './NodesClosestActiveConnectionsGet.js';
1715
import NodesClosestLocalNodesGet from './NodesClosestLocalNodesGet.js';
@@ -28,7 +26,6 @@ import VaultsScan from './VaultsScan.js';
2826
* Server manifest factory.
2927
*/
3028
const manifestServer = (container: {
31-
audit: Audit;
3229
db: DB;
3330
sigchain: Sigchain;
3431
nodeGraph: NodeGraph;
@@ -42,7 +39,6 @@ const manifestServer = (container: {
4239
}) => {
4340
return {
4441
nodesAuthenticateConnection: new NodesAuthenticateConnection(container),
45-
nodesAuditEventsGet: new NodesAuditEventsGet(container),
4642
nodesClaimsGet: new NodesClaimsGet(container),
4743
nodesClosestActiveConnectionsGet: new NodesClosestActiveConnectionsGet(
4844
container,
@@ -65,7 +61,6 @@ export default manifestServer;
6561

6662
export {
6763
NodesAuthenticateConnection,
68-
NodesAuditEventsGet,
6964
NodesClaimsGet,
7065
NodesClosestActiveConnectionsGet,
7166
NodesClosestLocalNodesGet,

tests/nodes/agent/handlers/nodesAuditsGet.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { RPCClient, RPCServer } from '@matrixai/rpc';
1414
import * as tlsTestsUtils from '../../../utils/tls.js';
1515
import * as testNodesUtils from '../../../nodes/utils.js';
1616
import NodesAuditEventsGet from '#nodes/agent/handlers/NodesAuditEventsGet.js';
17-
import { nodesAuditEventsGet } from '#nodes/agent/callers/index.js';
17+
import nodesAuditEventsGet from '#nodes/agent/callers/nodesAuditEventsGet.js';
1818
import * as nodesUtils from '#nodes/utils.js';
1919
import KeyRing from '#keys/KeyRing.js';
2020
import Audit from '#audit/Audit.js';

0 commit comments

Comments
 (0)