Skip to content

Lock down the api to a single domain #3

Open

Description

@tmutton

In issue #1 we added the ability to make cross domain posts but now we'd like to make this more secure by making posts available to a single domain.

This can be achieved by changing the property in the web section of the arm template from:

"cors": {
              "allowedOrigins": [
                "*"
              ]
            }

to:

"cors": {
              "allowedOrigins": [
                "http://yourdomain.com"
              ]
            }

The domain should be taken from a parameter filled out by the user upon deployment setup.

Activity

  1. tmutton commented on Dec 31, 2017

    @tmutton
    OwnerAuthor

    After spending a bit of time researching this I figured out the code below needs to go in "properties" of the web site resource.

    "siteConfig": {
              "cors": {
                "allowedOrigins": [
                  "http://myDomain.com"
                ]
              }
            }
    

    This solution requires more thinking because the user may not have a live domain. This ideally should be an optional parameter (preferably comma delimited to reflect the destination type). We also need to think about what happens when they don't specify a value. Will the system fail or enter an empty record?

    I will add in the wiki that the user should be entering this information manually for now until we find a suitable solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions