ebook img

Web Security. Learning HTTP Security Headers PDF

71 Pages·2023·1.155 MB·English
by  L. Tal
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Web Security. Learning HTTP Security Headers

Web Security: Learning HTTP Security Headers Liran Tal Thisbookisforsaleat http://leanpub.com/web-security-learning-http-security-headers Thisversionwaspublishedon2023-01-17 ThisisaLeanpubbook.Leanpubempowersauthorsand publisherswiththeLeanPublishingprocess.LeanPublishingis theactofpublishinganin-progressebookusinglightweighttools andmanyiterationstogetreaderfeedback,pivotuntilyouhave therightbookandbuildtractiononceyoudo. ©2023LiranTal Contents AboutTheAuthor . . . . . . . . . . . . . . . . . . . . . . . . 1 LiranTal . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 AboutTheBook . . . . . . . . . . . . . . . . . . . . . . . . . 3 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 3 SourceCode . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 5 Headersasbrowsersecuritycontrols . . . . . . . . . . . . 6 Helmet-aNode.jspackagetosetHTTPsecurityheaders 8 HTTPSecurityHeaders . . . . . . . . . . . . . . . . . . . . . 12 HTTPStrictTransportSecurity . . . . . . . . . . . . . . . 12 XFrameOptions . . . . . . . . . . . . . . . . . . . . . . . 21 ContentSecurityPolicy. . . . . . . . . . . . . . . . . . . . 28 RefererandReferrerPolicy . . . . . . . . . . . . . . . . . 36 Deprecatedsecurityheaders . . . . . . . . . . . . . . . . . 40 TestingforSecurityHeaders . . . . . . . . . . . . . . . . . . 43 TheStateofHTTPSecurity . . . . . . . . . . . . . . . . . 43 WebPageTest . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Lighthouse . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 CheckMyHeaderscommandlineapplication . . . . . . . 56 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 CONTENTS What’snext? . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 EstablishaCSPandSecurityHeadersstandard . . . . . . 60 Monitoryourwebapplication . . . . . . . . . . . . . . . . 62 Otherbrowsersecurityheadersandcontrols . . . . . . . 63 Referrer-Policy. . . . . . . . . . . . . . . . . . . . . . . . . 64 Educationalresources . . . . . . . . . . . . . . . . . . . . . 65 Securityheaderstooling . . . . . . . . . . . . . . . . . . . 66 About The Author Liran Tal Liran Tal is a software developer, and a GitHub Star, world- recognized for his activism in open source communities and ad- vancingwebandNode.jssecurity.Heengagesinsecurityresearch throughhisworkintheOpenJSFoundationandtheNode.jsecosys- tem security working group, and further promotes open source supply chain security as an OWASP project lead. Liran is also a published author of Essential Node.js Security and O’Reilly’s ServerlessSecurity.AtSnyk,heisleadingthedeveloperadvocacy teamandonamissiontoempowerdeveloperswithbetterdev-first security. AtSnyk*,heleadstheDeveloperAdvocacyteamwhereheengages developersaboutopensourcesecurityinvariousways,fromengi- neering tools, to education and awareness. Liran also co-authored O’Reilly’s Serverless Security† with Guy Podjarny, Snyk’s co- founder,presidentandlong-timesecurityprofessional. Liranisaseasonedinternationalspeakerandgreatlyenjoysbuild- ingandengagingcommunities.HeisanambassadorforRomania’s JSHeroes‡,andtheDevSecCon§community,amongothers. Previously,LiranheldrolesasanEngineeringManagerforHewlett PackardEnterpriseandNielsenMarketingCloud,whereheplayed akeytechnicalroleinsystemarchitectureandshapedthetechnol- ogystrategyinstacksincludingAngular,React,andNode.js. *https://snyk.io †https://www.oreilly.com/library/view/serverless-security/9781492082538/ ‡https://jsheroes.io §https://www.devseccon.com/ AboutTheAuthor 2 Liran graduated cum laude in his Bachelor of Business and Infor- mationSystemsAnalysisstudiesandenjoysspendinghistimewith hisbelovedwifeTal,andhismagicalsonOri.Amongstotherthings, hishobbiesincludeplayingtheguitar,hackingallthingsLinux,and continuously experimenting and contributing to open source, and webdevelopmentprojects. YoucanfollowandengagewithLiranathttps://twitter.com/liran_- tal About The Book This book is a follow-up on Liran Tal’s Essential Node.js Security for Express web applications* and teaches you hands-on practical useofHTTPsecurityheadersasbrowsersecuritycontrolstohelp securewebapplications. For each HTTP security header that can enhance your web appli- cation security, you’ll learn what is the overall risk of not imple- menting it, and what does a proposed solution help with. Finally, you’ll learn how to implement and configure the security header with Helmet, a popular and well-maintained Node.js package on npm. Thisbookincludes18Lessons,8Quizzes,30CodeSnippets,and19 Illustrations to help you level up on your HTTP security headers skills,andincludes: • SecurewebapplicationsusingHTTPsecurityheaders • UnderstandContentSecurityPolicy • SetupNode.jswebapplicationssecurely • Learn how to test and monitor for security headers and vulnerableJavaScriptlibraries • Roadmapforfuturewebcontrols Requirements Thesourcecode,andexamplesthrough-outthisbookarebasedon the Long Term Support version of Node.js†, which at the current editionofthebookisNode.js14. *https://leanpub.com/essential-nodejs-security/ †https://nodejs.org/en/ AboutTheBook 4 Source Code All the source code examples, and many more variations of them can be found in their complete setup and form in the following GitHub repository inside the code/ directory https://github.com/ lirantal/learning-http-security-headers-book. Feedback and comments are highly appreciated and welcome. If you find any issues, improvements, or room for updates please open a GitHub issue, submit a pull request, or contact the author directly via email (liran.tal@gmail.com), or Twitter (https://twitter.com/liran_tal). Introduction Requirements IfyouhaveadevelopmentenvironmentsetwithNode.js,git,npm, andworkingInternetconnectivity,you’reallsettogetstarted! SomeexercisesrequireworkwithavalidHTTPS-enabledwebsite, forwhichwedefertoHerokuasthewebhostingplatformduetoits easeofuseandsupportingsimultaneouslybothHTTPandHTTPS webhosting. Web knowledge prerequisites It is expected that you have basic knowledge of HTTP, such as the meaning of HTTP headers, an HTTP request, and response, and general knowledge of how the web works in terms of the interactionsbetweenawebserverandawebclient(thebrowser). ItisalsoexpectedthatyouhaveChromeinstalled,butnotmanda- tory. This book refers to Chrome’s DevTools, and includes screen- shotsusingtheChromebrowser.Ifyouareusinganyotherbrowser and can make the parallels yourself, you should be fine moving forwardwiththebook. A JavaScript and Node.js development environment ThisbookusestheExpresswebapplicationframeworkforNode.js to create web applications and set headers using open source modulesfromthenpmecosystem.

