SDL and Secure Design
Study-time guide: 15 min reading and analysis, 65 min core exercises, 40 min review and deliverable. Additional external-platform execution is estimated separately.
A security development lifecycle (SDL) organises decisions and checks before release, during changes and in maintenance. An asset is something to protect, such as assignment content. A trust boundary is a point where incoming data or authority needs checking. An API exposes application operations through a programming interface. Identify people, data and permitted actions before using the card’s abbreviations.
Design security means testable constraints
A secure development lifecycle starts before a scanner is selected. Identify assets, trust boundaries, permitted actions, and methods for validating constraints. A requirement that merely says “make it secure” cannot be accepted because it never defines the allowed behavior or an observable failure.
Our original case adds assignment uploads to an academy. A student uploads a PDF, an assigned instructor reads it in the dashboard, and the content is eventually deleted under a retention rule. The team only discusses maximum file size. Ownership, reader permissions, safe processing, and deletion of derived copies also matter. Malware scanning can provide one control, but it cannot replace authorization.
Turn data flow into requirements
This design card can be reviewed without a running service. Each evidence entry describes how a property should be verified, not a claim that verification has already succeeded.
feature: assignment-upload
flows:
- student -> upload-api -> object-store
- teacher -> assignment-api -> authorized-download
assets: [submission-content, student-identity]
requirements:
AUTH-01:
rule: reader must be assigned to this submission
evidence: own/foreign/unassigned identity matrix
FILE-01:
rule: upload must not choose its storage path
evidence: generated object id; isolated synthetic filenames
RET-01:
rule: deletion includes derived preview copies
evidence: inventory and post-delete lookup
For FILE-01, the supplied filename notes.pdf should remain a descriptive label rather than a trusted filesystem path. The server generates an object identifier and records ownership separately. This turns an abstract constraint into a concrete implementation responsibility. One test containing ../ cannot demonstrate protection against every path interpretation: locate normalization boundaries and the actual storage operations.
For AUTH-01, include an owned submission, another student’s submission, and an instructor without an assignment. Check both the server response and the absence of protected content in its body. Hiding an interface button is insufficient because a request can be sent directly. For RET-01, inventory generated previews and caches rather than deleting only the original upload.
Exercise: run a focused design review
Draw trust boundaries between the browser, file processor, and storage. Analyze four threats: reading another student’s submission, selecting an object’s storage name, unsafe file processing, and retaining a copy after deletion. Record a precondition, consequence, control, and test for each. Distinguish prevention from detection of an event that has already happened.
Acceptance criteria: every requirement names an action and an object; each has a negative test; an implementation owner is explicit; unsafe processing is not excused merely because an authenticated student uploaded the file. Where your practice environment cannot verify a property, specify a manual review and the evidence it needs.
Work deliverable
Submit the data-flow drawing, requirement card, and a design-review record containing three decisions and remaining risks. A developer should be able to use it in an implementation task. Consult OWASP Threat Modeling for the modeling process and NIST SSDF for its role in development.
Lesson: explain the flow and identify the boundary
Think of an upload as handing over a parcel. The browser is the user’s application. A request carries an operation and data to the server. The server processes it, storage retains the result, and a response returns status and relevant information. HTTP supports this communication; an API defines the application’s available operations. Successful sign-in identifies the caller, while permission for a particular operation is a separate decision. A signed-in student therefore cannot read every parcel.
Draw browser, API, preview processor, and storage. Label each arrow with data and its controller. The student supplies a filename; the server chooses a stored-object identifier under the defined model. The preview component has its own permissions, temporary files, and possible errors. Trusting an authenticated student does not make uploaded PDF content safe instructions for a processor.
Add deletion: at 10:00 the original disappears but a preview remains elsewhere. Separate the user-facing promise from the actual procedure. Inventory derived copies, cleanup timing, and unfinished jobs. Identify an owner for each copy and explain how repeated cleanup avoids deleting another submission. Use synthetic labels such as submission-17 and preview-17, rather than real assignments.
Examine deletion using actual training files
Save cleanup_local.py and run prepared Python 3 with python3 cleanup_local.py or python cleanup_local.py on Windows. It creates only its own temporary directory and four fictional text files. Assignment labels are fixed in the source, not browser-supplied filenames.
# cleanup_local.py: own temporary original/preview pairs only
from pathlib import Path
from tempfile import TemporaryDirectory
with TemporaryDirectory() as folder:
base = Path(folder)
for name in ('submission-17.txt','preview-17.txt','submission-18.txt','preview-18.txt'):
(base / name).write_text('FICTIONAL TRAINING CONTENT', encoding='utf-8')
(base / 'submission-17.txt').unlink() # deliberately incomplete procedure
assert (base / 'preview-17.txt').exists()
print('negative control: deleting original left its preview')
(base / 'preview-17.txt').unlink() # finish the defined local procedure
assert not (base / 'submission-17.txt').exists()
assert not (base / 'preview-17.txt').exists()
assert (base / 'submission-18.txt').exists()
assert (base / 'preview-18.txt').exists()
print('target pair absent; other submission retained')
print('temporary directory cleaned; no remote store, cache or backup tested')
The first step deliberately leaves preview-17, demonstrating an incomplete procedure. After the second, both assignment 17 files are absent while assignment 18 remains. Skip deletion of preview-17 in a separate version; the next assertion must fail. Deleting preview-18 incorrectly also fails the preservation control. This checks actual local files rather than cloud-object, cache or backup cleanup. Each additional component needs its own verification source.
Practice extension: record a design decision
Hold a ten-minute review with product-owner, developer, and security roles. Working alone, answer from each perspective. The owner explains the necessary function and data sensitivity. The developer identifies checks and state changes. Security identifies bypasses and observable verification. Finish with one decision and one unknown assigned to an owner and deadline.
Replace “the file is safe” with specific properties: server-selected object, assigned reader, isolated processing, and cleanup of original and preview. Give each a positive and negative case. A hidden button is not a server denial; a cleanup log does not prove absence of the object without suitable verification.
For a Russian project, distinguish engineering standards, internal requirements, and legal obligations. ASVS and SSDF support verification design, but mentioning them does not make every requirement mandatory for every organization. Establish applicable contractual and sector-specific conditions separately. Submit the diagram and review record with the requirement card so another developer can implement and verify the decision.
Where to put a check
Change the conditions and observe this training model. It runs in your browser and does not change your computer.
A team is preparing a release. Enable the independent checks and see what remains unknown.
Choose conditions above to see an explanation of the result.
Independent exercise · Russian

В декабре 2026 года сеть проката в Казани согласует сервис сверки имущества. Два филиала передают ведомости в одну очередь. По договорённости каждый заведующий видит расхождения только своего филиала. На разборе дизайна пока есть схема и три примера сообщений.
Evidence
В обоих филиалах есть ведомость 104. При приёме сервис знает филиал из проверенной сессии. В очередь уходят только номер ведомости и дата. Обработчик выбирает первую запись по номеру и складывает результат под ключом «104».
Assignment
Отметьте на схеме первое место потери контекста. Запишите, какие поля сохраняются в задании, как выбирается запись и чем различаются ключи двух результатов.
Compare your reasoning
Филиал исчезает при постановке задания в очередь. Сервис должен связать задание с проверенным филиалом, а обработчик использовать пару «филиал, номер» при чтении и записи. Критерий приёмки для двух ведомостей 104 — два результата с разными ключами, каждый доступен только соответствующему филиалу.
Personal practice environment
Check an excerpt, find matching lines and compute the SHA-256 of the original text. Temporary data expires after 30 minutes or when you close the environment.
Sign in