add client IP to audit logs
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -163,9 +163,10 @@ func retrieveSpecifiedSecret(s *models.Secret, c *gin.Context) {
|
||||
a := models.Audit{
|
||||
UserId: UserId,
|
||||
SecretId: results[0].SecretId,
|
||||
IpAddress: c.ClientIP(),
|
||||
EventText: fmt.Sprintf("Retrieved Secret Id %d", results[0].SecretId),
|
||||
}
|
||||
a.AutidLogAdd()
|
||||
a.AuditLogAdd()
|
||||
|
||||
// output results as json
|
||||
c.JSON(http.StatusOK, gin.H{"message": "success", "data": results})
|
||||
@@ -209,9 +210,10 @@ func ListSecrets(c *gin.Context) {
|
||||
// Create audit record
|
||||
a := models.Audit{
|
||||
UserId: UserId,
|
||||
IpAddress: c.ClientIP(),
|
||||
EventText: fmt.Sprintf("Listed %d secrets accessible to user", len(output)),
|
||||
}
|
||||
a.AutidLogAdd()
|
||||
a.AuditLogAdd()
|
||||
|
||||
// output results as json
|
||||
c.JSON(http.StatusOK, gin.H{"message": "success", "data": output})
|
||||
|
Reference in New Issue
Block a user