Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

name: Bug Report - .NET
description: File a bug report for the .NET version of the AntiSSRF library
title: "[Bug][.NET]: <title>"
labels: ["bug", "dotnet"]
type: bug
body:

- type: textarea
attributes:
label: Bug Behavior
description: Describe the current behavior you are experiencing. Include any error messages, unexpected responses, or other issues.
validations:
required: false

- type: textarea
attributes:
label: Expected Behavior
description: Describe what you expected to happen instead of the current behavior.
validations:
required: false

- type: textarea
attributes:
label: Steps To Reproduce
description: Provide clear steps to reproduce this issue, including code samples if applicable.
placeholder: |
1. Create policy: `var policy = new AntiSSRFPolicy(PolicyConfigOptions.ExternalOnlyLatest);`
2. Get handler: `using var handler = policy.GetHandler();`
3. Create HttpClient: `using var client = new HttpClient(handler);`
4. Make request: `var response = await client.GetAsync("https://example.com");`
5. Observe unexpected behavior: [describe what happens]
validations:
required: false

- type: input
attributes:
label: Version
description: Specify the version of the AntiSSRF .NET library where you encountered this issue.
placeholder: "e.g., 1.0.0"
validations:
required: true

- type: input
attributes:
label: Operating System
description: Specify your operating system and version.
placeholder: "e.g., Ubuntu 22.04, Windows 11, macOS 15.0"
validations:
required: true

- type: input
attributes:
label: .NET Version
description: Specify the .NET version you are using.
placeholder: "e.g., 8.0.100"
validations:
required: true

- type: textarea
attributes:
label: Additional Context
description: |
Provide any additional context, links to documentation, stack traces, or other relevant information that may help us understand and resolve this issue.
validations:
required: false

- type: checkboxes
attributes:
label: Verification
description: Please confirm before submitting your bug report.
options:
- label: I have searched existing issues and confirmed this bug has not already been reported
required: true

- type: markdown
attributes:
value: "Thank you for helping us improve the AntiSSRF library!"
81 changes: 51 additions & 30 deletions .github/ISSUE_TEMPLATE/bug_report_nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,80 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

name: Bug - Node.js
description: File a bug report for the NodeJS version of the AntiSSRF library.
title: "[Bug][Nodejs]: <title>"
name: Bug Report - Node.js
description: File a bug report for the Node.js version of the AntiSSRF library
title: "[Bug][Node.js]: <title>"
labels: ["bug", "nodejs"]
assignees:
- leah-restad
type: bug
body:

- type: textarea
attributes:
label: Bug Behavior
description: A concise description of what you're experiencing.
description: Describe the current behavior you are experiencing. Include any error messages, unexpected responses, or other issues.
validations:
required: false

- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
description: Describe what you expected to happen instead of the current behavior.
validations:
required: false

- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
description: Provide clear steps to reproduce this issue, including code samples if applicable.
placeholder: |
1. In this environment...
1. With this config...
1. Run '...'
1. See error...
1. Import the library: `import { AntiSSRFPolicy, PolicyConfigOptions } from "@microsoft/antissrf";`
2. Create policy: `const policy = new AntiSSRFPolicy(PolicyConfigOptions.ExternalOnlyLatest);`
3. Get agent: `const agent = policy.getHttpsAgent();`
4. Make request: `https.get("https://example.com", { agent }, (res) => { ... });`
5. Observe unexpected behavior: [describe what happens]
validations:
required: false
- type: textarea

- type: input
attributes:
label: Environment
description: |
examples:
- **OS**: Ubuntu 20.04
- **Node**: 13.14.0
- **npm**: 7.6.3
value: |
- OS:
- Node:
- npm:
render: markdown
label: Version
description: Specify the version of the AntiSSRF Node.js library where you encountered this issue.
placeholder: "e.g., 1.0.0"
validations:
required: false
required: true

- type: input
attributes:
label: Operating System
description: Specify your operating system and version.
placeholder: "e.g., Ubuntu 22.04, Windows 11, macOS 15.0"
validations:
required: true

- type: input
attributes:
label: Node.js Version
description: Specify the Node.js version you are using.
placeholder: "e.g., 22.1.0"
validations:
required: true

- type: textarea
attributes:
label: Anything else?
label: Additional Context
description: |
Links? References? Anything that will give us more context about the issue you are encountering!

Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
Provide any additional context, links to documentation, stack traces, or other relevant information that may help us understand and resolve this issue.
validations:
required: false


- type: checkboxes
attributes:
label: Verification
description: Please confirm before submitting your bug report.
options:
- label: I have searched existing issues and confirmed this bug has not already been reported
required: true

- type: markdown
attributes:
value: "Thank you for helping us improve the AntiSSRF library!"
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

name: Feature Request
description: Request a new feature or enhancement for the AntiSSRF library
title: "[Feature]: <title>"
labels: ["enhancement"]
type: feature
body:

- type: textarea
attributes:
label: Feature Description
description: Describe the feature you would like to see added to AntiSSRF.
validations:
required: true

- type: textarea
attributes:
label: Problem Statement
description: Describe the problem this feature would solve or the use case it would enable.
validations:
required: true

