@redsocs/spam-warden 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -17
- package/dist/spamwarden.js +296 -67
- package/dist/spamwarden.min.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -109,7 +109,19 @@ Explicit opt-in protection. No data leaves the browser. Simply include the scrip
|
|
|
109
109
|
|
|
110
110
|
Report blocked payloads to a central SOC, SIEM, or custom logging server. Use the `siems` attribute to define your receiving endpoint(s). You can provide a single URL or a comma-separated list of multiple URLs to broadcast the telemetry to several destinations simultaneously.
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
#### Data Protection & Privacy (DLP / SD Flag)
|
|
113
|
+
|
|
114
|
+
When telemetry is sent to a central SIEM, you might inadvertently transmit Personally Identifiable Information (PII) if the user typed it into the field.
|
|
115
|
+
|
|
116
|
+
To ensure compliance with PDPA/GDPR, enable the **Sanitize Data (SD)** flag by adding `data-sd="1"` to the script tag, or setting `reportSD: true` in the programmatic config.
|
|
117
|
+
|
|
118
|
+
When activated, SpamWarden's built-in DLP engine intercepts the payload _before_ it leaves the browser and aggressively masks:
|
|
119
|
+
|
|
120
|
+
- **Credit Cards:** Replaces 16-digit patterns with `[CARD_MASKED]`
|
|
121
|
+
- **Emails:** Replaces standard email formats with `[EMAIL_MASKED]`
|
|
122
|
+
- **Phone Numbers:** Replaces standard Thai/International formats with `[PHONE_MASKED]`
|
|
123
|
+
|
|
124
|
+
This guarantees that PII is scrubbed from the threat intelligence telemetry without requiring any backend processing.
|
|
113
125
|
|
|
114
126
|
**Single Endpoint:**
|
|
115
127
|
|
|
@@ -146,17 +158,65 @@ if (result.isSpam) {
|
|
|
146
158
|
}
|
|
147
159
|
```
|
|
148
160
|
|
|
149
|
-
|
|
161
|
+
### 4. Programmatic Configuration (Advanced)
|
|
150
162
|
|
|
151
|
-
|
|
163
|
+
If you are using a modern framework (React, Vue) or Node.js, you can configure SpamWarden programmatically instead of relying on HTML script attributes.
|
|
152
164
|
|
|
153
|
-
|
|
165
|
+
```javascript
|
|
166
|
+
// Example: Customizing behavior
|
|
167
|
+
window.spamwarden.configure({
|
|
168
|
+
// Telemetry Destinations
|
|
169
|
+
endpoint: "https://siem.yourdomain.com/logs",
|
|
170
|
+
siemEndpoint: "https://backup-siem.yourdomain.com/logs",
|
|
171
|
+
autoReport: true,
|
|
172
|
+
isTrusted: true,
|
|
173
|
+
|
|
174
|
+
// Data Protection (DLP)
|
|
175
|
+
reportSD: true, // Same as data-sd="1"
|
|
176
|
+
payloadLimit: 250, // Max length of the reported payload text
|
|
177
|
+
|
|
178
|
+
// Custom Intercepts
|
|
179
|
+
onSpam: function (result) {
|
|
180
|
+
// Override the default alert() trap with your own UI behavior
|
|
181
|
+
console.warn("Spam detected with confidence: " + result.prob);
|
|
182
|
+
// showCustomModal("Blocked due to policy violation.");
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
customReporter: function (payload) {
|
|
186
|
+
// Override the default HTTP POST and handle the SIEM payload manually
|
|
187
|
+
// myCustomLogger.send(payload);
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 5. Developer Mode & Debugging
|
|
193
|
+
|
|
194
|
+
Because SpamWarden utilizes Hostile Active Defense (Phantom Cores, Traps, etc.), debugging it in the console can be difficult by design.
|
|
195
|
+
|
|
196
|
+
If you are actively developing your UI and need to bypass the security traps or inspect the engine natively, append `data-sw-dev="true"` to your script tag:
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<script src="..." data-sw-dev="true"></script>
|
|
200
|
+
```
|
|
154
201
|
|
|
155
202
|
> [!WARNING]
|
|
156
|
-
> **
|
|
203
|
+
> **Never deploy to production with `data-sw-dev="true"`.** This completely disables the decoy traps and exposes the global `window.spamwarden` object, making it easier for automated botnets to bypass the system.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Scope & Independent Integrity Auditing
|
|
208
|
+
|
|
209
|
+
SpamWarden.js is built exclusively to evaluate the live, fully rendered Document Object Model (DOM) right inside the browser.
|
|
210
|
+
|
|
211
|
+
> [!IMPORTANT]
|
|
212
|
+
> **Client-Side Compliance & Integrity Testing:**
|
|
213
|
+
> While standard backend firewalls check incoming traffic patterns, they are completely blind to data injected directly into compromised template columns or static database rows. If your server has already been breached, backend validation will fail to detect the hidden output being served to search engine crawlers
|
|
214
|
+
>
|
|
215
|
+
> To audit existing compromise footprints, we use our private **[`badlinks`](https://redsocs.com/badlinks)** engine running within the internal **RedSocs Inspector** tools for our EASM platform. This specialized configuration allows auditors and security teams to:
|
|
157
216
|
>
|
|
158
|
-
> - **
|
|
159
|
-
> - **
|
|
217
|
+
> - **Expose Stealth SEO Hijacking:** Automatically unmask hidden tags, hidden layout nodes (`display: none`, `opacity: 0`), and malicious cross-domain tracking assets designed to cheat search engine indices.
|
|
218
|
+
> - **Run Local Compliance Sandboxing:** Evaluate target pages on the fly exactly as an NCSA integrity inspector or external search crawler experiences them, without altering a single line of production code on the target server.
|
|
219
|
+
> - **Generate Deterministic Audit Telemetry:** Stream immediate, non-disruptive compliance indicators back to your secure C2 infrastructure or central SOC to document legal alignment with the [NCSA Web Standard 1.0 framework](https://cdn.redsocs.com/html/ncsa-check.html) - Thailand.
|
|
160
220
|
|
|
161
221
|
---
|
|
162
222
|
|
|
@@ -187,25 +247,23 @@ Sanitized: "Win [CARD_MASKED] now! [at]TUNA_FISH"
|
|
|
187
247
|
================================================
|
|
188
248
|
```
|
|
189
249
|
|
|
190
|
-
**
|
|
250
|
+
**And if it no config or attribute script at `siems` endpoint (like `siems="https://siem-log.youdomain.co.th/spam"`) when initial page; this tool send nothing to the outside.**
|
|
191
251
|
|
|
192
252
|
---
|
|
193
253
|
|
|
194
254
|
About
|
|
195
255
|
|
|
196
|
-
- **Version** 1.3.0 (Engine v11.06)
|
|
197
256
|
- **Author:** [RedSocs](https://github.com/RedSocs)
|
|
198
257
|
- **License:** MIT
|
|
199
258
|
- **Inquiries & Enterprise Support:** [pichit[at]redsocs.com](https://www.google.com/search?q=mailto%3Apichit%40redsocs.com)
|
|
200
259
|
- **Sponsor:** [Buy Me a Coffee](https://buymeacoffee.com/redsocs?new=1)
|
|
201
|
-
|
|
202
|
-
---
|
|
260
|
+
[](https://buymeacoffee.com/redsocs?new=1)
|
|
203
261
|
|
|
204
262
|
### Technical Specs
|
|
205
263
|
|
|
206
|
-
| Property
|
|
207
|
-
|
|
|
208
|
-
| **Minified Size**
|
|
209
|
-
| **Gzipped Size**
|
|
210
|
-
| **Dependencies**
|
|
211
|
-
| **Vocabulary**
|
|
264
|
+
| Property | Value |
|
|
265
|
+
| ----------------- | --------------------------------- |
|
|
266
|
+
| **Minified Size** | ~2.0 MB (including model weights) |
|
|
267
|
+
| **Gzipped Size** | **~341 KB** |
|
|
268
|
+
| **Dependencies** | 0 (Vanilla JS) |
|
|
269
|
+
| **Vocabulary** | 28,106 features |
|