Giter Club home page Giter Club logo

chg.extensions.security.txt's People

Contributors

awaescher avatar dependabot-support avatar jackgilmore avatar twenzel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chg.extensions.security.txt's Issues

Implementing redirects

Is your feature request related to a problem? Please describe.
The RFC for security.txt supports redirects e.g. from app.example.com/.well-known/security.txt to example.com/.well-known/security.txt or from another-example.com//.well-known/security.txt to example.com/.well-known/security.txt

Describe the solution you'd like
Would you support a new feature to allow this? Possible implementations I was thinking of include:

Service registration that passes in a Uri to redirect to

builder.Services.AddSecurityText(new Uri("https://example.com/.well-known/security.txt"));

OR using the existing TextBuilder approach

builder.Services.AddSecurityText(textBuilder =>
{
	textBuilder
		.SetRedirect(new Uri("https://example.com/.well-known/security.txt"))
});

Describe alternatives you've considered
None

Additional context
I'm happy to work on this and submit a pull request if you agree to the feature's implementation.

Continuos Integration Tool

Does this project use any Continuous Integration Tool? If so, is it online? (TravisCI, CircleCI), or offline tool (Jenkins, Hudson).

Improve EOL handling for output security.txt information

Hi,

The CreateComment method in the SecurityTextContainer uses ~~ as intermediate string for normalizing line endings in input data. This may lead to problems when the comment itself contains these characters. A better solution could be to replace those combinations with e.g. \n to avoid intermediate string placeholders that could be used in a regular comment.

Additionally the new line characters \r\n, \r and \n are replaced with Environment.NewLine which leads to different output depending on which plattform it is hosted. Maybe we should specify which line ending should be used more explicitly so the behaviour will be the same regardless of the plattform that hosts the middleware. Is it a candidate for options/settings?

InvalidSecurityInformationException: 'The "Contact: " directive MUST always be present in a security.txt file.'

Describe the bug
app.UseSecurityText()
throws exception, when loading from a text file, even when file does contain the Contact: directive.

Expected Behavior

Shouldn't throw exception

Actual Behavior

Exception thrown: 'CHG.Extensions.Security.Txt.InvalidSecurityInformationException' in CHG.Extensions.Security.Txt.dll
An exception of type 'CHG.Extensions.Security.Txt.InvalidSecurityInformationException' occurred in CHG.Extensions.Security.Txt.dll but was not handled in user code
The "Contact: " directive MUST always be present in a security.txt file.

Steps to Reproduce the Problem

  1. Create security.txt file on root in MVC Core 2.1
  2. Add content security.txt of following with a newline at EOF:
    Contact: mailto:[email protected]
  3. add following to ConfigureServices in Startup.cs
    services.AddSecurityText(builder =>
    builder.ReadFromFile("./security.txt")
    );

  1. add following to Configure in Startup.cs before app.UseMvc call:
    app.UseSecurityText()
  2. Build project and run. Exception is thrown.

Specifications

  • Version: 0.1.1
  • Platform: Windows 10, Core MVC 2.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.