- type: textarea
attributes:
label: Proposed Solution
description: Describe how you envision this feature working. Include any API design ideas or implementation approaches.
validations:
required: false

- type: textarea
attributes:
label: Alternative Solutions
description: Describe any alternative solutions or workarounds you have considered.
validations:
required: false

- type: textarea
attributes:
label: Additional Context
description: Provide any additional context, examples, links to documentation, or other relevant information that supports this feature request.
validations:
required: false

- type: checkboxes
attributes:
label: Applicable Libraries
description: Select all that apply for which AntiSSRF library or libraries this feature request applies to.
options:
- label: .NET Library
- label: Node.js Library
validations:
required: false

- type: markdown
attributes:
value: "Thank you for helping us improve the AntiSSRF library!"
99 changes: 55 additions & 44 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,79 @@
# Contributing to AntiSSRF

Thank you for your interest in contributing to the AntiSSRF project! This guide will help you get started.
Thank you for your interest in contributing to Microsoft AntiSSRF! This guide will help you get started with contributing to our security library.

## Development Setup

### C# AntiSSRF Library

From the `./csharp` directory:
### AntiSSRF .NET Library

**Prerequisites:**
- .NET 8.0 SDK or later

**Commands:**
- **Build:** `dotnet build Microsoft.Security.AntiSSRF.sln`
- **Unit tests:** `dotnet test`
- .NET 8.0 SDK
- Make sure you are in the `/dotnet` folder

### Node.js (TypeScript)
**Useful Commands:**
- Restore dependencies: `dotnet restore`
- Build solution: `dotnet build`
- Run all tests: `dotnet test`

From the `./nodejs` directory:
### AntiSSRF Node.js Library

**Prerequisites:**
- Node.js 20+
- Node.js 20.0 or later
- Make sure you are in the `/nodejs` folder

**Commands:**
- **Install dependencies:** `npm install`
- **Build TypeScript:** `npm run build`
- **Unit tests:** `npm test`
- **Lint code:** `npm run lint`
- **Format code:** `npm run format`
**Useful Commands:**
- Install dependencies: `npm install`
- Build TypeScript: `npm run build`
- Run all tests: `npm test`
- Lint code: `npm run lint`
- Format code: `npm run format`

## Updating IP Address Ranges or Domains
### Documentation

The IP address ranges are maintained in [`config/IPAddressRanges.json`](config/IPAddressRanges.json) and automatically generated into language-specific files.
**Prerequisites:**
- Jekyll (for GitHub Pages)
- Ruby 3.4 or later
- Bundler (`gem install bundler`)
- Make sure you are in the `/docs` folder

The Azure SDK domains are maintained in [`config/Domains.json`](config/Domains.json) and automatically generated into language-specific files.
**Useful Commands:**
- Install dependencies: `bundle install`
- Test locally: `bundle exec jekyll serve`

**Prerequisites:**
- `jq`: `brew install jq` (macOS) or `sudo apt-get install jq` (Linux)
## Submitting Issues

**Commands:**
- **Regenerate IP Address Ranges:**
```bash
./scripts/build-ip-ranges-cs.sh
./scripts/build-ip-ranges-nodejs.sh
```
- **Regenerate Domains:**
```bash
./scripts/build-domains-cs.sh
./scripts/build-domains-nodejs.sh
```
We welcome bug reports and feature requests! Please use our issue templates to provide the information we need:

**Important**: The GitHub Actions workflow will fail if generated files don't match the source JSON.
### Bug Reports
- Report in our [GitHub Issues](https://github.com/microsoft/AntiSSRF/issues)
- Please search existing issues first to avoid duplicates
- Provide clear reproduction steps and expected behavior
- Include relevant version information and environment details

## Editing Documentation
### Feature Requests
- Report in our [GitHub Issues](https://github.com/microsoft/AntiSSRF/issues)
- Clearly describe the problem your feature would solve
- Explain your proposed solution and any alternatives considered
- Specify which library (or both) the feature applies to

The project documentation is built with Jekyll and uses the Just the Docs theme.
## Contributing Code

From the `./docs` directory:
We welcome pull requests for bug fixes, features, and documentation improvements:

**Prerequisites:**
- Ruby 2.7+ and Bundler
### Before Submitting
- Verify that all existing tests pass without failures
- Add appropriate test coverage for your changes
- Ensure there are no breaking changes (in rare cases where unavoidable, discuss with maintainers in an issue first)
- Documentation updates are optional but very appreciated

### When Discussion is Required

Before submitting a PR, you must create an issue and discuss with maintainers if your changes involve:

**Commands:**
- **Install dependencies:** `bundle install`
- **Test locally:** `bundle exec jekyll serve`
- Breaking changes - Any modification that could break existing functionality. All other possibilities must be considered before introducing a breaking change.
- New API additions - Adding new public methods, classes, or interfaces.
- Configuration file changes - Modifications to IP address ranges or domains configuration files. These changes will almost always be rejected unless there is an exceptional reason.

The documentation will be available at `http://localhost:4000` when running the local server.
### Pull Request Process
- Be detailed in your description and reproduction steps
- Reference any related issues, bugs, or feature requests
Loading
Loading