Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/pomerium: wrap global mux with standard middleware #117

Merged
merged 1 commit into from May 14, 2019

Conversation

desimone
Copy link
Contributor

@desimone desimone commented May 14, 2019

These changes abstract the shared middleware to the global serve mux. Headers, request id, loggers, and health checks (ping) middleware are now applied on all routes including 4xx and 5xx responses.

See

Checklist:

  • unit tests added
  • related issues referenced
  • ready for review

/cc @yegle

@desimone desimone changed the title cmd/pomerium: move shared middleware for to global mux cmd/pomerium: wrap global mux with standard middleware May 14, 2019
@desimone desimone changed the title cmd/pomerium: wrap global mux with standard middleware cmd/pomerium: move shared middleware for to global mux [WIP] May 14, 2019
@desimone desimone changed the title cmd/pomerium: move shared middleware for to global mux [WIP] cmd/pomerium: wrap global mux with standard middleware [WIP] May 14, 2019
@codecov
Copy link

codecov bot commented May 14, 2019

Codecov Report

Merging #117 into master will increase coverage by 0.8%.
The diff coverage is 87.23%.

@@            Coverage Diff            @@
##           master     #117     +/-   ##
=========================================
+ Coverage   81.35%   82.16%   +0.8%     
=========================================
  Files          32       32             
  Lines        1888     1861     -27     
=========================================
- Hits         1536     1529      -7     
+ Misses        280      262     -18     
+ Partials       72       70      -2

@desimone desimone force-pushed the feature/add-global-middleware branch from b5129dd to 6016a94 Compare May 14, 2019 18:54
@desimone desimone changed the title cmd/pomerium: wrap global mux with standard middleware [WIP] cmd/pomerium: wrap global mux with standard middleware May 14, 2019
@desimone desimone force-pushed the feature/add-global-middleware branch from 6016a94 to f357397 Compare May 14, 2019 19:14
@desimone desimone merged commit cfac5f1 into pomerium:master May 14, 2019
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"Content-Security-Policy": "default-src 'none'; style-src 'self' 'sha256-pSTVzZsFAqd2U3QYu+BoBDtuJWaPM/+qMy/dBRrhb5Y='; img-src 'self';",
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this Content-Security-Policy header is breaking loading javascripts:

Refused to load the script '<URL>' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.

XXX.apkay.com/:83 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'sha256-pSTVzZsFAqd2U3QYu+BoBDtuJWaPM/+qMy/dBRrhb5Y='". Either the 'unsafe-inline' keyword, a hash ('sha256-wycEadbqyap1lzI8fe5whjcPll4StPOU2pDRk+cjffU='), or a nonce ('nonce-...') is required to enable inline execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @yegle . The CSP/Referrer-Policy should only apply to authenticate service's http handlers. Good catch. Fix incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants