-
Notifications
You must be signed in to change notification settings - Fork 845
Added deny list for checking external user submitted urls #39947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0ec6642
6c19668
cd4bfa5
b46476e
8a2e1fe
af766b5
9fe8ca5
81836ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Added deny list for checking external urls the fleet server will attempt to contact that are user submitted. Refer to pkg/fleethttp/ssrf.go for full list. In development, the --dev flag skips this check so that testing locally is not impacted. Certificate authorities is the first place this is implemented. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -513,7 +513,7 @@ func (s *SCEPConfigService) GetNDESSCEPChallenge(ctx context.Context, proxy flee | |
| // Get the challenge from NDES | ||
| client := fleethttp.NewClient(fleethttp.WithTimeout(*s.Timeout)) | ||
| client.Transport = ntlmssp.Negotiator{ | ||
| RoundTripper: fleethttp.NewTransport(), | ||
| RoundTripper: fleethttp.NewSSRFProtectedTransport(), | ||
| } | ||
| req, err := http.NewRequest(http.MethodGet, adminURL, http.NoBody) | ||
| if err != nil { | ||
|
|
@@ -586,8 +586,10 @@ func (s *SCEPConfigService) ValidateSmallstepChallengeURL(ctx context.Context, c | |
| } | ||
|
|
||
| func (s *SCEPConfigService) GetSmallstepSCEPChallenge(ctx context.Context, ca fleet.SmallstepSCEPProxyCA) (string, error) { | ||
| // Get the challenge from Smallstep | ||
| client := fleethttp.NewClient(fleethttp.WithTimeout(30 * time.Second)) | ||
| client := fleethttp.NewClient( | ||
| fleethttp.WithTimeout(30*time.Second), | ||
| fleethttp.WithTransport(fleethttp.NewSSRFProtectedTransport()), | ||
| ) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opted not to change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| var reqBody bytes.Buffer | ||
| if err := json.NewEncoder(&reqBody).Encode(fleet.SmallstepChallengeRequestBody{ | ||
| Webhook: fleet.SmallstepChallengeWebhook{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, are we getting a clear message in the frontend for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example:
