Threat Evaluation Improvements: Simplify conditions and first step toward detecting mitigations

Abierto
#152 12 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
20/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python
Área
security

Línea de trabajo

Empieza leyendo la discusión del issue y el manejo existente de threatlib y Element al que se hace referencia en la propuesta. Confirma con los maintainers el comportamiento previsto de target_condition y ThreatResult; se considera terminado cuando existe una implementación acordada que distingue entre amenazas inválidas, no aplicables, mitigadas y válidas, y expone los resultados solicitados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

When using pytm to find threats I found most threats do not apply which would require me to re-write conditions to detect applicable components. Instead to address this I added a new condition to the threatlib called 'target_condition" to detect if the target is relevant for the Threat. For example using INP01 : Buffer Overflow via Environment Variables I have a target_condition of 'target.usesEnvironmentVariables' with the 'condition' of target.sanitizesInput is False and target.checksInputBounds is False another example would be applying SQLi to a Server or Process only if one of the outbound data flows as a sink of Database and isSQL = True.

This is basically what I was getting after with #14 although i described it differently.

To be able to see this in report and ensure the target conditions are valid I have taken a step towards detecting mitigations. When applying a threat I have created a ThreatResult class for invalid target, not applicable threats (target_condition = False), mitigated (target_condition == True and condition == False) and Valid. Added lists of Threats for na, mitigated threats in Element.

Things are mostly functional locally but still playing with a few things. I would like to get anyones thoughts as I continue with this.

Lenguaje dominante
Python
Estrellas
1.2k
Forks
237
Merge medio
4 d 2 h
PR fusionados (30 d)
9

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OWASP/pytm

Todos los issues de OWASP/pytm

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.