8 Commits
Author SHA1 Message Date
Sammy Faridaanddependabot[bot] a309162c89 chore(ci): group GitHub Actions dependency bumps (#121)
* ci(deps): bump docker/login-action from 3.6.0 to 3.7.0

Bumps [docker/login-action](https://github.com/docker/login-action) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/5e57cd118135c172c3672efd75eb46360885c0ef...c94ce9fb468520275223c153574b00df6fe4bcc9)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ci(deps): bump aquasecurity/trivy-action from 0.33.1 to 0.34.1

Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.33.1 to 0.34.1.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/b6643a29fecd7f34b3597bc6acb0a98b03d33ff8...e368e328979b113139d6f9068e03accaed98a518)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.34.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ci(deps): bump actions/attest-build-provenance from 3.1.0 to 4.1.0

Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 3.1.0 to 4.1.0.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest-build-provenance/compare/00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8...a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* ci(deps): bump actions/attest-sbom from 3.0.0 to 4.0.0

Bumps [actions/attest-sbom](https://github.com/actions/attest-sbom) from 3.0.0 to 4.0.0.
- [Release notes](https://github.com/actions/attest-sbom/releases)
- [Changelog](https://github.com/actions/attest-sbom/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest-sbom/compare/4651f806c01d8637787e274ac3bdf724ef169f34...07e74fc4e78d1aad915e867f9a094073a9f71527)

---
updated-dependencies:
- dependency-name: actions/attest-sbom
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* ci(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/b7c566a772e6b6bfb58ed0dc250532a479d7789f...bbbca2ddaa5d8feaa63e36b76fdaad77386f024f)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(ci): add local CI parity script

Add scripts/ci-local.sh to run the same lint, type-check, test, and Docker smoke gates used in CI before pushing grouped dependency branches.

Made-with: Cursor

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-26 16:06:32 -04:00
Sammy Farida 90eb9bd128 Security: Fix command substitution bypass and implement version 2 policy schema (#76)
* Security: Fix command substitution bypass and implement version 2 policy schema

- Hard-ban all command substitution ($(), backticks, $((())) to prevent policy bypasses
- Implement version 2 policy schema with simple_binaries and structured rules
- Remove legacy commands fnmatch patterns (breaking change)
- Add shlex-based argument parsing for argument-aware rule matching
- Block path-based binaries by default for security
- Update config/policy.yml and examples/example-policy.yml to version 2 schema
- Add comprehensive tests for command substitution blocking and version 2 schema
- Update documentation to reflect version 2 schema only
- Update CHANGELOG with security fix and breaking changes

Fixes: Command substitution bypass vulnerabilities (15+ bypasses blocked)
Breaking: Legacy commands patterns removed, version 2 schema only

* Add comprehensive test coverage and improve policy validation

- Add new test files for comprehensive coverage:
  - test_ssh_coverage.py: SSH client edge cases and error handling
  - test_ssh_integration.py: SSH integration scenarios
  - test_utilities_coverage.py: Async task management and progress callbacks
  - test_mcp_server_coverage.py: MCP server coverage (notification handlers, context logging, resources)

- Expand test_ssh.py with extensive test cases (1000+ lines added)

- Improve policy.py structured rule matching:
  - Fix validation to require binary field for structured rules
  - Add validation to ensure structured rules have at least one restriction
  - Improve allow_extra_args logic with path_args support
  - Fix edge cases in argument matching
  - Add type annotations for mypy compliance

- Update documentation:
  - Update CHANGELOG.md with test coverage details
  - Update README.md, SECURITY.md, and wiki documentation
  - Update example-policy.yml with version 2 schema
  - Update CONTRIBUTING.md with script documentation
  - Fix markdownlint issues in SECURITY.md

- Script maintenance:
  - Add scripts/README.md documenting all scripts
  - Add scripts/test-mcp-automated.py for automated testing
  - Remove obsolete scripts (fix-markdownlint.py, fix-markdownlint.sh, test-annotations.sh)
  - Enhance scripts/validate-mcp-schema.py with improved type checking

- Update pyproject.toml configuration

- Clean up .cursor/commands/issues.md (no longer needed)

- Fix code quality issues:
  - Fix ruff UP038: Use X | Y instead of (X, Y) in isinstance
  - Add missing type annotations for mypy compliance
  - Fix unreachable code warnings

* Add .cursor/ to .gitignore and remove from tracking

* fix: Add pytest-asyncio dependency to fix async test failures

- Add pytest-asyncio>=0.21.0,<1.0.0 to test dependencies
- Configure asyncio_mode = 'auto' in pytest settings
- Fixes 10 failing async tests in test_mcp_server_coverage.py

* fix: Fix all broken code blocks and formatting issues in markdown files

- Fix unclosed code blocks in docs/CONTRIBUTING.md
- Fix broken code blocks in docs/wiki/12-Troubleshooting.md
- Fix broken code blocks in docs/wiki/13-Contributing.md
- Fix broken code blocks in docs/wiki/06-Configuration.md
- Fix broken code blocks in docs/wiki/11-Observability-Audit.md
- Wrap JSON examples in proper code blocks with json language specifier
- Fix code block language specifiers
- Ensure all code blocks are properly closed

Addresses PR review feedback from CodeBotD
2025-11-20 23:24:07 -05:00
Sammy Farida 166955b732 chore: Update CHANGELOG for v1.0.0 major release
- Fix duplicate Unreleased header
- Move README improvements to v1.0.0 section
- Mark first major release milestone

This release represents a major milestone with:
- Comprehensive documentation improvements
- Production-ready security features
- Complete feature set for zero-trust SSH orchestration
2025-11-19 18:56:34 -05:00
Sammy Farida f874b13d34 Security/fix command chaining bypass (#68)
* fix: Remove unused variable in fix-markdownlint.py

* fix: Remove unused code_block_lang variable

* chore: Update documentation, workflows, and examples

- Updated all wiki documentation files (markdownlint fixes)
- Updated GitHub workflows and issue templates
- Updated example configuration files
- Updated metadata.json and pyproject.toml
- Updated Dockerfile and compose files
- Updated validation scripts

Note: yamllint warnings are style-only (missing ---, line length) and don't affect functionality
2025-11-18 07:00:42 -05:00
Sammy Farida efa6e19099 feat: Improve SSH error handling with specific messages and per-host … (#67)
* feat: Improve SSH error handling with specific messages and per-host exception handling

- Enhanced SSH error messages with specific failure reasons:
  * Authentication failures, timeouts, connection refused
  * DNS resolution failures, host key verification errors
  * Key file errors (not found, permission denied, format invalid, passphrase required)
  * Network unreachable errors
- Added per-host exception handling in ssh_run_on_tag:
  * Individual host failures no longer stop entire operation
  * Each host's result included in results array with exit_code: -1 for failures
  * Proper task cleanup on failure
- Improved async task error handling with sanitized error messages
- Comprehensive test coverage:
  * 12 new unit tests for SSH error scenarios
  * 5 new integration tests for per-host handling
  * 7 new MCP compliance tests
- Added MCP Inspector test script for error handling validation
- Updated documentation:
  * Troubleshooting guide with detailed error message explanations
  * Tools reference with error handling documentation
  * CHANGELOG with all improvements

All error messages are sanitized for security (no IPs, hostnames, or file paths exposed).
Follows MCP specification requirements for error handling patterns.

* fix: Replace socket.timeout with TimeoutError per ruff UP041 rule

- Changed socket.timeout to TimeoutError in test_ssh_client_connection_timeout
- Fixes ruff linting error UP041
- Test still passes (TimeoutError is handled by existing exception handler)
2025-11-17 17:29:59 -05:00
Sammy Farida ab83aeabee docs: refresh security guidance (#64) 2025-11-15 10:08:14 -05:00
Sammy Farida 28392722a1 feat: add MCP resources, context logging, and denial hints (#63)
* feat: add MCP resources, context logging, and denial hints

* fix: resolve merge markers in mcp server

* chore: apply black formatting
2025-11-14 22:08:44 -05:00
Sammy Farida 1e36ddf28d feat: add multi-arch image description via outputs parameter (#55)
Add outputs parameter to docker/build-push-action to set annotations
on the multi-arch manifest index, enabling description to appear on
GitHub Packages.

Changes:
- Added outputs parameter with annotation-index.org.opencontainers.* keys
- Simplified description text to remove commas (prevents parsing conflicts)
- Description: 'A secure SSH fleet orchestrator for MCP STDIO transport...'
- Tested locally with Docker Buildx (all tests passed)
- Added comprehensive test script (scripts/test-annotations.sh)

Fixes missing description on GitHub Packages for multi-arch images.
See: https://docs.github.com/packages/working-with-a-github-packages-registry/working-with-the-container-registry#labelling-container-images
2025-11-13 11:47:42 -05:00