Repository navigation
feat(sensor): add standalone secfoo sensor daemon, disk spooler, and service installers (#67) - #235
Open
SriRamkunamsetty wants to merge 1 commit into
Open
SriRamkunamsetty wants to merge 1 commit into
SriRamkunamsetty wants to merge 1 commit into
Conversation
…t sync, and service installers
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
| def _restrictive_chmod(path: Path, mode: int) -> None: | ||
| if os.name == "posix": | ||
| with contextlib.suppress(OSError): | ||
| os.chmod(path, mode) |
| family = socket.AF_INET6 if ":" in host else socket.AF_INET | ||
| srv = socket.socket(family, socket.SOCK_STREAM) | ||
| srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
| srv.bind((host, port)) |
| break | ||
| buf += chunk | ||
| if len(buf) > MAX_LINE_BYTES * 8: | ||
| buf = b"" |
| conn.close() | ||
|
|
||
| def _start_npipe_listener(self, raw_addr: str, pipe_name: str) -> ListenerHandle: | ||
| import ctypes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #67
Summary
secfoo sensor run|status|install|uninstall(src/secfoo/sensor/daemon.py,src/secfoo/sensor/service.py,src/secfoo/cli.py).--listentransports (unix://, loopback-onlytcp://with optionalSECFOO_SENSOR_KEYauth, and Windowsnpipe://), rejecting any routable TCP host or missing API key/server/project cleanly (load_sensor_config()).#73handshake (hello,welcome,slow), bounded in-memory#53coalescing (EventBuffer), ETag-cached/api/runtime/v1/watchlistatomic sync (SECFOO_WATCHLIST), periodic/heartbeat+dropped_total, and bounded FIFO gzipped disk spooling (--max-spool-mb, default 50 MiB) with exponential backoff retry.systemd,launchd, andwindows(sc.exe).Verification
pytest -p no:langsmith -p no:hypothesis tests/test_sensor/test_sensor_daemon.py tests/test_runtime/test_runtime_api.py -q-> 40 passed, 1 skipped (POSIXunix://listener skipped on Windows; Windowsnpipe://, TCP multi-probeauth, ETag304, spool eviction/recovery, and end-to-endsecfoo serveingest within 1 flush interval all passed).ruff check .&bandit -c .bandit -ll -r src/secfoo -q-> passed.git merge-tree --write-tree HEAD upstream/main-> zero conflicts.