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
18 changes: 18 additions & 0 deletions challenges/Collaboration README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@


This is collaboative work repository of group 11:

Nada Saad

Fatima Malik

Kefah Albashityalshaer

Pierre Kenley MERVIL

Pyae Linn

Said Ibrahim

Anna Shumylina

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

"""

A=bool()
B=bool()

def simplify_expression(A, B):
# Original expression: ¬(A ∧ (B ∨ ¬B))
# Step 1: Simplify (B ∨ ¬B) to True
inner_expression = True # Since B ∨ ¬B is always True
# Step 2: Simplify A ∧ True to A
intermediate_expression = A and inner_expression # A ∧ True = A
# Step 3: Apply the negation
final_expression = not intermediate_expression # ¬A
return final_expression

# Example usage:
A = True # User has correct credentials
B = True # Login attempt is from a trusted device

result = simplify_expression(A, B)

if result:
print ('Login incorrect. Please enter valid login')
else: print ('Login correct.')
30 changes: 30 additions & 0 deletions challenges/challenge2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,33 @@
# -*- 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?
Access_One_type=finance_access.union(tech_access).union(admin)

#Who has access to both financial and technical data?
Access_both_types=finance_access.intersection(tech_access).union(admin)

#Who has exclusive access to only one type of data?
Access_one_type_only=finance_access.symmetric_difference(tech_access)
print (Access_one_type_only)

#Which employees currently lack access (but exist in the system)?
print ("New employee has no access!", new_employee)

#Are there unnecessary overlaps in access that could pose a security risk?
print("Access to both types is an unnecessary intersection.", Access_both_types)

#What changes would you recommend to enhance security and minimize excessive access?
print("Security Recommendations: Restrict access according to the roles and responsibilities")




40 changes: 40 additions & 0 deletions challenges/challenge3.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,43 @@
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

finance_access = {"E0435", "E1021", "E3098", "E7642", "E8873", "E6590"}

tech_access = {"E7642", "E8873", "E6590", "E9812", "E4520"}

admin={"E0001"}

new_employee={"E9999"}

venn_values = (finance_access, tech_access, admin, new_employee)
venn_labels = ('Finance', 'Tech', 'Admin', 'New employee')

venn=venn2(subsets=venn_values, set_labels=venn_labels)
plt.show()

"""

from matplotlib_venn import venn2
import matplotlib.pyplot as plt

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

#Venn diagram
venn2(subsets=(len(finance_access - tech_access),
len(tech_access - finance_access),
len(finance_access.intersection(tech_access))),
set_labels=("Finance Access", "Tech Access"))

# For adding title and colors
plt.title("Employee Access Control Visualization")
plt.annotate("Admin: Full Access", xy=(-0.6, -0.5))
plt.annotate("New Employee: No Access", xy=(-0.6, -0.6))
plt.show()