Added audit logging. Added admin view for audit log
This commit is contained in:
@@ -27,7 +27,7 @@ public class PullController : Controller
|
||||
Stream req = Request.Body;
|
||||
string jwt = await new StreamReader(req).ReadToEndAsync();
|
||||
|
||||
var dict = OneTimeJwtService.Validate(jwt);
|
||||
var dict = await OneTimeJwtService.Validate(jwt);
|
||||
|
||||
if (dict == null)
|
||||
return NotFound();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Logging.Net;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Moonlight.App.Models.Misc;
|
||||
using Moonlight.App.Services.LogServices;
|
||||
|
||||
namespace Moonlight.App.Http.Controllers.Api.Moonlight;
|
||||
|
||||
@@ -7,12 +9,19 @@ namespace Moonlight.App.Http.Controllers.Api.Moonlight;
|
||||
[Route("api/moonlight/resources")]
|
||||
public class ResourcesController : Controller
|
||||
{
|
||||
private readonly SecurityLogService SecurityLogService;
|
||||
|
||||
public ResourcesController(SecurityLogService securityLogService)
|
||||
{
|
||||
SecurityLogService = securityLogService;
|
||||
}
|
||||
|
||||
[HttpGet("images/{name}")]
|
||||
public ActionResult GetImage([FromRoute] string name)
|
||||
public async Task<ActionResult> GetImage([FromRoute] string name)
|
||||
{
|
||||
if (name.Contains(".."))
|
||||
{
|
||||
//TODO: Add security warn
|
||||
await SecurityLogService.Log(SecurityLogType.PathTransversal, name);
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user