Secure is an HTTP middleware for Go that facilitates some quick security wins. It's a standard net/http Handler, and can be used with many frameworks or directly with Go's net/http package. Be sure to include the Secure middleware as close to the top (beginning) as possible (but after logging and recovery). It's best to do the allowed hosts and SSL check before anything else. When IsDevelopment is true, the AllowedHosts, SSLRedirect, STS header, and HPKP header will not be in effect. This allows you to work in development/test mode and not have any annoying redirects to HTTPS (ie. development can happen on HTTP), or block localhost has a bad host. Secure comes with a variety of configuration options. Secure allows you to set a custom function for the AllowRequestFunc option. You can use this function as a custom filter to allow the request to continue or simply reject it.

Features

  • Facilitates some quick security wins
  • It's a standard net/http Handler
  • Can be used with many frameworks or directly with Go's net/http package
  • Secure comes with a variety of configuration options
  • Set the IsDevelopment option to true when developing
  • Allow Request Function
  • Redirect HTTP to HTTPS

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Secure

Secure Web Site

You Might Also Like
Achieve perfect load balancing with a flexible Open Source Load Balancer Icon
Achieve perfect load balancing with a flexible Open Source Load Balancer

Take advantage of Open Source Load Balancer to elevate your business security and IT infrastructure with a custom ADC Solution.

Boost application security and continuity with SKUDONET ADC, our Open Source Load Balancer, that maximizes IT infrastructure flexibility. Additionally, save up to $470 K per incident with AI and SKUDONET solutions, further enhancing your organization’s risk management and cost-efficiency strategies.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Secure!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Registered

2023-01-24