Skip to content

Commit 1a18f61

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
docs: Update documents with rest-csp option
Changelog-Added: New configurable Content-Security-Policy (CSP) header for clnrest
1 parent 3108ff9 commit 1a18f61

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/developers-guide/app-development/rest.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ If `rest-port` is not specified, the plugin will disable itself.
4545
- --rest-port: Sets the REST server port to listen to (3010 is common)
4646
- --rest-protocol: Specifies the REST server protocol. Default is HTTPS.
4747
- --rest-host: Defines the REST server host. Default is 127.0.0.1.
48-
- --rest-certs: Defines the path for HTTPS cert & key. Default path is same as RPC file path to utilize gRPC's client certificate. If it is missing at the configured location, new identity (`client.pem` and `client-key.pem`) will be generated.
48+
- --rest-certs: Defines the path for HTTPS cert & key. Default path is same as RPC file path to utilize gRPC's client certificate. If it is missing at the configured location, new identity will be generated.
49+
- --rest-csp: Creates a whitelist of trusted content sources that can run on a webpage and helps mitigate the risk of attacks.
50+
Default CSP is set as `default-src 'self'; font-src 'self'; img-src 'self' data:; frame-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline';`.
51+
Example CSP: `rest-csp=default-src 'self'; font-src 'self'; img-src 'self'; frame-src 'self'; style-src 'self'; script-src 'self';`.
4952
- --rest-cors-origins: Define multiple origins which are allowed to share resources on web pages to a domain different from the one that served the web page. Default is `*` which allows all origins. Example to define multiple origins:
5053

5154
```

doc/lightningd-config.5.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ authenticate to the Tor control port.
642642

643643
Define multiple origins which are allowed to share resources on web pages to a domain different from the one that served the web page. Default is `*` which allows all origins.
644644

645+
* **rest-csp**=*CSPOLICY* [plugin `clnrest.py`]
646+
647+
Creates a whitelist of trusted content sources that can run on a webpage and helps mitigate the risk of attacks. Default CSP is `default-src 'self'; font-src 'self'; img-src 'self' data:; frame-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline';`.
645648

646649
### Lightning Plugins
647650

0 commit comments

Comments
 (0)