Skip to content
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

Cross Origin Resource Sharing. Leverage SAP CORS policy on SAP Business Accelerator Hub with the api-gateway #892

Closed
6 tasks
ptesny opened this issue Feb 21, 2024 · 3 comments

Comments

@ptesny
Copy link

ptesny commented Feb 21, 2024

Description

Cross Origin Resource Sharing. Leverage SAP CORS policy available on SAP Business Accelerator Hub with the api-gateway

https://gist.github.com/ptesny/a2e7000814aa7bdc6795016e708675b5#cors-policy-on-sap-business-accelerator-hub

SAP Business Accelerator Hub is like an Alibaba's cavern. Except, no need to be a thief. Everything is in plain sight.
SAP Business Accelerator Hub offers a trove of public resources, namely

  • API packages,
  • iFlows,
  • security policies,
  • domain resources (build code, ai), and so on so forth.
    Reasons

Cross-ecosystem alignment.
Applying predefined CORS policy value will make it easier to apply the correct CORS settings.

DoD:

  • Provide unit and integration tests.
  • Provide documentation.
  • Verify if the solution works for both open-source Kyma and SAP BTP, Kyma runtime.
  • If you changed the resource limits, explain why it was needed.
  • Verify that your contributions don't decrease code coverage. If they do, explain why this is the case.
  • Add release notes.

Attachments
https://gist.github.com/ptesny/a2e7000814aa7bdc6795016e708675b5#cross-origin-resource-sharing
https://gist.github.com/ptesny/a2e7000814aa7bdc6795016e708675b5#cors-policy-on-sap-business-accelerator-hub

@strekm
Copy link
Contributor

strekm commented Jan 17, 2025

@ptesny thanks for reporting that. what kind configuration do you have in mind. i had a quick look at your gist and it seems pretty relaxed / too general to me. on the other hand it seems to me that example to came up with is based on very specific usage and somehow does not sound to me it should be used as default.

There is already possibility to configure CORS on APIRule so maybe writing a blog post or sap specific tutorial would be more useful in this case.

@TorstenD-SAP
Copy link

From my point of view the CORS policy provided by SAP Business Accelerator Hub is way to generic and relaxed. I agree to what @strekm already said, having a blog post how to add a valuable CORS policy is much more valuable than defining a weak default and giving the impression of security.

@strekm strekm closed this as completed Jan 17, 2025
@ptesny
Copy link
Author

ptesny commented Jan 17, 2025

The idea was to provide a ready made CORS policy that could be applied with one click in the api rule.

PS.
The SAP CORS policy above is there for illustration purposes only.
Please re-open this issue

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

No branches or pull requests

3 participants