Mercurial > prosody-modules
comparison mod_firewall/README.markdown @ 4583:bb8459c220c9
mod_firewall: Documentation updates to reduce confusion and use inclusive language
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 05 Jun 2021 16:23:21 +0100 |
parents | c316ad1087d4 |
children | d7684aa81d8f |
comparison
equal
deleted
inserted
replaced
4582:cc20493018f6 | 4583:bb8459c220c9 |
---|---|
124 `ENTERING` When a stanza is entering the named zone | 124 `ENTERING` When a stanza is entering the named zone |
125 `LEAVING` When a stanza is leaving the named zone | 125 `LEAVING` When a stanza is leaving the named zone |
126 | 126 |
127 ### Lists | 127 ### Lists |
128 | 128 |
129 It is possible to create or load lists of strings for use in scripts. For example, you might load a JID blacklist, | 129 It is possible to create or load lists of strings for use in scripts. For |
130 a list of malware URLs or simple words that you want to filter messages on. | 130 example, you might load a list of blocked JIDs, malware URLs or simple words |
131 that you want to filter messages on. | |
131 | 132 |
132 List type Example | 133 List type Example |
133 ----------- ----------------------- | 134 ----------- ----------------------- |
134 memory %LIST spammers: memory | 135 memory %LIST spammers: memory |
135 file %LIST spammers: file:/etc/spammers.txt | 136 file %LIST spammers: file:/etc/spammers.txt |
181 | 182 |
182 Checks whether a simple [expression](#expressions) is found in a given list. | 183 Checks whether a simple [expression](#expressions) is found in a given list. |
183 | 184 |
184 Example: | 185 Example: |
185 | 186 |
186 %LIST blacklist: file:/etc/prosody/blacklist.txt | 187 %LIST blocked_jids: file:/etc/prosody/blocked_jids.txt |
187 | 188 |
188 # Rule to block presence subscription requests from blacklisted JIDs | 189 # Rule to block presence subscription requests from blocked JIDs |
189 KIND: presence | 190 KIND: presence |
190 TYPE: subscribe | 191 TYPE: subscribe |
191 CHECK LIST: blacklist contains $<@from> | 192 CHECK LIST: blocked_jids contains $<@from> |
192 BOUNCE=policy-violation (Your JID is blacklisted) | 193 BOUNCE=policy-violation (Your JID is blocked) |
193 | 194 |
194 #### SCAN | 195 #### SCAN |
195 | 196 |
196 SCAN allows you to search inside a stanza for a given pattern, and check each result against a list. For example, | 197 SCAN allows you to search inside a stanza for a given pattern, and check each result against a list. For example, |
197 you could scan a message body for words and check if any of the words are found in a given list. | 198 you could scan a message body for words and check if any of the words are found in a given list. |
277 | 278 |
278 # Match admin@example.com, and admin1@example.com, etc. | 279 # Match admin@example.com, and admin1@example.com, etc. |
279 FROM: <<admin%d*>>@example.com | 280 FROM: <<admin%d*>>@example.com |
280 | 281 |
281 **Note:** It is important to know that 'example.com' is a valid JID on | 282 **Note:** It is important to know that 'example.com' is a valid JID on |
282 its own, and does **not** match 'user@example.com'. To perform domain | 283 its own, and does **not** match 'user@example.com'. To efficiently match |
283 whitelists or blacklists, use [Zones](#zones). | 284 domains we recommend defining them as [Zones](#zones). |
284 | 285 |
285 Condition Matches | 286 Condition Matches |
286 ---------------- --------------------------------------------------------------- | 287 ---------------- --------------------------------------------------------------- |
287 `FROM_EXACTLY` The JID in the 'from' attribute exactly matches the given JID | 288 `FROM_EXACTLY` The JID in the 'from' attribute exactly matches the given JID |
288 `TO_EXACTLY` The JID in the 'to' attribute exactly matches the given JID | 289 `TO_EXACTLY` The JID in the 'to' attribute exactly matches the given JID |