See more

The list of books you might like

book image

Atomic Habits James Clear

JAMES CLEAR
·6.4 MB

book image

Better Than the Movies

Lynn Painter
·2021
·1.51 MB

book image

A Thousand Boy Kisses

Tillie Cole [Cole
·2016
·1.66 MB

book image

Mind Management, Not Time Management

David Kadavy
·2020
·0.58 MB

book image

Bea Mine (Sweet Nothings Bake Shop 01)

K. A. Gandy
·2021
·0.101 MB

book image

How to Survive a Plague

David France
·2016
·54.7033 MB

book image

By Aaron Grothe NEbraskaCERT

35 Pages
·2014
·0.12 MB

book image

TCPS 1262-2549: Jointed Paper Grass

Thai Industrial Standards Institute (TISI)
·2006
·0.46 MB

book image

DTIC ADP023953: Space Power for War Fighters

Defense Technical Information Center
·0.23 MB

book image

Tell Me Lies

Carola Lovering
·2018
·0.6329 MB

book image

DTIC ADA462454: Legacy Status as a Signal in College Admissions

Defense Technical Information Center
·0.83 MB

book image

Lake Steamy

R. Cayden
·2021
·0.2533 MB

book image

Greek Government Gazette: Part 2, 1993 no. 519

The Government of the Hellenic Republic
·16 Pages
·1993
·1.7 MB

book image

Bethlehem by Laurence Housman

28 Pages
·2021
·0.12 MB

book image

Calgary Aquinas Studies

Anthony Parel
·183 Pages
·1978
·9.1 MB