Skip to content

Navigation Menu

Sign in
Sign up

Fix #112: Harden credential file permissions across all auto-collec... - #115

Open
mattiagggg wants to merge 1 commit into
titanwings:main from
mattiagggg:fix/issue-112-harden-credential-file-permissions-across-all
Open

Fix #112: Harden credential file permissions across all auto-collec... #115
mattiagggg wants to merge 1 commit into
titanwings:main from
mattiagggg:fix/issue-112-harden-credential-file-permissions-across-all

Conversation

@mattiagggg

@mattiagggg mattiagggg commented Apr 15, 2026

Copy link
Copy Markdown

Summary

Harden credential file permissions across all auto-collectors to prevent other users on the system from reading sensitive config files containing API tokens and secrets.

Changes

  • Set file permissions to 0o600 (owner read/write only) after writing config in dingtalk_auto_collector.py, feishu_auto_collector.py, feishu_mcp_client.py, and slack_auto_collector.py
  • Set directory permissions to 0o700 (owner only) when creating config parent directories
  • Fix minor typo in CONTRIBUTING.md

Testing

  • Unit tests added in tests/test_config_permissions.py that call save_config, then assert file mode is 0o600 and directory mode is 0o700 (skipped on non-POSIX systems)
  • Manual verification: run save_config() and confirm with ls -la that output files show -rw------- permissions

Closes #112

...o-collectors
Add `import os` and `os.chmod(CONFIG_PATH, 0o600)` after each `CONFIG_PATH.write_text(...)` call, and add `mode=0o700` to each `CONFIG_PATH.parent.mkdir(...)` call in the 4 files that have `save_config()`: feishu_auto_collector.py, slack_auto_collector.py, dingtalk_auto_collector.py, and feishu_mcp_client.py. Create `tests/` directory with `tests/test_config_permissions.py` containing a unittest that writes a config via save_config and asserts file mode is 0o600 and dir mode is 0o700 (skipped on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Harden credential file permissions across all auto-collectors

1 participant

AltStyle によって変換されたページ (->オリジナル) /