-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the list-element command #167
Conversation
This is great, thank you! I wonder if there isn't a bit too much filtering there - for example, where is Data? |
Hi, Currently I use the reflection api to get all sub classes of Element, since I thought it would make things easier for future changes.
Do you have a list of classes that should be in there? |
Fixed a check with the args checking and added the Attributes list. |
model.py --list-elements shows a list of all elements which can be used in a threat model with pytm. Why? I often find my self looking up the exact names of the elements and there doc string. Currently the output looks like this. Elements: Actor -- An entity usually initiating actions Asset -- An asset with outgoing or incoming dataflows Boundary -- Trust boundary groups elements and data with the same trust level. Dataflow -- A data flow from a source to a sink Datastore -- An entity storing data ExternalEntity -- Lambda -- A lambda function running in a Function-as-a-Service (FaaS) environment Process -- An entity processing data Server -- An entity processing data SetOfProcesses -- Atributes: Action -- Action taken when validating a threat model. Classification -- An enumeration. Data -- Represents a single piece of data that traverses the system Lifetime -- An enumeration. TLSVersion -- An enumeration.
Hi, |
So so sorry! I got overridden by Real Life(TM). |
No problem.
and
) Which gives this output
This is possible since the classes To discover all components automatically they would need some indicator by which they could be selected.
I guess it is fine as it is now, or is there something still in the list which should not be displayed? To make the output more useful it would be good to have doc strings for |
It is interesting you mention the possibility of making this easier by going into separate modules. I have been talking with @nineinchnick and even have a branch with work half-done separating classes into separate modules; unfortunately I took some wrong turns into design choices right at the beginning that make that work harder. Still, I consider it an important part of the roadmap (actually, I need to add it to the file). Any suggestions you may have on that are most welcome! Thanks for this useful feature. |
If the attributes would be in a module I looked at the branch May I ask what the main motivation was for the modular branch? |
I don't think we have a discussion going on.
The design choices were more in the vein of "ok, let me see if i can get
this working" than being really pythonic and clear - for example, Jan has
repeatedly explained to me that context managers would be of great help in
simplifying things.
What would you suggest would be a better reorg and redesign?
thanks!
…On Mon, Aug 30, 2021 at 5:44 AM Raphael Ahrens ***@***.***> wrote:
If the attributes would be in a module pytm/attributes.py then it would
be very easy to select them since one would only need to look at one module
to select the classes from it.
I looked at the branch modular which you mentioned and I don't know it
this would have helped.
a) all classes have there own modules and so it is not clear if
actor.Actor is an element or an attribute.
b) splitting every single class in its own module doesn't help readability
and is not typical python code. I would prefer if similar classes are in a
single module.
May I ask what the main motivation was for the modular branch?
And what where the "wrong turns into design choices"?
Is there already an Issue for this topic where a discussion can be held?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#167 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC2BAP53YJF7QJB3AGMJTLT7NHHNANCNFSM5BT6FDCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
model.py --list-elements shows a list of all elements which can be used
in a threat model with pytm.
Why?
I often find my self looking up the exact names of the elements and
there doc string.
Currently the output looks like this.