
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
@appsensorlike/appsensorlike_exec_mode_websocket_server
Advanced tools
AppSensorLike execution mode over websocket; server part
@appsensorlike/appsensorlike server exposed via websocket.
npm i @appsensorlike/appsensorlike_exec_mode_websocket_server
import { AppSensorWebsocketExecServer } from '@appsensorlike/appsensorlike_exec_mode_websocket_server';
const appSensorWebsocketServer =
new AppSensorWebsocketExecServer('appsensor-server-config.json',
'appsensor-websocket-request-handler-config.json');
await appSensorWebsocketServer.startWebSocketServer();
//check corresponding client module @appsensorlike/appsensorlike_exec_mode_websocket_client_node to see how events can be sent
Authentication of the clients is based on custom header field and its value, sent with the request. The field name is specified with clientApplicationIdentificationHeaderName of appsensor-server-config.json configuration file. The value of the field has to match one of ClientApplication.name enumerated under clientApplications of appsensor-server-config.json config file. If in the matched ClientApplication is present ipAddresses, this narrows down further the clients. These are allowed IPs only. The IPs can be specified in IPv4 or IPv6 format. For 127.0.0.1 in particular you can write "localhost" instead.
Authorization - after the client has successfully been authenticated, its authorizations are checked against the roles found in the matched ClientApplication during the authentication phase.
For example in appsensor-server-config.json:
...
"clientApplicationIdentificationHeaderName": "X-Appsensor-Client-Application-Name",
...
"clientApplications": [
{
"name": "myclientapp",
"roles": [
"ADD_EVENT",
"ADD_ATTACK",
"GET_RESPONSES",
"GET_EVENTS",
"GET_ATTACKS",
"EXECUTE_REPORT"
],
"ipAddresses": [{
"address": "localhost",
"geoLocation": null
}]
}]
...
You can configure AppSensorLike detection points, responses, etc. via appsensor-server-config.json in your working directory. You can copy a demonstration appsensor-server-config.json from @appsensorlike/appsensorlike/dist/configuration-modes/appsensor-configuration-json/server and modify it accordingly. Corresponding schem file appsensor-server-config_schema.json is in the same directory. The configuration is reloaded on change.
You can configure http/s server and websocket thru appsensor-websocket-request-handler-config.json file in your working directory. You can copy the default configuration from this module's dist/execution-modes/appsensor-websocket/server/handler. Corresponding schem file appsensor-websocket-server-config_schema.json is in the same directory. For more information of the configuration fields check class @appsensorlike/appsensorlike/dist/http/HttpS2ServerConfig. This implementation utilizes Node's http/s server so you could refer to Node's documentation about the options (e.g. https://nodejs.org/dist/v14.15.0/docs/api/http.html#http_http_createserver_options_requestlistener). By default the server listens on port 4500. The implementation also takes advantage of WS websocket module so you could check https://github.com/websockets/ws/blob/HEAD/doc/ws.md#new-websocketserveroptions-callback especially the fields exposed via this configuration.
You need TypeScript version >= 4.7 in order the paths exported by the module to be resolved.
FAQs
AppSensorLike execution mode over websocket; server part
We found that @appsensorlike/appsensorlike_exec_mode_websocket_server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.