Skip to content

Conversation

@MahdiBaghbani
Copy link
Member

This PR is a part of cs3org/OCM-STA#1
This PR depends on the #5385 to be merged first.

Description

This PR introduces security measures to the OCM client to prevent common attack vectors such as SSRF, DNS rebinding, and resource exhaustion attacks. The implementation provides configurable security controls while maintaining backward compatibility with existing code.

@MahdiBaghbani
Copy link
Member Author

MahdiBaghbani commented Nov 1, 2025

This could be extended to:

ocmClient: ocmd.NewClient(time.Duration(c.OCMClientTimeout)*time.Second, c.OCMClientInsecure),

ocmcl := ocmd.NewClient(time.Duration(c.ClientTimeout)*time.Second, c.ClientInsecure)

ocmClient := NewClient(time.Duration(10)*time.Second, true)

so everything can use same defaults or same config

@MahdiBaghbani MahdiBaghbani force-pushed the reva/feature-ocm-security branch from 01aabae to 3caf91d Compare November 1, 2025 19:01
@glpatcern glpatcern marked this pull request as draft November 5, 2025 12:36
@MahdiBaghbani MahdiBaghbani force-pushed the reva/feature-ocm-security branch from 3caf91d to 21dc03b Compare November 5, 2025 17:08
MahdiBaghbani and others added 14 commits November 10, 2025 10:09
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Instead of creating a client each time a function is called, create client once

Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
@glpatcern recommendations
moved types to spec.go
used directory urls instead of a file

Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
as per @glpatcern recommendations

Also return 404 if the remote EFSS doesn't provide an
inviteAcceptDialog

Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
New function works for any OCM GET endpoint
and can be used by other functions.

Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Signed-off-by: Mahdi Baghbani <mahdi-baghbani@azadehafzar.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants