OWASP / OWASP/pytm

DataFlow object attributes need work (or moves)

Open
#111 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.2k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

Many of the attributes defined for the DataFlow object belong elsewhere:

Correctly assigned:

  • source = varElement(None, required=True)
    
  • sink = varElement(None, required=True)
    
  • order = varInt(-1, doc="Number of this data flow in the threat model")
    
  • note = varString("")
    

Maybe correct:

  • isResponse = varBool(False, doc="Is a response to another data flow") --> Is this a dup with `responseTo`?
    
  • response = varElement(None, doc="Another data flow that is a response to this one") --> If this is non-empty, is either `isResponse` or `responseTo` needed (since it would be detectable as True if non-empty)?
    
  • responseTo = varElement(None, doc="Is a response to this data flow") --> Is this a dup with `isResponse`?
    
  • data = varData([], doc="Default type of data in incoming data flows") --> Does this represent the data sent by the source, or returned by the sink? I think this highlights a challenge in setting data to the flow and not associating the connection to the source as sender of data, and server is replier of data.
    

Should be a property of the Source:

  • srcPort = varInt(-1, doc="Source TCP port")
    
  • isEncrypted = varBool(False, doc="Is the data encrypted") --> Clarification needed - is this data encryption independent of the protocol?
    
  • authenticatesDestination = varBool(False, doc="""Verifies the identity of the destination,
    
  • for example by verifying the authenticity of a digital certificate.""")
  • checksDestinationRevocation = varBool(False, doc="""Correctly checks the revocation status
    
  • of credentials used to authenticate the destination""")

Should be a property of the Sink:

  • usesSessionTokens = varBool(False)
    
  • authorizesSource = varBool(False)
    
  • usesLatestTLSversion = varBool(False) --> This will become out of date (TLS 1.2 to TLS 1.3 to whatever is next), and TLS is not the only option for secure protocol, so maybe this should be a list
    
  • implementsAuthenticationScheme = varBool(False)
    
  • authenticatedWith = varBool(False)
    
  • protocol = varString("", doc="Protocol used in this data flow") --> With this list, it is possible to check for `usesLatestTLSversion` state
    
  • dstPort = varInt(-1, doc="Destination TCP port")
    

Should be a property of either source or sink:

  • usesVPN = varBool(False) --> DataFlows are associated with a source (the initiator) and a sink (the target). It is either the source or sink that determines if a VPN is in use. The source may use one, or the sink may do so, or both, but the DataFlow would if anything inherit the state of this flag based on `source.usesVPN or sink.usesVPN`. 
    
  • implementsCommunicationProtocol = varBool(False) --> Sink always determines the protocol to be used by the source, but this may also apply to the source's comm stack
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the DataFlow object definition and the related Source and Sink definitions. Review how response, data, protocol, encryption, authentication, and port attributes are currently used, then resolve which attributes belong on each object. Done means the ownership and semantics are agreed and the model is updated consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.