View the Index
Total Page:16
File Type:pdf, Size:1020Kb
INDEX Page numbers followed by an italicized Airbrake, 44 f or t refer to figures and tables Akamai, 26, 62, 138 respectively. Amazon denial-of-service attacks, 163 one-click purchases, 76 Amazon CloudFront, 26 Symbols and Numbers Amazon Elastic Compute Cloud : (colon character), 82 (EC2), 41 / (path separator character), 109 Amazon Machine Images (AMIs), 62 ; (semicolon character), 52 Amazon Simple Storage Service (S3), ' (single quote character), 51–53 62, 140 10 Minute Mail, 86 Amazon Web Services (AWS), 105, 401 status code (in HTTP), 82 137, 168 Elastic Beanstalk, 41 A Marketplace, 62 AMIs (Amazon Machine Images), 62 Accept header, 10–11 amplified attacks, 165 access control, 25, 166 Angular framework, 33–34, 72 aspects of, 104 Ansible, 42 audit trails, 107–108 anti-CSRF cookies, 77–78 common oversights, 108 antivirus software defined, 104 mitigating file upload vulnerability implementing, 106–107 attacks, 63 models for protection against botnets, 160 access control lists, 105 Apache web servers, 53, 114, 125 ownership-based access disabling open directory control, 106 listings, 137 role-based access control, disabling URL rewriting, 100 105–106 injection attacks, 132 whitelists and blacklists, 105 application firewalls, 166 testing, 107 application layer attacks, 165 access control lists (ACLs), 105 application programming interface access tokens, 139 (API) keys, 139 Acid3 test, 18, 18f application servers, 125–126 Active Directory, 137 ARPANET (Advanced Research ActiveRecord framework, 54–55 Projects Agency Network), 7 ActiveX, xxi asymmetric encryption algorithms, 119 administrative frontends, securing, 138 audit trails, 107–108 ad platforms, 142 authentication Advanced Encryption Standard (AES), brute-force attacks, 83–84 121, 138 databases and, 29 Advanced Research Projects Agency defined, 81 Network (ARPANET), 7 authentication (continued) C implementing C# basic authentication build process, 42 scheme, 82 overview of, 33 digest authentication vulnerabilities, 33 scheme, 82 C++, 33 HTTP-native authentication, Cache-Control header, 13 82–83, 83f canonical name (CNAME) records, 9 non-native authentication, 83 CAPTCHA (Completely Automated mitigation options Public Turing test to tell secure authentication system, Computers and Humans 85–92 Apart), 91–92, 92f, 158 single sign-on, 84–85 Cascading Style Sheets (CSS) third-party authentication, 84 build process, 43 authenticator apps, 90, 90f in HTTP responses, 13 Authorization header, 82 pre-processors, 43 AVG, 132 selectors, 17 AWS. See Amazon Web Services (AWS) stylesheets, 17 styling rules, 17 B use in clickjacking attacks, 158 Bachus-Naur Form (BNF), 147 CDNs. See content delivery Base64 algorithm, 82 networks (CDNs) bcrypt algorithm, 88–89 Center for Internet Security (CIS), 62 Berners-Lee, Tim, xx–xxi, 24 centralized version control systems, 37 bind parameters Centrify, 84 object-relational mapping, 54 CEO fraud, 154 parameterized statements, 52–53 CERN (European Organization for Bitly, 156 Nuclear Research), xx–xxi black hat hackers, 2 certificate authorities, 117, 122–125 blacklists, 105 certificate signing requests (CSRs), blind SQL injection attacks, 56 123–124 block ciphers, 119–120 CGI (Common Gateway Interface), xxii BNF (Bachus-Naur Form), 147 checksums, 8, 40, 134 botnets, xxii, 154, 160, 165 Chef, 42 branching code, 38 chroot command, 58 brittleness, 39 CIS (Center for Internet Security), 62 browsers Cisco, 128 cookies, 20 cleartext storage, 88 Document Object Model, 16–17 click fraud, 160 Domain Name System, 20 clickjacking, 154, 158–159 HTTP Secure, 20 client-server architecture, 49 JavaScript, 16, 18–19 client-side error reporting, 115 security certificates, 20 client-side sessions, 96–97 styling rules, 16–18 Clojure, 32 web page rendering pipeline, 15–19 cloud-based storage brute-force attacks, 100 hosting services, 110–111 bug trackers (issue-tracking subdomain takeovers, 140 software), 36 use in mitigating file upload building for scale, 167, 173 vulnerability attacks, 62 bundler-audit tool, 136 Cloudflare, 26, 62 CLR (Common Language Runtime), 33 174 Index CMSs. See content management Cookie header, 13, 77–78, 97 systems (CMSs) cookies, 171 CNAME (canonical name) records, 9 anti-CSRF cookies, 77–78 code reviews, 38, 170 defined, 13 code writing phase (in the software digital signing of, 96–97 development lifecycle) generic cookie parameters, 114 branching and merging code, 38 implementing and securing a pushing changes to repository, 37 logout function, 90–91 source control (version control), 37 SameSite cookie attribute, 78–79 CoffeeScript, 34, 42 session cookies, 95–97, 114 colon character (:), 82 session hijacking, 97–99 Comcast, 128 vulnerabilities of, 13 command injection attacks cookie theft anatomy of, 56–57, 57f cross-site request forgery (CSRF) defined, 56 attacks, 98–99 escaping control characters, 57–58 cross-site scripting (XSS) attacks, file upload vulnerability and, 61 97–98 Common Gateway Interface (CGI), xxii man-in-the-middle attacks, 98 Common Language Runtime (CLR), 33 cracking password lists, 89 Comodo, 122 CREATE statements (in SQL), 55 Completely Automated Public Turing cross-site request forgery (CSRF; test to tell Computers and XSRF) attacks Humans Apart (CAPTCHA), anatomy of, 76 91–92, 92f, 158 cookie theft, 98–99 CONNECT requests (in TCP), 11t defined, 75 consistent behavior mitigation options eventual consistency of NoSQL anti-CSRF cookies, 77–78 databases, 30 requiring reauthentication for SQL databases, 29 sensitive actions, 78–79 containerization, 42 REST principles, 76–77 content delivery networks (CDNs), 26 SameSite cookie attribute, distributed denial-of-service protect 78–79 systems, 167 cross-site scripting (XSS) attacks, mitigating file upload vulnerability xxi, 19 attacks, 62, 170 cookie theft, 97–98 subdomain takeovers, 140 defined, 65 content management systems (CMSs) DOM-based defined, 26 defined, 71 mitigating file upload vulnerability escaping dynamic content, 73 attacks, 62, 170 URI fragments, 71–73 plug-ins, 26 reflected, 70–71 vulnerabilities of, 26, 27f defined, 70 content security policies, 69–70, escaping dynamic content, 71 110–111 stored Content-Security-Policy header, 69, content security policies, 69–70 158–159, 172 escaping control characters, Content-Type header, 13, 59, 63 67–69 continuous integration servers, 39 example of, 66–67, 66f–67f control characters cryptographic hash algorithms and in PHP, 56–58 functions, 88–89, 119 in SQL, 51–53, 55 cryptography, 117 Index 175 CSRF attacks. See cross-site request reflected and amplified forgery (CSRF) attacks attacks, 165 CSRs (certificate signing requests), Transmission Control Protocol 123–124 (TCP) attacks, 164 CSS. See Cascading Style Sheets (CSS) unintentional denial-of-service attacks, 166 D dependencies, 171 build process, 42 database administrators (DBAs), 43 defined, 45 database drivers, 51 deploying new versions quickly, 134 database migration scripts, 43 organizing dependencies databases dependency management tools, authentication and, 29 132–133 for building dynamic web pages, operating system patches, 28–30 133–134 NoSQL, 30 subresource integrity checks, 134 origin of, 28 security advisories SQL, 29–30, 105 blogs, 135 stored cross-site scripting attacks, 66 mailing lists, 135 data definition language (DDL), 55 official advisories, 135 data integrity, 29, 118 social media, 135 data manipulation language (DML), 55 software tools, 136 data packets, 8 timely upgrades, 136 DBAs (database administrators), 43 vulnerability of, 45 DDL (data definition language), 55 dependency-check tool, 136 DDoS (distributed denial-of-service) dependency management, 45, 132–133 attacks, 165, 167 dependency trees, 133 decryption keys, 118–119 deserialization dedicated configuration stores, 137 defined, 59 default credentials, disabling, 137 disabling code-execution during, defense in depth approach, 61 59–60 blind and nonblind SQL injection, design and analysis phase, 36 55–56 DevOps (developer operations) tools, defined, 55 41–42 principle of least privilege, 55 DigiCert, 122 defer attribute, 19 digital certificates (public-key DELETE requests (in SQL), 11, 76–77 certificates) DELETE statements (in SQL), 50–51, 55 certificate authorities, 122–123 denial-of-service (DoS) attacks defined, 122 defined, 163–164 installing mitigation options configuring web server to use building for scale, 167–168 HTTPS, 126 firewalls, 166 HTTP Strict Transport Security intrusion prevention systems, 166 policies, 127 protection services, 167 redirecting HTTP traffic to types of HTTPS, 126–127 application layer attacks, 165 web servers vs. application distributed denial-of-service servers, 125–126 attacks, 165 obtaining Internet Control Message certificate signing requests, Protocol (ICMP) attacks, 164 123–124 domain verification, 124 176 Index expiring certificates, 124 DomainKeys Identified Mail (DKIM), extended validation 155–156, 172 certificates, 124 domain name servers, 9 key pairs, 123–124 Domain Name System (DNS) paying for certificates, 125 caching behavior, 9 revoking certificates, 124 canonical name records, 9 self-signed certificates, 124–125 DNS poisoning, 9 TLS handshakes, 121 domain verification, 124 digital signatures, 96–97 encryption, 122–123 directories, 109 Internet Protocol suite layers, 10f directory traversal attacks, xxii, mail exchange records, 9 108–112 purpose of, 9 anatomy of, 109–110, 109f–110f registration of, 9 defined, 108 rendering pipeline, 20 filepaths and relative filepaths, subdomain takeovers, 140 108–109 validating email addresses, 86