|
| 1 | +# Contributing to Ubuntu Server Security |
| 2 | + |
| 3 | +First off, thank you for considering contributing to Ubuntu Server Security! |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Code of Conduct](#code-of-conduct) |
| 8 | +- [Getting Started](#getting-started) |
| 9 | +- [How to Contribute](#how-to-contribute) |
| 10 | +- [Development Setup](#development-setup) |
| 11 | +- [Style Guidelines](#style-guidelines) |
| 12 | +- [Commit Messages](#commit-messages) |
| 13 | +- [Pull Request Process](#pull-request-process) |
| 14 | + |
| 15 | +## Code of Conduct |
| 16 | + |
| 17 | +This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). |
| 18 | +By participating, you are expected to uphold this code. |
| 19 | + |
| 20 | +## Getting Started |
| 21 | + |
| 22 | +- Make sure you have a [GitHub account](https://github.com/signup) |
| 23 | +- Check existing [issues](https://github.com/fidpa/ubuntu-server-security/issues) before creating new ones |
| 24 | +- Fork the repository on GitHub |
| 25 | + |
| 26 | +## How to Contribute |
| 27 | + |
| 28 | +### Reporting Bugs |
| 29 | + |
| 30 | +Before creating bug reports, please check existing issues. |
| 31 | + |
| 32 | +**Great bug reports include:** |
| 33 | +- A clear, descriptive title |
| 34 | +- Steps to reproduce the issue |
| 35 | +- Expected vs actual behavior |
| 36 | +- System information (Ubuntu version, shell version) |
| 37 | +- Relevant logs or error messages |
| 38 | + |
| 39 | +### Suggesting Features |
| 40 | + |
| 41 | +Feature suggestions are welcome! Please: |
| 42 | +- Check if the feature was already requested |
| 43 | +- Describe the use case clearly |
| 44 | +- Explain why this would benefit users |
| 45 | + |
| 46 | +### Security Vulnerabilities |
| 47 | + |
| 48 | +**DO NOT** open public issues for security vulnerabilities. |
| 49 | + |
| 50 | +See [SECURITY.md](SECURITY.md) for responsible disclosure. |
| 51 | + |
| 52 | +### Pull Requests |
| 53 | + |
| 54 | +1. Fork the repo and create your branch from `main` |
| 55 | +2. Make your changes |
| 56 | +3. Test on Ubuntu 22.04 or 24.04 |
| 57 | +4. Ensure all scripts pass `shellcheck` |
| 58 | +5. Update documentation if needed |
| 59 | +6. Submit a pull request |
| 60 | + |
| 61 | +## Development Setup |
| 62 | + |
| 63 | +```bash |
| 64 | +# Clone your fork |
| 65 | +git clone https://github.com/YOUR_USERNAME/ubuntu-server-security.git |
| 66 | +cd ubuntu-server-security |
| 67 | + |
| 68 | +# Verify shellcheck is installed |
| 69 | +shellcheck --version |
| 70 | + |
| 71 | +# Run shellcheck on all scripts |
| 72 | +find . -name "*.sh" -exec shellcheck {} \; |
| 73 | +``` |
| 74 | + |
| 75 | +### Testing Environment |
| 76 | + |
| 77 | +Recommended: Use a VM or container for testing security configurations. |
| 78 | + |
| 79 | +```bash |
| 80 | +# Example with LXD |
| 81 | +lxc launch ubuntu:22.04 security-test |
| 82 | +lxc exec security-test -- bash |
| 83 | +``` |
| 84 | + |
| 85 | +## Style Guidelines |
| 86 | + |
| 87 | +### Bash Scripts |
| 88 | + |
| 89 | +- Use `shellcheck` for linting |
| 90 | +- Follow `set -uo pipefail` pattern |
| 91 | +- Use lowercase for variables, UPPERCASE for constants |
| 92 | +- Quote variables: `"$var"` not `$var` |
| 93 | +- Add comments for complex logic |
| 94 | + |
| 95 | +### Configuration Files |
| 96 | + |
| 97 | +- Include comments explaining each setting |
| 98 | +- Provide safe defaults |
| 99 | +- Document security implications |
| 100 | + |
| 101 | +### Documentation |
| 102 | + |
| 103 | +- Use Markdown |
| 104 | +- Include code examples |
| 105 | +- Keep lines under 100 characters |
| 106 | +- Add TL;DR for long documents |
| 107 | + |
| 108 | +## Commit Messages |
| 109 | + |
| 110 | +Follow conventional format: |
| 111 | +``` |
| 112 | +type: short description |
| 113 | +
|
| 114 | +Longer explanation if needed. |
| 115 | +
|
| 116 | +Fixes #123 |
| 117 | +``` |
| 118 | + |
| 119 | +Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` |
| 120 | + |
| 121 | +**Examples:** |
| 122 | +- `feat: add fail2ban jail for postfix` |
| 123 | +- `fix: correct sshd_config permissions` |
| 124 | +- `docs: update nftables examples` |
| 125 | + |
| 126 | +## Pull Request Process |
| 127 | + |
| 128 | +1. Update README.md if needed |
| 129 | +2. Update CHANGELOG.md with your changes |
| 130 | +3. PRs require one maintainer approval |
| 131 | +4. Squash commits before merging |
| 132 | + |
| 133 | +### PR Checklist |
| 134 | + |
| 135 | +- [ ] Code follows style guidelines |
| 136 | +- [ ] Shellcheck passes without errors |
| 137 | +- [ ] Tested on Ubuntu 22.04 or 24.04 |
| 138 | +- [ ] Documentation updated |
| 139 | +- [ ] CHANGELOG.md updated |
| 140 | + |
| 141 | +## Questions? |
| 142 | + |
| 143 | +- Open a [Discussion](https://github.com/fidpa/ubuntu-server-security/discussions) |
| 144 | +- Check existing documentation |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +Thank you for contributing to Ubuntu Server Security! |
0 commit comments