Bitzu

CPSA ยท Web servers, architecture and protocols

HTTPS, SOAP and security-related headers

TLS use, SOAP basics, cookies flags, HSTS, CSP, X-Frame-Options and similar headers.

Key points

  • HTTPS is HTTP over TLS.
  • HSTS (Strict-Transport-Security): HTTPS only for max-age seconds; works only over HTTPS.
  • Set-Cookie: Secure (HTTPS only), HttpOnly (hidden from JavaScript), SameSite (limits cross-site sending).
  • Content-Security-Policy: script and resource sources; frame-ancestors (older X-Frame-Options) limits clickjacking.
  • SOAP: XML Envelope, optional Header, mandatory Body, Fault for errors; usually HTTP POST.

Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security

Practice questions

Single choice

Which Set-Cookie attribute prevents JavaScript from reading a cookie through document.cookie?

  1. Secure
  2. HttpOnly
  3. SameSite
  4. Path
Show answer

Answer: B. HttpOnly

HttpOnly hides the cookie from scripts, limiting theft via XSS. Secure restricts transport to HTTPS, and SameSite limits cross-site sending.

Select all that apply

Which statements about HSTS are correct?

  1. max-age is given in seconds
  2. Browsers ignore the header when it arrives over plain HTTP
  3. It is an attribute of Set-Cookie
  4. includeSubDomains limits the policy to the apex domain only
  5. It makes the server encrypt database columns
Show answer

Answer: A. max-age is given in seconds, B. Browsers ignore the header when it arrives over plain HTTP

max-age is in seconds and the header is ignored over plain HTTP so a man in the middle cannot set or clear it. It is not a cookie attribute, and includeSubDomains widens, not narrows, scope.

True or false

True or false: a SOAP message always needs a Header element.

Show answer

Answer: False

False. In SOAP 1.2 the Envelope holds an optional Header and a mandatory Body.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More CPSA topics in this module