Skip to content

Commit 7b1a15d

Browse files
committed
update license to bsd and readme
1 parent af58efc commit 7b1a15d

File tree

3 files changed

+66
-93
lines changed

3 files changed

+66
-93
lines changed

LICENSE

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
1-
The MIT License (MIT)
1+
The 3-Clause BSD License (BSD-3-Clause)
22

3-
Copyright (c) 2021 Include Security
3+
Copyright (c) 2022 Slab, Inc.
4+
Copyright (c) 2021 Include Security LLC
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy of
6-
this software and associated documentation files (the "Software"), to deal in
7-
the Software without restriction, including without limitation the rights to
8-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9-
the Software, and to permit persons to whom the Software is furnished to do so,
10-
subject to the following conditions:
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions
8+
are met:
119

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
10+
1. Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
1412

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13+
2. Redistributions in binary form must reproduce the above copyright
14+
notice, this list of conditions and the following disclaimer in the
15+
documentation and/or other materials provided with the distribution.
16+
17+
3. Neither the name of the copyright holder nor the names of its
18+
contributors may be used to endorse or promote products derived from
19+
this software without specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 37 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
SafeURL
2-
=======
1+
# SafeURL
32

43
[![Build Status][badge-github]][github-build]
54
[![Version][badge-version]][hexpm]
65
[![Downloads][badge-downloads]][hexpm]
76
[![License][badge-license]][github-license]
87

9-
108
> SSRF Protection in Elixir 🛡️
119
12-
1310
SafeURL is a library that aids developers in protecting against a class of vulnerabilities
1411
known as Server Side Request Forgery. It does this by validating a URL against a configurable
15-
allow or block list before making an HTTP request. SafeURL is open-source and licensed under
16-
MIT.
17-
18-
This library was originally created by Nick Fox at [Include Security][includesecurity],
19-
with substantial improvements contributed by the [Slab][slab] team. As of January 2022, this
20-
library is now officially maintained by Slab.
12+
allow or block list before making an HTTP request.
2113

2214
See the [Documentation][docs] on HexDocs.
2315

2416
<br>
2517

26-
27-
28-
2918
## Installation
3019

