https://github.com/tomsanbear/xpf
A CoreDNS Plugin for Adding the X-Proxied-For record to a request question.
https://github.com/tomsanbear/xpf
coredns coredns-plugin dns proxy
Last synced: 2 months ago
JSON representation
A CoreDNS Plugin for Adding the X-Proxied-For record to a request question.
- Host: GitHub
- URL: https://github.com/tomsanbear/xpf
- Owner: tomsanbear
- License: mit
- Created: 2019-05-09T19:53:43.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-07T01:24:53.000Z (about 3 years ago)
- Last Synced: 2024-06-20T02:02:23.117Z (11 months ago)
- Topics: coredns, coredns-plugin, dns, proxy
- Language: Go
- Size: 7.13 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/tomsanbear/xpf) [](https://codecov.io/gh/tomsanbear/xpf) [](https://badge.fury.io/gh/tomsanbear%2Fxpf)   [](https://goreportcard.com/report/github.com/tomsanbear/xpf)
# CoreDNS XPF
This coredns plugin appends an XPF record to the DNS request, containing the Source & Destination Address & Port. This aims to allow you to use CoreDNS as a DNS proxy, while still passing client information through for audit/analysis purposes.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
- Go 1.12 or later
- Go modules should be enabled### Installing
1. First clone the CoreDNS repository [CoreDNS](https://github.com/coredns/coredns)
2. Add ```xpf:github.com/tomsanbear/xpf``` to the plugins.cfg file within the repo (IMPORTANT NOTE: this must appear before any other resolving plugin you may be using. See below for more details)
3. Build the binary with 'make', or if you are building on OSX and want to target a linux docker container 'GOOS=linux make'Plugin Note:
Due to the way the server chains plugins, you need to ensure that any plugin that comes after this one, in the plugin.cfg, does not care about the record being there. See the plugins.cfg file comments for more detail.### Corefile Configuration
Example usage within a Corefile:
```
.:53 {
xpf {
rr_type 65422
}
forward . 8.8.8.8
}
```Note: Do consider the security risks of forwarding this record to the upstream server. You (should) only be doing this for internal resolvers
### Known (Strange) Behaviour
Currently, there is missing functionality on getting the Local IP Address for the CoreDNS server, if the user bound 0.0.0.0 (or ::), aka using the most common config. There is no convenient solution for this yet, and there are some different approaches to this. Check out [this issue](https://github.com/tomsanbear/xpf/issues/7) for more details.
## Running the tests
Test coverage is still a little lacking, but I'm looking to get the full thing tested, with performance metrics as well in the future.
Just run ```go test ./...``` for the main suite, and
### Code Style Tests
Enforcing style with the golangci-lint tool
## Contributing
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/tomsanbear/xpf/tags).
## Authors
* **Thomas Santerre** - *Initial work* - [tomsanbear](https://github.com/tomsanbear)
See also the list of [contributors](https://github.com/tomsanbear/xpf/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
## Acknowledgments
* [CoreDNS](https://github.com/coredns/coredns) for being a great DNS server/project
* [Ray Bellis](https://github.com/raybellis) for the initial draft on [DNS XPF](https://www.ietf.org/archive/id/draft-bellis-dnsop-xpf-04.txt)
* [PurpleBooth](https://github.com/PurpleBooth) for the nice Readme template