Independent cybersecurity. Clear scope. Practical action.Plan your next security assessment
POC / Runnable local demonstration

POC: a tiny authorisation regression test

Executable Python with synthetic data: test the policy decision without a network request.

What this demonstrates

This proof of concept is an original teaching example. It makes no network connections and does not target a real product. It shows how to encode an ownership rule as a small test so its intended behaviour is explicit.

Run the local example

Save the code as ownership_test.py and run it with Python 3. It uses only the standard library. The tests cover ownership, a different user, missing identity and a missing owner.

import unittest

def can_read(user_id, document):
    owner = document.get("owner")
    return user_id is not None and owner is not None and user_id == owner

class OwnershipTests(unittest.TestCase):
    def test_owner_allowed(self):
        self.assertTrue(can_read("alice", {"owner": "alice"}))
    def test_other_user_denied(self):
        self.assertFalse(can_read("bob", {"owner": "alice"}))
    def test_anonymous_denied(self):
        self.assertFalse(can_read(None, {"owner": "alice"}))
    def test_missing_owner_denied(self):
        self.assertFalse(can_read("alice", {}))

if __name__ == "__main__":
    unittest.main()

Understand the limits

The function is deliberately small. A real system may also need tenant rules, explicit sharing, administrative permissions and separate policies for different actions. The point is to make those rules testable, not to replace a complete application policy with this example.

Extend the exercise

Add an explicit sharing list and write the expected cases before changing the function. Decide how read permission differs from update permission. Test that a missing or malformed property cannot silently become permission.

Connect it to remediation

A fix is easier to maintain when its intended boundary is captured in tests. Keep test records synthetic, document the business rule and review the policy whenever roles or sharing behaviour change.

Discuss your assessment
Let’s move it forward

A better next step starts
with a clear scope.

Tell us what is changing, what is at risk and what you need to know.

From interest to action

A clear path.
A useful outcome.

Build your assessment brief
Start a useful conversation

Let’s shape your scope.

Share your objective and intended use of the report. Your brief helps shape the coverage, delivery window and next steps.

Prefer a guided scope brief?
Your enquiry · 0 of 5 required fields

A clear scope comes first. No need to include credentials or sensitive files.

A clearer place to start

Not sure which assessment you need?

Share your business goal and find a useful starting scope.

Explore the readiness checklist first