3120
To get started, add `safeurl` to your project dependencies in `mix.exs`. Optionally, you may
@@ -45,9 +34,6 @@ To use SafeURL with your favorite HTTP Client, see the [HTTP Clients][readme-htt
4534

4635
<br>
4736

48-
49-
50-
5137
## Usage
5238

5339
`SafeURL` blocks private/reserved IP addresses are by default, and users can add additional
@@ -58,7 +44,6 @@ You can use `allowed?/2` or `validate/2` to check if a URL is safe to call. If y
5844
[`HTTPoison`][lib-httpoison] application available, you can also call `get/4` which will
5945
validate the host automatically before making a web request, and return an error otherwise.
6046

61-
6247
```elixir
6348
iex> SafeURL.allowed?("https://includesecurity.com")
6449
true
@@ -83,26 +68,23 @@ iex> SafeURL.get("https://google.com/")
8368

8469
<br>
8570

86-
87-
88-
8971
## Configuration
9072

9173
`SafeURL` can be configured to customize and override validation behaviour by passing the
9274
following options:
9375

94-
* `:block_reserved` - Block reserved/private IP ranges. Defaults to `true`.
76+
- `:block_reserved` - Block reserved/private IP ranges. Defaults to `true`.
9577

96-
* `:blocklist` - List of CIDR ranges to block. This is additive with `:block_reserved`.
97-
Defaults to `[]`.
78+
- `:blocklist` - List of CIDR ranges to block. This is additive with `:block_reserved`.
79+
Defaults to `[]`.
9880

99-
* `:allowlist` - List of CIDR ranges to allow. If specified, blocklist will be ignored.
100-
Defaults to `[]`.
81+
- `:allowlist` - List of CIDR ranges to allow. If specified, blocklist will be ignored.
82+
Defaults to `[]`.
10183

102-
* `:schemes` - List of allowed URL schemes. Defaults to `["http, "https"]`.
84+
- `:schemes` - List of allowed URL schemes. Defaults to `["http, "https"]`.
10385

104-
* `:dns_module` - Any module that implements the `SafeURL.DNSResolver` behaviour.
105-
Defaults to `DNS` from the [`:dns`][lib-dns] package.
86+
- `:dns_module` - Any module that implements the `SafeURL.DNSResolver` behaviour.
87+
Defaults to `DNS` from the [`:dns`][lib-dns] package.
10688

10789
These options can be passed to the function directly or set globally in your `config.exs`
10890
file:
@@ -119,16 +101,12 @@ Find detailed documentation on [HexDocs][docs].
119101

120102
<br>
121103

122-
123-
124-
125104
## HTTP Clients
126105

127106
While SafeURL already provides a convenient [`get/4`][docs-get] method to validate hosts
128107
before making GET HTTP requests, you can also write your own wrappers, helpers or
129108
middleware to work with the HTTP Client of your choice.
130109

131-
132110
### HTTPoison
133111

134112
For [HTTPoison][lib-httpoison], you can create a wrapper module that validates hosts
@@ -157,7 +135,6 @@ iex> CustomClient.get("http://230.10.10.10/data.json", [], safeurl: [block_reser
157135
{:ok, %HTTPoison.Response{...}}
158136
```
159137

160-
161138
### Tesla
162139

163140
For [Tesla][lib-tesla], you can write a custom middleware to halt requests that are not
@@ -192,9 +169,6 @@ end
192169

193170
<br>
194171

195-
196-
197-
198172
## Custom DNS Resolver
199173

200174
In some cases you might want to use a custom strategy for DNS resolution. You can do so by
@@ -203,13 +177,12 @@ config.
203177

204178
Example use-cases of this are:
205179

206-
- Using a specific DNS server
207-
- Avoiding network access in specific environments
208-
- Mocking DNS resolution in tests
180+
- Using a specific DNS server
181+
- Avoiding network access in specific environments
182+
- Mocking DNS resolution in tests
209183

210184
You can do so by implementing `DNSResolver`:
211185

212-
213186
```elixir
214187
defmodule TestDNSResolver do
215188
@behaviour SafeURL.DNSResolver
@@ -229,47 +202,36 @@ For more examples, see [`SafeURL.DNSResolver`][docs-dns] docs.
229202

230203
<br>
231204

232-
233-
234-
235205
## Contributing
236206

237-
- [Fork][github-fork], Enhance, Send PR
238-
- Lock issues with any bugs or feature requests
239-
- Implement something from Roadmap
240-
- Spread the word :heart:
207+
- [Fork][github-fork], Enhance, Send PR
208+
- Lock issues with any bugs or feature requests
209+
- Implement something from Roadmap
210+
- Spread the word :heart:
241211

242212
<br>
243213

214+
## About
244215

245-
246-
247-
## License
248-
249-
This package is available as open source under the terms of the [MIT License][github-license].
216+
SafeURL is officially maintained by the team at [Slab][slab]. It was originally created by Nick Fox at
217+
[Include Security][includesecurity].
250218

251219
<br>
252220

253-
254-
255-
256-
[badge-github]: https://github.com/slab/safeurl-elixir/actions/workflows/ci.yml/badge.svg
257-
[badge-version]: https://img.shields.io/hexpm/v/safeurl.svg
258-
[badge-license]: https://img.shields.io/hexpm/l/safeurl.svg
259-
[badge-downloads]: https://img.shields.io/hexpm/dt/safeurl.svg
260-
261-
[hexpm]: https://hex.pm/packages/safeurl
262-
[github-build]: https://github.com/slab/safeurl-elixir/actions/workflows/ci.yml
263-
[github-license]: https://github.com/slab/safeurl-elixir/blob/master/LICENSE
264-
[github-fork]: https://github.com/slab/safeurl-elixir/fork
265-
[slab]: https://slab.com/
266-
[includesecurity]: https://github.com/IncludeSecurity
267-
[readme-http]: #http-clients
268-
269-
[docs]: https://hexdocs.pm/safeurl
270-
[docs-get]: https://hexdocs.pm/safeurl/SafeURL.html#get/4
271-
[docs-dns]: https://hexdocs.pm/safeurl/SafeURL.DNSResolver.html
272-
273-
[lib-dns]: https://github.com/tungd/elixir-dns
274-
[lib-tesla]: https://github.com/elixir-tesla/tesla
275-
[lib-httpoison]: https://github.com/edgurgel/httpoison
221+
[badge-github]: https://github.com/slab/safeurl-elixir/actions/workflows/ci.yml/badge.svg
222+
[badge-version]: https://img.shields.io/hexpm/v/safeurl.svg
223+
[badge-license]: https://img.shields.io/hexpm/l/safeurl.svg
224+
[badge-downloads]: https://img.shields.io/hexpm/dt/safeurl.svg
225+
[hexpm]: https://hex.pm/packages/safeurl
226+
[github-build]: https://github.com/slab/safeurl-elixir/actions/workflows/ci.yml
227+
[github-license]: https://github.com/slab/safeurl-elixir/blob/main/LICENSE
228+
[github-fork]: https://github.com/slab/safeurl-elixir/fork
229+
[slab]: https://slab.com/
230+
[includesecurity]: https://github.com/IncludeSecurity
231+
[readme-http]: #http-clients
232+
[docs]: https://hexdocs.pm/safeurl
233+
[docs-get]: https://hexdocs.pm/safeurl/SafeURL.html#get/4
234+
[docs-dns]: https://hexdocs.pm/safeurl/SafeURL.DNSResolver.html
235+
[lib-dns]: https://github.com/tungd/elixir-dns
236+
[lib-tesla]: https://github.com/elixir-tesla/tesla
237+
[lib-httpoison]: https://github.com/edgurgel/httpoison

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ defmodule SafeURL.MixProject do
7474
defp package do
7575
[
7676
name: @app,
77-
maintainers: ["Sheharyar Naseer", "Include Security", "Jason Chen"],
78-
licenses: ["MIT"],
77+
maintainers: ["Slab"],
78+
licenses: ["BSD-3-Clause"],
7979
files: ~w(mix.exs lib README.md),
8080
links: %{
8181
"Github" => @github,

0 commit comments

Comments
 (0)