Skip to content

Commit 8a16480

Browse files
authored
Merge pull request #228 from FinestMaximus/master
README : updated the #creating-a-threat-model with an example of a Da…
2 parents 47e0c9c + 6000e5a commit 8a16480

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

README.md

+26-5
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,30 @@ db.isSql = True
148148
db.inScope = False
149149
db.sourceCode = "model/schema.sql"
150150

151+
comments = Data(
152+
name="Comments",
153+
description="Comments in HTML or Markdown",
154+
classification=Classification.PUBLIC,
155+
isPII=False,
156+
isCredentials=False,
157+
# credentialsLife=Lifetime.LONG,
158+
isStored=True,
159+
isSourceEncryptedAtRest=False,
160+
isDestEncryptedAtRest=True
161+
)
162+
163+
results = Data(
164+
name="results",
165+
description="Results of insert op",
166+
classification=Classification.SENSITIVE,
167+
isPII=False,
168+
isCredentials=False,
169+
# credentialsLife=Lifetime.LONG,
170+
isStored=True,
171+
isSourceEncryptedAtRest=False,
172+
isDestEncryptedAtRest=True
173+
)
174+
151175
my_lambda = Lambda("cleanDBevery6hours")
152176
my_lambda.hasAccessControl = True
153177
my_lambda.inBoundary = Web_DB
@@ -159,7 +183,7 @@ my_lambda_to_db.dstPort = 3306
159183
user_to_web = Dataflow(user, web, "User enters comments (*)")
160184
user_to_web.protocol = "HTTP"
161185
user_to_web.dstPort = 80
162-
user_to_web.data = Data('Comments in HTML or Markdown', classification=Classification.PUBLIC)
186+
user_to_web.data = comments
163187

164188
web_to_user = Dataflow(web, user, "Comments saved (*)")
165189
web_to_user.protocol = "HTTP"
@@ -170,10 +194,7 @@ web_to_db.dstPort = 3306
170194

171195
db_to_web = Dataflow(db, web, "Comments contents")
172196
db_to_web.protocol = "MySQL"
173-
# this is a BAD way of defining a data object, here for a demo on how it
174-
# will appear on the sample report. Use Data objects.
175-
db_to_web.data = 'Results of insert op'
176-
197+
db_to_web.data = results
177198

178199
tm.process()
179200

0 commit comments

Comments
 (0)