diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..f02f17a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,14 @@ +# These are supported funding model platforms + +github: rennf93 +# patreon: # Replace with a single Patreon username +# open_collective: # Replace with a single Open Collective username +# ko_fi: # Replace with a single Ko-fi username +# tidelift: # not applicable for this ecosystem +# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +# liberapay: # Replace with a single Liberapay username +# issuehunt: # Replace with a single IssueHunt username +# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +# polar: # Replace with a single Polar username +# buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +custom: ['https://paypal.me/renzof93'] diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..c4e5cb2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,51 @@ +name: Bug report +description: prest-guard does not behave as documented +title: "[BUG] " +labels: [bug] +body: + - type: input + id: value + attributes: + label: Value this delivers + description: One sentence a user could witness once this is fixed. + placeholder: "Requests with whitelisted IPs are no longer rate limited." + validations: + required: true + - type: textarea + id: what + attributes: + label: What happened + description: What you did, what you expected, what you got. Error messages, panics and logs go here. + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + placeholder: | + 1. Configure prest-guard with '...' + 2. Send a request to '...' + 3. See error + validations: + required: true + - type: input + id: versions + attributes: + label: Versions + description: prest-guard version, Go version, OS. + placeholder: "prest-guard 1.1.0, go 1.26, Ubuntu 24.04" + validations: + required: true + - type: textarea + id: config + attributes: + label: Configuration + description: Your config with secrets masked. + render: go + placeholder: | + // Minimal setup that reproduces the issue (secrets masked) + - type: textarea + id: context + attributes: + label: Additional context + description: Production or development, consistent or intermittent, workarounds tried. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..d50023d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: prest-guard Documentation + url: https://guard-core.github.io/prest-guard/ + about: Check the documentation for usage information and tutorials + - name: Discord + url: https://discord.gg/ZW7ZJbjMkK + about: Questions and support in #help, new versions in #releases, development stream in #dev-feed diff --git a/.github/ISSUE_TEMPLATE/docs.yml b/.github/ISSUE_TEMPLATE/docs.yml new file mode 100644 index 0000000..ee9d219 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/docs.yml @@ -0,0 +1,31 @@ +name: Documentation +description: Wrong, missing or unclear prest-guard documentation +title: "[DOCS] " +labels: [documentation] +body: + - type: input + id: value + attributes: + label: Value this delivers + description: One sentence a reader could witness once this is fixed. + placeholder: "The rate limiting page shows the exact config for a Redis-backed store." + validations: + required: true + - type: input + id: page + attributes: + label: Page + description: URL of the page or section. + validations: + required: true + - type: textarea + id: problem + attributes: + label: What is wrong or missing + validations: + required: true + - type: textarea + id: proposal + attributes: + label: Proposed text + render: markdown diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 0000000..426783d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,35 @@ +name: Feature request +description: Suggest an improvement to prest-guard +title: "[FEATURE] " +labels: [enhancement] +body: + - type: input + id: value + attributes: + label: Value this delivers + description: One sentence a user could witness once this exists. + placeholder: "A single toggle disables all detection for one route." + validations: + required: true + - type: textarea + id: job + attributes: + label: The job you are trying to get done + description: The outcome you need, not the mechanism you imagine. + validations: + required: true + - type: textarea + id: workaround + attributes: + label: How you work around it today + - type: textarea + id: example + attributes: + label: Example usage + description: Pseudocode of how you would like to use it. + render: go + - type: textarea + id: context + attributes: + label: Additional context + description: Similar features in other libraries, constraints, API implications. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..a9802b4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,61 @@ +Delivers issue: # + + + +Description +=========== + + + +___ + +Motivation and Context +---------------------- + + + + +___ + +Type of change +-------------- + + + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) +- [ ] Documentation change +- [ ] Performance improvement +- [ ] Code cleanup or refactoring + +___ + +How Has This Been Tested +------------------------- + + + + + +___ + +Screenshots (if appropriate) +----------------------------- + +___ + +Checklist +--------- + + + + +- [ ] My code follows the code style of this project (gofmt, go vet, staticcheck) +- [ ] I have added tests to cover my changes +- [ ] All new and existing tests passed +- [ ] My change requires a change to the documentation +- [ ] I have updated the documentation accordingly +- [ ] I have checked that my changes don't introduce any new warnings or errors +- [ ] I have updated the version number if necessary +- [ ] I have added any new dependencies to the go.mod diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..427bae2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + groups: + go-modules: + patterns: + - "*" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..4153dad --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,162 @@ +Contributor Covenant Code of Conduct +==================================== + +___ + +Our Pledge +----------- + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +___ + +Our Standards +------------- + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +___ + +Enforcement Responsibilities +---------------------------- + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +___ + +Scope +----- + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +___ + +Enforcement +----------- + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +contact@guard-core.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +___ + +Enforcement Guidelines +---------------------- + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +___ + +Correction +---------- + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +___ + +Warning +------- + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +___ + +Temporary Ban +------------- + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +___ + +Permanent Ban +------------- + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +___ + +Attribution +----------- + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +. Translations are available at +. diff --git a/GOVERNANCE.md b/GOVERNANCE.md new file mode 100644 index 0000000..e270604 --- /dev/null +++ b/GOVERNANCE.md @@ -0,0 +1,29 @@ +# Governance + +prest-guard is part of the [Guard Core](https://github.com/Guard-Core) ecosystem. I maintain it alone; [MAINTAINERS.md](MAINTAINERS.md) lists who I am and how to check it. + +## Decisions + +I make the final call on every change: features, releases, security fixes and repository access. A proposal starts as an issue, so the reasoning is public before any code is written. + +## How a change lands + +1. Every change is a pull request to `master`. +2. The branch ruleset requires signed commits, linear history, passing status checks and two approvals, one of them from a code owner ([CODEOWNERS](.github/CODEOWNERS)). As the only maintainer I cannot get those approvals, so I merge my own pull requests with admin rights. That skips the approval count only: I never merge with a failing check. +3. A pull request closes an open issue (`Closes #N`), or carries the `no-issue` label when it is a small fix with nothing to discuss. + +## Releases + +Versions follow semantic versioning. Adapters version on their own, because each one follows its framework, and declare the engine versions they support. Releases are cut from tags and recorded in [CHANGELOG.md](CHANGELOG.md). + +## Security + +Vulnerabilities go through [SECURITY.md](SECURITY.md), never through public issues. + +## New maintainers + +Contributors with a record of reviewed and merged work can be invited as maintainers. A new maintainer is added to MAINTAINERS.md and CODEOWNERS in a pull request. + +## Conduct + +The [Code of Conduct](CODE_OF_CONDUCT.md) applies to every space of this project. diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000..492ddee --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,21 @@ +# Maintainers + +prest-guard has one maintainer. + +| Name | GitHub | Email | Role | +|---|---|---|---| +| Renzo Franceschini | [@rennf93](https://github.com/rennf93) | rennf93@guard-core.com | Lead maintainer: reviews and merges every change, publishes every release, handles security reports | + +## Identity + +- GitHub profile [@rennf93](https://github.com/rennf93): name Renzo Franceschini, website guard-core.com. +- [guard-core.com/company](https://guard-core.com/company) names Renzo Franceschini and links to @rennf93. +- The [Guard-Core](https://github.com/Guard-Core) GitHub organization has guard-core.com as a verified domain. +- Go: the module path is `github.com/rennf93/prest-guard`. + +## Related files + +- Code ownership: [CODEOWNERS](.github/CODEOWNERS) +- How decisions are made: [GOVERNANCE.md](GOVERNANCE.md) +- Security reports: [SECURITY.md](SECURITY.md) +- Getting help: [SUPPORT.md](SUPPORT.md) diff --git a/SECURITY.md b/SECURITY.md index 48bf724..d946b53 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,9 +3,15 @@ prest-guard is a security layer; reports about it are treated as security-critical. +## Supported versions + +| Version | Supported | +| ------- | --------- | +| 1.x | :white_check_mark: bug and security fixes | + ## Reporting a vulnerability -Email the maintainer directly or open a GitHub security advisory +Email security@guard-core.com or open a GitHub security advisory (Security > Report a vulnerability). Please do not open a public issue for anything that looks exploitable. @@ -19,4 +25,3 @@ configuration (env vars, with secrets redacted), and a reproduction. treat crash reports as in scope. - Known accepted trade: content past PREST_GUARD_MAX_BODY_BYTES is not scanned and reaches the handler (documented in the README). -- Supported versions: latest release only. diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 0000000..71f6197 --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,8 @@ +# Support + +- Documentation: [https://guard-core.github.io/prest-guard/](https://guard-core.github.io/prest-guard/) +- Questions: the #help channel on [Discord](https://discord.gg/ZW7ZJbjMkK) +- Chat: [Discord](https://discord.gg/ZW7ZJbjMkK), #help for questions, #releases for new versions. +- Bugs and feature requests: [issues](https://github.com/Guard-Core/prest-guard/issues/new/choose), using the templates. +- Security reports: [SECURITY.md](SECURITY.md), never a public issue. +- The hosted Guard Core app (app.guard-core.com): [saas-issues](https://github.com/Guard-Core/saas-issues).