Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This repository contains starter code and resources for Social Coding workshops covering 1-off fun subjects like generative art, coding competitions, code reading sessions or pseudocoding.

## **Authors**

- Gennadii Ershov
- Jola-Moses
- Omer Awadalkareem
- Reem Osama
- Thilakan Jegatheeswaran

## Running Python Files in this Repository

- **Running a plain Python script**:
Expand Down
17 changes: 17 additions & 0 deletions challenges/challenge1.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,20 @@
Interpret what the final expression means in the context of allowing or blocking a login attempt.

"""

def simplify_boolean(A: bool, B: bool) -> bool:
"""
Simpidies ¬(A∧(B∨¬B)) to ¬A

Args:
A (bool): The user has provided the correct login credentials
B (bool): The login attempt is from a trusted device

Returns:
bool: True if the login should be blocked; False otherwise.
"""

# B ∨¬B - is always True - Complement Law
# A ∧ True = A - Identity Law
# ¬A = not A - Simplification
return not A
16 changes: 14 additions & 2 deletions challenges/challenge2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 30 15:30:30 2025

@author: somai
Challenge 2: Digital Access Control
Objective
Expand All @@ -27,5 +26,18 @@
Are there unnecessary overlaps in access that could pose a security risk?
What changes would you recommend to enhance security and minimize excessive access?
# -*- coding: utf-8 -*-

"""
finance_access = {"E0435", "E1021", "E3098", "E7642", "E8873", "E6590"}
tech_access = {"E7642", "E8873", "E6590", "E9812", "E4520"}
admin = {"E0001"}
new_employee = {"E9999"}
# Who has access to at least one type of data?
print("Who has access to at least one type of data? ", finance_access | tech_access | admin)
# Who has access to both financial and technical data?
print("Who has access to both financial and technical data? ", (finance_access & tech_access) | admin)
# Who has exclusive access to only one type of data?
print("Who has exclusive access to only one type of data? ", finance_access ^ tech_access)
# Which employees currently lack access (but exist in the system)?
print("Which employees currently lack access (but exist in the system)? ", new_employee)
# Are there unnecessary overlaps in access that could pose a security risk?
print("Are there unnecessary overlaps in access that could pose a security risk? No")
11 changes: 10 additions & 1 deletion challenges/challenge3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Objective
Develop a visual representation of the company's access control system to identify patterns, overlaps, and security risks.
Scenario
The companys security team is struggling to interpret raw access data. They need a clear way to see:
The company's security team is struggling to interpret raw access data. They need a clear way to see:
Employees who have access to financial records, technical documents, or both.
Employees with no access, who may need onboarding.
Any overlap that could indicate excessive privileges or security risks.
Expand All @@ -20,3 +20,12 @@
Are there risks? Indicate employees who might be exposed to unnecessary data.
Your output should visually highlight these relationships without explicitly listing them in a simple table or list. Think beyond just printing data—use a format that helps detect patterns at a glance.
"""
from matplotlib_venn import venn2
import matplotlib.pylot as plt

finance_access = {"E0435", "E1021", "E3098", "E7642", "E8873", "E6590"}
tech_access = {"E7642", "E8873", "E6590", "E9812", "E4520"}
admin = {"E0001"}
new_employee = {"E9999"}

venn2([finance_access, tech_access, admin, new_employee], set_labels=("finance_access", "tech_access", "admin", "new_employee"))