From 93ef3a59df009464e075517aa242fc072ed7bf0e Mon Sep 17 00:00:00 2001 From: Fransen Date: Sun, 26 Jan 2025 18:00:06 +0100 Subject: [PATCH] [SecurityAgent] Add html page as en example for testing the SecurityAgent --- examples/SecurityAgent/readme.md | 24 ++ examples/SecurityAgent/testhtml - Secure.html | 214 ++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 examples/SecurityAgent/readme.md create mode 100644 examples/SecurityAgent/testhtml - Secure.html diff --git a/examples/SecurityAgent/readme.md b/examples/SecurityAgent/readme.md new file mode 100644 index 000000000..25b6c43bc --- /dev/null +++ b/examples/SecurityAgent/readme.md @@ -0,0 +1,24 @@ +# Thunder Web Security Test + +The html page in this folder can be used to test the Thunder Web Security with the SecurityAgent plugin as found in ThunderNanoServicesRDK: + +- build the SecurityAgent plugin with SECURITY_TESTING_MODE enabled +- add a value for the testtoken in the SecurityAgent plugin config (and for windows make sure to add a valid ip:port to the token provider key) + example: +```json + { + "callsign": "SecurityAgent", + "locator": "libSecurityAgent.so", + "classname": "SecurityAgent", + "startmode": "Activated", + "configuration": { + "connector": "127.0.0.1:25556", + "testtoken" : "" + } + } + ``` +- start Thunder and activate the SecurityAgent plugin (if not set to automatic) +- Open the html page, fill in Thunder web ip and port, for the testtoken fill the value that was added for testtoken in the config (so in the example above that would be ) +- fill in the url and/or user you would like to have in the token payload (of course make sure it aligns with the content of the security agent acl file depending on what you want to test) Note: you can of course create just a new token after changing the url or user by clicking the Create Token button again. +- click the Create Token button and a token should appear in the "token to be used" edit box +- if you want this token to be used for the websocket tests and/or XHR request just enable the "Use Token for requests" checkbox. diff --git a/examples/SecurityAgent/testhtml - Secure.html b/examples/SecurityAgent/testhtml - Secure.html new file mode 100644 index 000000000..8ff391ed4 --- /dev/null +++ b/examples/SecurityAgent/testhtml - Secure.html @@ -0,0 +1,214 @@ + + +

Webbridge

+
IP:PORT
+ +: + +
+
+

Security Token

+
test token
+ +
token data
+url user + +
token to be used
+ +Use token for requests: + +

WebSocket

+ +
+
path
+ + + +
send message
+ + + +
Spam message
+ + + + +

Send XHR request

+
Method
+ +
path
+ + +
data
+send body data + + +
+ +

Results

+
+
    +
+
+ + + \ No newline at end of file