Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cyber Security Cards › Revision Cards

Configuration and Shared Code

Configuration and Shared Code bootstrap.php is code that every page loads first. Starts a safe session. Opens the database with prepared statements and TLS. Creates the S3 client using the IAM role. Helpers: e() for safe HTML output, CSRF tokens, require_login() . The S3 client has no keys in code .

Configuration and Shared Code bootstrap.php is code that every page loads first. Starts a safe session. Opens the database with prepared statements and TLS. Creates the S3 client using the IAM role. Helpers: e() for safe HTML output, CSRF tokens, require_login() . The S3 client has no keys in code .
Configuration and Shared Code · Download PNG
Read card text

What this card says

What it is

bootstrap.php is code that every page loads first.

What it does

Starts a safe session. Opens the database with prepared statements and TLS. Creates the S3 client using the IAM role.

Helpers: e() for safe HTML output, CSRF tokens, require_login().

Why it matters for security

The S3 client has no keys in code. The AWS SDK finds the IAM role by itself.

HelperProtects against
e() = htmlspecialcharsStored/reflected XSS in HTML pages
csrf_token() / csrf_check() with hash_equalsCSRF – other sites submitting forms as your user
PDO::ATTR_EMULATE_PREPARES => falseSQL injection (true server-side prepared statements)
session_set_cookie_params (HttpOnly, Secure, SameSite)Cookie theft by JavaScript, cookies over HTTP, cross-site…
S3Client without keysLeaked access keys – there are none to leak

Learn more in the lesson: 16.5 Configuration and Shared Code

See all Ravi Sir's Cyber Security Cards