Wilsonator123 / Secure-Blog-Page

DSS Projecy
1 stars 0 forks source link

Middleware #42

Open Wilsonator123 opened 6 months ago

Wilsonator123 commented 6 months ago

Create a middleware on the backend

Wilsonator123 commented 6 months ago

https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html

Wilsonator123 commented 6 months ago

https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html#abac

Wilsonator123 commented 6 months ago
Wilsonator123 commented 5 months ago

Logging For Newbies


Contents

  1. What is logging?
  2. Why do we do it?
  3. What do we log
  4. How do we log affectively

What is Logging ?

I don't know 🤷

Logging is the storing of information to do with the operating of a systems. It can be used in multiple different ways and can contain different information. We use it to monitor and record actions taken on our system, whether by users or internal objects.

[!info] Example We can use logging to store all requests made to a database.
Within that log we could have a timestamp, the table / columns accessed, method (query) used, status (outcome) of the query, information on the user and more.

Why Do We Do It?

There a reasons why we use logging:

  1. Identifying Security Incidents
  2. Monitoring Policy Violations
  3. Establishing Baselines
  4. Assisting non-repudiation controls
  5. Providing information about problems
  6. Contributing to incident investigation
  7. Helping to defend against vulnerability identification and exploitation

These methods revolve around the fact that logging can inform developers of how the systems is being used which can help increase security as it helps identify vulnerabilities, strange activities, and possible breaches

What Are We Logging?

Look inside yourself and find the answer 🙏 There are 4 questions that we ask when logging:

  1. When
  2. Where
  3. Who
  4. What

When

Information about when the event occurred

  • Log timestamp (UTC)
  • *Interaction identifier 1

    Where

    Where did the event come from

  • Application Name
  • Location
  • Where did the event originate (HTTP/ URL)
  • Code location, script name

    Who

    Who is making the request (user or machine)

  • Source address (IP, Application, Device)
  • User identity (if available), user table primary key

    What

    What was the event

  • Type of even 2
  • Severity 2
  • Description
  • Reason
  • Result Status (or HTTP Status)
  • User Type

    1 - Interaction Identifier is a way to identify that links the user interaction with the event. E.g. of form submit, on button click, page request

2 - We need to create a list of types and severities which will link to the event e.g. 0=emergency, 1=fatal, 2=error 0=db read, 1=db write, 2=db modify, 3=db deletion etc.

To be discussed!


How Do We Log Effectively?

Wilsonator123 commented 5 months ago

https://datatracker.ietf.org/doc/html/rfc5424#section-4

Image