I'm making a simple news feed where i enter a new item from a form hidden on a url that i manually need to type in (no account functionality). But i wanted a additional line of defense if the form is found so i added a password field so if the password match the preset i have then the form saves the data in to a xml file.
Now the question is, whats the best practice here to make that validation and where do i put the password?
At the moment my code looks like this:
[HttpPost]
[ValidateAntiForgeryToken()]
public ActionResult AddPost(AddPostModel model)
{
if (ModelState.IsValid && model.Password == "MyPassword")
{
AddPostModel.AddPostToXML(model);
}
return RedirectToAction("Index");
}
The thing is that its a small site and at worst they add news item that should not be there. So do i need to take additional precautions or is it secure enough for what its supposed to protect?
Since i'm quite new i don't have a lot of experience in security so any guidelines or what to keep in mind would also be much appreciated.
Thanks!