Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Prevent search engines from indexing dev applications#30325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromGaryPEGEOT:feature/noindex-listener
Mar 4, 2019
Merged

[HttpKernel] Prevent search engines from indexing dev applications#30325

fabpot merged 1 commit intosymfony:masterfromGaryPEGEOT:feature/noindex-listener
Mar 4, 2019

Conversation

@GaryPEGEOT
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#30318
LicenseMIT
Doc PRTODO

Add theX-Robots-Tag: noindex to dev (and test) applications to prevent search engines to index them.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice idea.

@nicolas-grekasnicolas-grekas added this to thenext milestoneFeb 21, 2019
@fabpot
Copy link
Member

@GaryPEGEOT Please, don't change code that your PR does not change (even if fabbot ask for it).

@GaryPEGEOT
Copy link
ContributorAuthor

@javiereguiluz where should I document the new option?

@fabpot
Copy link
Member

Thank you@GaryPEGEOT.

@fabpotfabpot merged commit3dd8671 intosymfony:masterMar 4, 2019
fabpot added a commit that referenced this pull requestMar 4, 2019
…applications (GaryPEGEOT)This PR was squashed before being merged into the 4.3-dev branch (closes#30325).Discussion----------[HttpKernel] Prevent search engines from indexing dev applications| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#30318| License       | MIT| Doc PR        | TODOAdd the *X-Robots-Tag: noindex* to dev (and test) applications to prevent search engines to index them.Commits-------3dd8671 [HttpKernel] Prevent search engines from indexing dev applications
@javiereguiluz
Copy link
Member

@GaryPEGEOT sorry I didn't reply to your comment. This feature is being documented insymfony/symfony-docs#11148. Thanks.

ScullWM reacted with thumbs up emoji

@dunglas
Copy link
Member

dunglas commentedMar 13, 2019
edited
Loading

Sorry I'm late on this one, but this feature could have been a bit more generic: the config could allow to set headers that will always be sent, includingX-Robot-Tag, but also Content Security Policies, HSTS, HPKP settings, theReferrer header, CORS settings...

I can work on a PR.

ro0NL and xaro93 reacted with heart emoji

@javiereguiluz
Copy link
Member

@dunglas can you please show an example of the HTTP header/s added to the response with your proposal and a sample of the YAML config used to do that? Thanks.

@ro0NL
Copy link
Contributor

on the other side, having rich configuration with sane defaults, per case is nice. But agree this could be aggregated into a single default header listener 👍

@dunglas
Copy link
Member

dunglas commentedMar 13, 2019
edited
Loading

@javiereguiluz:

framework:default_headers:Content-Security-Policy:"script-src 'self' www.google-analytics.com ajax.googleapis.com"Referrer-Policy:same-originStrict-Transport-Security:"max-age=31536000; includeSubDomains; preload"X-Robot-Tag:noindexX-XSS-Protection:"1; mode=block"X-Frame-Options:SAMEORIGINX-Content-Type-Options:nosniff

We could even provide sane defaults. WDYT?

HeahDude and ostrolucky reacted with thumbs up emoji

@linaori
Copy link
Contributor

I like this idea@dunglas ! Perhaps it should be underframework.http.* though, because there are more http related settings such as session?

dunglas and HeahDude reacted with thumbs up emoji

@javiereguiluz
Copy link
Member

@dunglas are we completely sure that 100% of existing apps are going to keep working if we apply those headers by default? Thanks.

@dunglas
Copy link
Member

@javiereguiluz no! By default I mean "in the config generated by the recipe".

@linaori
Copy link
Contributor

Please don't call other people "idiots".

jvasseur, TimoBakx, javiereguiluz, michellesanver, lsmith77, sstok, and xaro93 reacted with thumbs up emoji

@stof
Copy link
Member

For all these security headers, I think usinghttps://github.com/nelmio/NelmioSecurityBundle/ is better. Most of them require more configuration than just knowing whether we are in debug mode or no.

And thisdefault_headers proposal would still have to be separate from the current feature, as addingX-Robot-Tags through it only in debug mode would be much more complex.

sstok reacted with heart emoji

@javiereguiluz
Copy link
Member

@HTMLGuyLLC I agree with@linaori's comment and I ask you to please not call other people "idiots".

About your original comment, I'm afraid that those people who"run Symfony in dev because they cannot make it work in prod" will need to try again to put things in prod and report here any problem that they find in Symfony itself. Thanks!

lsmith77 and TimoBakx reacted with thumbs up emoji

@ostrolucky
Copy link
Contributor

ostrolucky commentedMar 13, 2019
edited
Loading

Even if we don't go with an idea of having config for these like@dunglas suggested, at least listener class itself could be made in more generic way, so userland can write compiler pass with own rules. Having such single purpose listener which is completely inflexible seems such a waste to me. Changing it so headers can be injected should be trivial.

edit: on second thought, problem with this might be be that it needs to be re-registered in prod :/

@ro0NL
Copy link
Contributor

one can still provide default headers per environment config, given this node merges each. A sub config might want to clear an inherited header usingX-Name: false

For all these security headers, I think usinghttps://github.com/nelmio/NelmioSecurityBundle/ is better.

Agree, but for the simple case this config spares out some boilerplate code.

The flip side is we get more feature requests eventually; like expression support; better security defaults. I think that's reasonable, but so is a code solution or an external bundle.

Sticking with "config per case" avoids that decision path.

dunglas reacted with thumbs up emoji

javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMar 14, 2019
…eguiluz)This PR was merged into the master branch.Discussion----------Document the disallow_search_engine_index optionThis documentssymfony/symfony#30325.Commits-------a94b920 Document the disallow_search_engine_index option
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@fabpotfabpotfabpot approved these changes

+3 more reviewers

@ro0NLro0NLro0NL left review comments

@linaorilinaorilinaori left review comments

@xaro93xaro93xaro93 left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

11 participants

@GaryPEGEOT@fabpot@javiereguiluz@dunglas@ro0NL@linaori@stof@ostrolucky@nicolas-grekas@xaro93@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp