| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Sorry, something went wrong.
There was a problem hiding this comment.
This PR centralizes the Fail2ban socket path used when the Agent runs inside Docker by moving it into ndsudo, so the go.d Fail2ban collector no longer passes the socket path as an argument.
Changes:
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/go/plugin/go.d/collector/fail2ban/exec.go | Removes per-collector Docker socket path argument passing and relies on socket-specific ndsudo commands. |
| src/go/plugin/go.d/collector/fail2ban/exec_test.go | Adds tests that stub ndsudo to assert the collector calls it with the expected arguments. |
| src/collectors/utils/ndsudo.c | Moves the Docker socket path into ndsudo by hardcoding it into Fail2ban socket command templates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
sequenceDiagram
participant GC as Go Collector (fail2ban)
participant ND as ndsudo
participant FB as fail2ban-client
participant SK as fail2ban.sock (Docker)
participant FS as fail2ban-server
Note over GC,FS: Fail2ban Socket Path Centralized in ndsudo
alt Host Mode
GC->>ND: execute("fail2ban-client-status")
ND->>FB: fail2ban-client status
FB->>FS: Query status
FS-->>FB: Status response
FB-->>ND: stdout
ND-->>GC: []byte
else Docker Mode (isInsideDocker=true)
GC->>ND: execute("fail2ban-client-status-socket")
ND->>SK: -s /host/var/run/fail2ban/fail2ban.sock status
SK->>FB: Read socket
FB->>FS: Query status via socket
FS-->>FB: Status response
FB-->>SK: stdout
SK-->>ND: Socket response
ND-->>GC: []byte
end
alt Host Mode (jail)
GC->>ND: execute("fail2ban-client-status-jail", "--jail", jail)
ND->>FB: fail2ban-client status <jail>
FB->>FS: Query jail status
FS-->>FB: Jail status response
FB-->>ND: stdout
ND-->>GC: []byte
else Docker Mode (isInsideDocker=true, jail)
GC->>ND: execute("fail2ban-client-status-jail-socket", "--jail", jail)
ND->>SK: -s /host/var/run/fail2ban/fail2ban.sock status <jail>
SK->>FB: Read socket
FB->>FS: Query jail status via socket
FS-->>FB: Jail status response
FB-->>SK: stdout
SK-->>ND: Socket response
ND-->>GC: []byte
end
Sorry, something went wrong.
) (cherry picked from commit 6a96484)
(cherry picked from commit 6a96484)
| Back | FazBrowse Home | New Git URL |
Summary
Test Plan
Additional Information
For users: How does this change affect me?Summary by cubic
Move the Fail2ban Docker socket path into ndsudo and stop passing it from the go.d collector. This centralizes configuration, reduces duplication, and avoids mismatches in containers.
Written for commit b5a0ed5. Summary will update on new commits.