CSRF stands for Cross-Site Request Forgery. It is a type of attack where unauthorized commands are transmitted from a user that the web application trusts.
Click to reveal answer
beginner
How does Jenkins protect against CSRF attacks by default?
Jenkins uses a CSRF protection mechanism called a 'crumb'. It generates a unique token (crumb) for each user session that must be included in POST requests to verify the request is legitimate.
Click to reveal answer
intermediate
What is a Jenkins crumb in the context of CSRF protection?
A Jenkins crumb is a unique token generated per user session. It must be sent with POST requests to Jenkins to prove the request is from a trusted source and not a CSRF attack.
Click to reveal answer
intermediate
How can you disable CSRF protection in Jenkins, and why is it not recommended?
You can disable CSRF protection in Jenkins by unchecking 'Prevent Cross Site Request Forgery exploits' in the Configure Global Security settings. It is not recommended because it exposes Jenkins to CSRF attacks, risking unauthorized actions.
Click to reveal answer
advanced
How do Jenkins API clients handle CSRF protection when making POST requests?
Jenkins API clients must first request a crumb from the Jenkins server and include it in the header of POST requests. This crumb proves the request is legitimate and prevents CSRF attacks.
Click to reveal answer
What is the purpose of the Jenkins crumb in CSRF protection?
ATo verify that POST requests come from a trusted user session
BTo encrypt Jenkins passwords
CTo speed up Jenkins builds
DTo store Jenkins job configurations
✗ Incorrect
The Jenkins crumb is a token used to verify that POST requests are from a trusted user session, preventing CSRF attacks.
Where do you configure CSRF protection settings in Jenkins?
AManage Jenkins > Credentials
BManage Jenkins > System Information
CManage Jenkins > Plugin Manager
DManage Jenkins > Configure Global Security
✗ Incorrect
CSRF protection settings are found under Manage Jenkins > Configure Global Security.
What happens if you disable CSRF protection in Jenkins?
AJenkins automatically updates plugins
BJenkins becomes vulnerable to unauthorized commands from attackers
CJenkins disables all POST requests
DJenkins runs faster
✗ Incorrect
Disabling CSRF protection makes Jenkins vulnerable to attacks where unauthorized commands can be sent by attackers.
How do Jenkins API clients obtain the crumb token?
ABy reading the Jenkins log files
BBy logging into Jenkins UI
CBy sending a GET request to /crumbIssuer/api/json
DBy installing a Jenkins plugin
✗ Incorrect
API clients get the crumb token by sending a GET request to /crumbIssuer/api/json endpoint.
Which HTTP method requires the Jenkins crumb token to prevent CSRF?
APOST
BGET
CHEAD
DOPTIONS
✗ Incorrect
POST requests require the crumb token to verify the request is legitimate and prevent CSRF attacks.
Explain what CSRF protection is in Jenkins and how the crumb mechanism works.
Think about how Jenkins ensures requests come from trusted users.
You got /3 concepts.
Describe the risks of disabling CSRF protection in Jenkins and when you might need to configure it.
Consider what happens if attackers can send unauthorized commands.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of CSRF protection in Jenkins?
easy
A. To backup Jenkins configuration automatically
B. To speed up Jenkins build times
C. To encrypt Jenkins user passwords
D. To prevent unauthorized web requests from other sites
Solution
Step 1: Understand CSRF meaning
CSRF stands for Cross Site Request Forgery, which means unauthorized commands sent from a user that the web app trusts.
Step 2: Identify Jenkins CSRF protection role
Jenkins uses CSRF protection to stop these unauthorized web requests from other sites.
Final Answer:
To prevent unauthorized web requests from other sites -> Option D