Securing a remote ajax method call

前端 未结 7 2029
面向向阳花
面向向阳花 2020-12-18 14:15

I have coded some JavaScript to perform an ajax call in an asp.net application. This triggers a method that calls a URL, sending some parameters in the POST.

The rec

7条回答
  •  醉酒成梦
    2020-12-18 14:48

    Sorry, I can't add comments as I don't have enough reupation yet.

    I don't fully understand your question. Are you asking if the developer you give the username/password to decides to abuse the webservice?

    If that is the case, you will probably want to include some sort of logging into the system. (In fact, you should probably do that no matter what.)

    You could write an entry in to some sort of log (file, event log, sql table, etc) during the PermissionsValid function. This could show the IP address and the username passed along with the time stamp of when it was done. This way you can see if someone is trying to 'hack' in.

    You could also put something in the MyWebMethod function after the permissions have been validated logging the data that the user is sending. This way you know who was sending it, when, from where and what they sent. If you want to go the extra mile, you could even record the data before any updates have been made. That would give you the ability to roll back any malicious changes.

提交回复
热议问题