From daf4752101db26c9bf1dff78e60b7e22e8ac2db3 Mon Sep 17 00:00:00 2001 From: Gennadii Ershov Date: Tue, 4 Feb 2025 12:51:46 -0500 Subject: [PATCH 1/5] challenge: solve challenge1 --- challenges/challenge1.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/challenges/challenge1.py b/challenges/challenge1.py index 182c032..786b3da 100644 --- a/challenges/challenge1.py +++ b/challenges/challenge1.py @@ -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 From cd200d87d8c87de6fbff52f0fedbea6010b2e54c Mon Sep 17 00:00:00 2001 From: Gennadii Ershov Date: Tue, 4 Feb 2025 13:17:13 -0500 Subject: [PATCH 2/5] challenge: solve challenge2 --- challenges/challenge2.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/challenges/challenge2.py b/challenges/challenge2.py index 504b52b..0514758 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- """ Created on Thu Jan 30 15:30:30 2025 - @author: somai Challenge 2: Digital Access Control Objective @@ -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.") From 03c1a96fb838aaef68f68892c148ab5c3f50cd09 Mon Sep 17 00:00:00 2001 From: Gennadii Ershov Date: Tue, 4 Feb 2025 13:20:53 -0500 Subject: [PATCH 3/5] challenge: solve challenge2 --- challenges/challenge2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/challenge2.py b/challenges/challenge2.py index 0514758..2a9ca04 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -40,4 +40,4 @@ # 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.") +print("Are there unnecessary overlaps in access that could pose a security risk? No") From 511afdd453bc17bf88d26d2f8aaa19aa480c6cae Mon Sep 17 00:00:00 2001 From: Gennadii Ershov Date: Tue, 4 Feb 2025 13:26:39 -0500 Subject: [PATCH 4/5] README.md: add authors --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 8342964..5d61f29 100644 --- a/README.md +++ b/README.md @@ -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**: From c85f30c0b88f93c728dcd9ddc369a280d2900211 Mon Sep 17 00:00:00 2001 From: Gennadii Ershov Date: Tue, 4 Feb 2025 13:38:17 -0500 Subject: [PATCH 5/5] challenge: solve challenge3 --- challenges/challenge3.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/challenges/challenge3.py b/challenges/challenge3.py index d20302e..15c01ba 100644 --- a/challenges/challenge3.py +++ b/challenges/challenge3.py @@ -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 company’s 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. @@ -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"))