From 96df89e5d2e01711794db7f9c1d1ecad6cd25327 Mon Sep 17 00:00:00 2001 From: Dadishimwe Date: Tue, 4 Feb 2025 19:55:01 +0200 Subject: [PATCH 1/6] Team Salle 8 --- challenges/challenge1.py | 14 ++++++++++++++ challenges/challenge2.py | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/challenges/challenge1.py b/challenges/challenge1.py index 182c032..3edd816 100644 --- a/challenges/challenge1.py +++ b/challenges/challenge1.py @@ -2,6 +2,14 @@ """ Created on Thu Jan 30 15:30:30 2025 +Group name: Salle 8 +Group members: Dadi Ishimwe + Robel Mengsteab + Safa Saber + Louis Kervens Hubert + M Jawid Mohseni + Mohamed El - nageeb + @author: somai Challenge 1: Detecting Suspicious Login Attempts Objective: @@ -26,3 +34,9 @@ Interpret what the final expression means in the context of allowing or blocking a login attempt. """ +#¬(A∧(B∨¬B)) +#¬(A∧(True)) +#¬(A∧(1)) +#¬(A) + +# the authentication system is blocked by incorrect login credentials and not whether the device is trusted or not. diff --git a/challenges/challenge2.py b/challenges/challenge2.py index 504b52b..bf24572 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -2,6 +2,15 @@ """ Created on Thu Jan 30 15:30:30 2025 +Group name: Salle 8 +Group members: Dadi Ishimwe + Robel Mengsteab + Safa Saber + Louis Kervens Hubert + M Jawid Mohseni + Mohamed El - nageeb + + @author: somai Challenge 2: Digital Access Control Objective @@ -29,3 +38,6 @@ # -*- coding: utf-8 -*- """ +#1: finance_access OR tech_access OR Admin (have access to at least one type data) +#2: Admin = E0001 (Admin has access to both financial and technical data) +#3: From c29cb05f6f8c6ae58016cecd0786e40f1a541549 Mon Sep 17 00:00:00 2001 From: Dadishimwe Date: Tue, 4 Feb 2025 21:59:26 +0200 Subject: [PATCH 2/6] Update Salle 8 --- challenges/challenge1.py | 13 +++++++++++++ challenges/challenge2.py | 26 +++++++++++++++++++++++--- challenges/challenge3.py | 20 ++++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/challenges/challenge1.py b/challenges/challenge1.py index 3edd816..e6814b2 100644 --- a/challenges/challenge1.py +++ b/challenges/challenge1.py @@ -40,3 +40,16 @@ #¬(A) # the authentication system is blocked by incorrect login credentials and not whether the device is trusted or not. +def check_login(A, B): + """ + A: Correct credentials + B: Trusted device + Returns: Whether login should be blocked + """ + return not A # Simplified from ¬(A∧(B∨¬B)) + +# Test cases +print("Credentials correct, trusted device:", check_login(True, True)) +print("Credentials correct, untrusted device:", check_login(True, False)) +print("Credentials wrong, trusted device:", check_login(False, True)) +print("Credentials wrong, untrusted device:", check_login(False, False)) diff --git a/challenges/challenge2.py b/challenges/challenge2.py index bf24572..3be02b4 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -38,6 +38,26 @@ # -*- coding: utf-8 -*- """ -#1: finance_access OR tech_access OR Admin (have access to at least one type data) -#2: Admin = E0001 (Admin has access to both financial and technical data) -#3: +finance_access = {"E0435", "E1021", "E3098", "E7642", "E8873", "E6590"} +tech_access = {"E7642", "E8873", "E6590", "E9812", "E4520"} + +# 1 - finance_access OR tech_access +at_least_one = finance_access | tech_access + +# 2 - Team = finance_access AND tech_access +both_access = finance_access & tech_access + +# 3 - finance_access_exclusive {"E0435", "E1021", "E3098"} +exclusive_finance = finance_access - tech_access + +# 3 - tech_access_exclusive {"E9812", "E4520"} +exclusive_tech = tech_access - finance_access + +# 4 - no_access = new_employee E9999 +all_employees = {"E0001", "E9999", "E0435", "E1021", "E3098", "E7642", "E8873", "E6590", "E9812", "E4520"} +no_access = all_employees - (finance_access | tech_access) + +# 5 - overlap_risk = finance_access AND tech_access +overlap = finance_access & tech_access + +# The should not share common dates and Grant employees only the access they absolutely need to perform their job duties. diff --git a/challenges/challenge3.py b/challenges/challenge3.py index d20302e..9b8d09f 100644 --- a/challenges/challenge3.py +++ b/challenges/challenge3.py @@ -20,3 +20,23 @@ 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. """ +import matplotlib.pyplot as plt +from matplotlib_venn import venn2 + +# Employee access data +finance_access = {"E0435", "E1021", "E3098", "E7642", "E8873", "E6590"} +tech_access = {"E7642", "E8873", "E6590", "E9812", "E4520"} +all_employees = {"E0001", "E9999", "E0435", "E1021", "E3098", "E7642", "E8873", "E6590", "E9812", "E4520"} + +# Determine employee groups +only_finance = finance_access - tech_access +only_tech = tech_access - finance_access +both_access = finance_access & tech_access +no_access = all_employees - (finance_access | tech_access) + +# Create Venn diagram +plt.figure(figsize=(6, 6)) +venn = venn2(subsets=(len(only_finance), len(only_tech), len(both_access)), set_labels=("Finance Access", "Tech Access")) +plt.title("Employee Access Visualization") +plt.annotate(f"Employees with no access: {len(no_access)}", xy=(0.5, 0.1), xycoords="axes fraction", ha="center", fontsize=12) +plt.show() From c2bd51f1cf5cb2b99fdab87c2a6e9c5b0af4d611 Mon Sep 17 00:00:00 2001 From: Dadishimwe Date: Tue, 4 Feb 2025 22:01:45 +0200 Subject: [PATCH 3/6] Update Salle 8 --- challenges/challenge3.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/challenges/challenge3.py b/challenges/challenge3.py index 9b8d09f..6df9d73 100644 --- a/challenges/challenge3.py +++ b/challenges/challenge3.py @@ -3,6 +3,15 @@ Created on Thu Jan 30 15:30:30 2025 @author: somai + +Group name: Salle 8 +Group members: Dadi Ishimwe + Robel Mengsteab + Safa Saber + Louis Kervens Hubert + M Jawid Mohseni + Mohamed El - nageeb + Challenge 3: Access Visualization Objective Develop a visual representation of the company's access control system to identify patterns, overlaps, and security risks. From 721902fb83e394a187dea003aac26982cdaaa73c Mon Sep 17 00:00:00 2001 From: Dadishimwe Date: Tue, 4 Feb 2025 22:15:15 +0200 Subject: [PATCH 4/6] Update Salle 8 --- challenges/challenge1.py | 2 ++ challenges/challenge2.py | 2 ++ challenges/challenge3.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/challenges/challenge1.py b/challenges/challenge1.py index e6814b2..1f38d6a 100644 --- a/challenges/challenge1.py +++ b/challenges/challenge1.py @@ -9,6 +9,8 @@ Louis Kervens Hubert M Jawid Mohseni Mohamed El - nageeb + Franklyn Abanihe + Mariia Ermishina @author: somai Challenge 1: Detecting Suspicious Login Attempts diff --git a/challenges/challenge2.py b/challenges/challenge2.py index 3be02b4..ef582de 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -9,6 +9,8 @@ Louis Kervens Hubert M Jawid Mohseni Mohamed El - nageeb + Franklyn Abanihe + Mariia Ermishina @author: somai diff --git a/challenges/challenge3.py b/challenges/challenge3.py index 6df9d73..7d90c6e 100644 --- a/challenges/challenge3.py +++ b/challenges/challenge3.py @@ -11,6 +11,8 @@ Louis Kervens Hubert M Jawid Mohseni Mohamed El - nageeb + Franklyn Abanihe + Mariia Ermishina Challenge 3: Access Visualization Objective From f6f7d77046d59755dab610ef4e59d60fcd9e267a Mon Sep 17 00:00:00 2001 From: Dadi Ishimwe Date: Sat, 8 Feb 2025 10:03:13 +0200 Subject: [PATCH 5/6] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 8342964..56f99dd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ 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. +Group name: Salle 8 +Group members: Dadi Ishimwe + Robel Mengsteab + Safa Saber + Louis Kervens Hubert + M Jawid Mohseni + Mohamed El - nageeb + Franklyn Abanihe + Mariia Ermishina + ## Running Python Files in this Repository - **Running a plain Python script**: From 3b756c3e7c611bda8b4333b04cc2acdad93431a3 Mon Sep 17 00:00:00 2001 From: Dadi Ishimwe Date: Sat, 8 Feb 2025 10:05:24 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 56f99dd..e1f250f 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ 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. -Group name: Salle 8 -Group members: Dadi Ishimwe - Robel Mengsteab - Safa Saber - Louis Kervens Hubert - M Jawid Mohseni - Mohamed El - nageeb - Franklyn Abanihe - Mariia Ermishina +**Group name: Salle 8** +**Group members:** - Dadi Ishimwe + - Robel Mengsteab + - Safa Saber + - Louis Kervens Hubert + - M Jawid Mohseni + - Mohamed El - nageeb + - Franklyn Abanihe + - Mariia Ermishina ## Running Python Files in this Repository