Skip to content

Commit 2badc8a

Browse files
committed
Add UDP listen integrity check for Monit
1 parent 9bbd936 commit 2badc8a

4 files changed

Lines changed: 42 additions & 6 deletions

File tree

monitoring/monit/services/01-system

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,18 @@
126126
group integrity
127127
if status != 0 then alert
128128

129+
# Open TCP listening sockets
130+
check program network_tcp_listen
131+
with path "/usr/local/sbin/server-integrity.sh -c TCPLISTEN -r '@@INTEGRITY_TCPLISTEN@@'" every 33 cycles
132+
group integrity
133+
if status != 0 then alert
134+
135+
# Open UDP listening sockets
136+
check program network_udp_listen
137+
with path "/usr/local/sbin/server-integrity.sh -c UDPLISTEN -r '@@INTEGRITY_UDPLISTEN@@'" every 33 cycles
138+
group integrity
139+
if status != 0 then alert
140+
129141
# List of files in /
130142
check program fs_rootlist
131143
with path "/usr/local/sbin/server-integrity.sh -c ROOT -r '@@INTEGRITY_ROOTLIST@@'" every 33 cycles

monitoring/monit/services/01-system_preinst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ INTEGRITY_HOP2_DEFAULT="$(/usr/local/sbin/server-integrity.sh -c HOP2 -h "$INTEG
3232
INTEGRITY_REVERSE_DEFAULT="$(/usr/local/sbin/server-integrity.sh -c PTR1)"
3333
INTEGRITY_FIRST_MX_DEFAULT="$(/usr/local/sbin/server-integrity.sh -c MX1 || true)"
3434
INTEGRITY_RESOLVERS_DEFAULT="$(/usr/local/sbin/server-integrity.sh -c RES)"
35+
INTEGRITY_TCPLISTEN_DEFAULT="$(/usr/local/sbin/server-integrity.sh -c TCPLISTEN)"
36+
INTEGRITY_UDPLISTEN_DEFAULT="$(/usr/local/sbin/server-integrity.sh -c UDPLISTEN)"
3537
INTEGRITY_ROOTLIST_DEFAULT="$(/usr/local/sbin/server-integrity.sh -c ROOT)"

monitoring/monit/services/01-system_script

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ case "$CHECK" in
243243
TCPLISTEN)
244244
RESULT="$(awk 'FNR > 1 && $4 == "0A" {print $2}' /proc/net/tcp /proc/net/tcp6 | sort | md5sum | cut -d " " -f 1)"
245245
;;
246+
UDPLISTEN)
247+
RESULT="$(awk 'FNR > 1 && $3 == "00000000:0000" {print $2}' /proc/net/udp /proc/net/udp6 | sort | md5sum | cut -d " " -f 1)"
248+
;;
246249
*)
247250
# Missing check
248251
exit 11

webserver/HTTP-response-headers.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,36 @@
44

55
:memo: Section 7 of \[RFC9110]
66

7-
- `Connection`
87
- `Upgrade`
8+
- `Connection`
99

1010
## Caching & Freshness
1111

1212
:memo: \[RFC9111]
1313

14+
- `Age`
1415
- `Cache-Control`
16+
- `ETag`
1517
- `Expires`
1618
- `Last-Modified`
19+
- `Vary`
1720

1821
## Content & Representation Metadata
1922

2023
:memo: Section 8 of \[RFC9110]
2124

25+
- `Content-Encoding`
26+
- `Content-Language`
2227
- `Content-Length`
2328
- `Content-Type`
2429

25-
## Request Context & Navigation
30+
## Request / Response Context
2631

2732
:memo: Section 10 of \[RFC9110]
2833

34+
MDN uses separate `Request context` and `Response context` group names.
35+
Fetch Metadata headers (`Sec-Fetch-*`) are request headers, so they are out of scope here.
36+
2937
## Authentication & Authorization
3038

3139
:memo: Section 11 of \[RFC9110]
@@ -34,17 +42,22 @@
3442

3543
:memo: \[RFC6265]
3644

45+
- `Set-Cookie`
46+
3747
## Security & Privacy
3848

3949
:memo: Section 12 of \[RFC9110], \[RFC6797], \[RFC8941]
4050

51+
- `Content-Security-Policy`
4152
- `X-Content-Type-Options`
4253
- `Strict-Transport-Security`
4354

4455
## CORS (Cross-Origin Resource Sharing)
4556

4657
:memo: [Fetch Living Standard – CORS](https://fetch.spec.whatwg.org/)
4758

59+
- `Access-Control-Allow-Origin`
60+
4861
## Redirects & Location
4962

5063
:memo: Section 15.5.2 of \[RFC9110]
@@ -53,29 +66,35 @@
5366

5467
:memo: Section 7.6 of \[RFC9110]
5568

69+
- `Via`
70+
5671
## Server & Response Info
5772

5873
:memo: Sections 6 and 10 of \[RFC9110]
5974

6075
- `Date`
6176
- `Server`
6277

63-
## Streaming & Events (Range, SSE, WebSocket)
78+
## Streaming, Range & Protocol Upgrades
6479

6580
:memo: Section 14 of \[RFC9110], \[RFC6455]
6681

82+
This category combines MDN groups `Range requests`, `Server-sent events`, `Transfer coding`, and `WebSockets`.
83+
6784
- `Accept-Ranges`
85+
- `Content-Range`
86+
- `Transfer-Encoding`
6887

69-
## Miscellaneous / Non-standard
88+
## Other / Non-standard / Deprecated
7089

7190
## See also
7291

7392
- https://www.iana.org/assignments/http-fields/http-fields.xhtml
7493
- https://www.geeksforgeeks.org/web-tech/http-headers/
7594
- https://github.com/mnot/redbot/blob/c47e907f0c76003fa6411e5a1ce0c9e35635d559/redbot/speak.py#L20-L27
76-
- [MDN HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)
95+
- [MDN HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers)
7796

7897
```javascript
7998
Array.from(document.querySelectorAll("h2 > a")).map(function(anchor){return anchor.innerText}).join(",");
80-
// "Authentication,Caching,Conditionals,Connection management,Content negotiation,Controls,Cookies,CORS,Downloads,Integrity digests,Integrity policy,Message body information,Preferences,Proxies,Range requests,Redirects,Request context,Response context,Security,Server-sent events,Transfer coding,WebSockets,Other,Experimental headers,Non-standard headers,Deprecated headers,See also"
99+
// "Authentication,Caching,Conditionals,Connection management,Content negotiation,Controls,Cookies,CORS,Downloads,Integrity digests,Integrity policy,Message body information,Preferences,Proxies,Range requests,Redirects,Request context,Response context,Security,Fetch storage access headers,Server-sent events,Transfer coding,WebSockets,Other,Experimental headers,Non-standard headers,Deprecated headers,See also"
81100
```

0 commit comments

Comments
 (0)