Giter Site home page Giter Site logo

The right way to config about secure-headers HOT 8 CLOSED

bepsvpt avatar bepsvpt commented on May 21, 2024
The right way to config

from secure-headers.

Comments (8)

bepsvpt avatar bepsvpt commented on May 21, 2024

Hi @Masoud180 ,

I added
\Bepsvpt\SecureHeaders\SecureHeadersMiddleware::class,
to $middlewarePriority in Kernel.php
Is that right?

You need to add it to $middleware in app/Http/Kernel.php file. $middlewarePriority is used to specific the order when middlewares are assigned to the route.

And what should I write in secure-headers.php?

Use HTTP Strict Transport Security for example, if you want to enable HTTP Strict Transport Security, you can change enable value from false to true at here.

Each section has reference link in comment block(example), you can check that link for further information. Some headers will broke the page when they are configured incorrectly. Thus, I will sugguest you check out the reference link before setting it up.

And how can I be sure that I configured it in the right way?

You can use php artisan serve to start PHP development server and open browser developer tools to check whether the response header is configured correctly or not.

from secure-headers.

Masoud180 avatar Masoud180 commented on May 21, 2024

Thank you so much.

from secure-headers.

bepsvpt avatar bepsvpt commented on May 21, 2024

If you have any other questions, feel free to comment on this issue.

from secure-headers.

Masoud180 avatar Masoud180 commented on May 21, 2024

Thanks
While I was checking that, I came up with a question.
In secure-headers.php, server parameter is null ('') but I can see my real server details in http header and it doesn't change it.
And also x-xss-protection doesn't exist on header response!
What should I do to apply them?

from secure-headers.

bepsvpt avatar bepsvpt commented on May 21, 2024

In secure-headers.php, server parameter is null ('') but I can see my real server details in http header and it doesn't change it.

When server is empty string, it will not add to response header(#1). If you want to change this header, you should assign a value to it.

And also x-xss-protection doesn't exist on header response!

Could you provide more information about this problem?

from secure-headers.

Masoud180 avatar Masoud180 commented on May 21, 2024

Thanks
x-xss-protection is fixed. but server is still displaying real details.
I set this to another string but still not working.
2019-05-16 14_19_39-ورود به پنل کاربری
2019-05-16 14_20_50-secure-headers php - cPanel File Manager v3

from secure-headers.

bepsvpt avatar bepsvpt commented on May 21, 2024

Not all web server services support setting server header. This header only tested on Laravel Homestead and Nginx. Sorry for not mention this on config file comment.

from secure-headers.

Masoud180 avatar Masoud180 commented on May 21, 2024

Thank you so much.

from secure-headers.

Related Issues (20)

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.