Thank you for your interest in contributing to node-sops! This document provides guidelines and instructions for contributing.
node-sops is a security-focused library for managing secrets. Security must be a top priority when contributing:
- Never weaken encryption: We use AES-256-GCM for authenticated encryption. Any changes must maintain or improve security.
- Backwards compatibility: Changes must not break existing encrypted files.
- Secure by default: All new features should be secure by default.
- No key exposure: Never log or expose encryption keys.
- Secure file handling: Temporary files must be securely deleted and use random names.
- Security features: Permission checks, secure deletion, and tamper detection are critical.
# Clone the repository
git clone <repository-url>
cd node-sops
# Install dependencies
npm install
# Run tests
npm test
# Run linting
npm run lint
# Build the project
npm run build- Fork the repository and create a branch for your feature/fix
- Ensure all tests pass and add new tests for new functionality
- Update documentation (README.md, SECURITY.md, etc.) as needed
- Submit a pull request with a clear description of the changes
- All new functionality must include tests
- Security-critical functions should have comprehensive tests
- All tests must pass before submitting a PR
- Test backward compatibility with older encrypted formats
When adding or changing security-critical code:
- Test for proper handling of tampering (altered ciphertext, altered IV)
- Ensure key files are stored with proper permissions
- Verify secure cleanup of temporary files
- Test error handling for security-critical operations
- Check for information leakage in error messages
Keep documentation up to date, especially:
- README.md for user-facing features and usage
- SECURITY.md for security features and considerations
- Code comments for implementation details
- JSDoc for all public API functions
- Follow the existing code style
- Use TypeScript types for all functions and interfaces
- Use descriptive variable names
- Add meaningful comments
- Use error handling consistently
If you discover a security vulnerability:
- Do NOT create a public GitHub issue
- Email the maintainers directly at [security contact]
- Include detailed information about the vulnerability
- Allow time for the issue to be addressed before disclosure
By contributing to this project, you agree that your contributions will be licensed under the project's MIT License.