In-class Group Quiz
- Determine which access control model is more appropriate: RBAC or ABAC and explain why the chosen model is more suitable for this environment.
We’ll use ABAC
- Access decision cannot be based on the role, so that’s why we crossed out RBAC at the first place.
- Because it should be fine-grain access control policy.
- Environment Attributes
- For the restriction 3: Using ABAC we can apply enforcing to environment attributes (context-based) like time period (to access the system) should be within working hours only!
- Some engineering documents are accessible only to members of specific projects, we can assign access control based on users’ attribute (what project they enrolled in, for example.)
- For restriction 5: remote access should be restircted, once confirmed that this should be ABAC, in the way that we can customize the Environment Attributes** to be at specific location only!
- Write access control policies which should contains upto 5 rules or just ONE integrated rule to satisfy the requirements.
func access(employee: Employee, document: Doc) -> Bool {
guard employee.department == document.department else { return false }
guard document.type != "Confidential" || employee.level > 10 else { return false }
guard document.type != "Financial" || Date.current(between: 08:00, and: 18:00) else { return false }
guard document.type != "Engineering" || employee.projects.contains(document.project) else { return false }
guard document.confidentiality != "High" || employee.recentLoginLocation == "HQ" else { return false }
return true
}To strengthen security, the company imposes the following restrictions:
- Employees should normally access documents belonging to their department.
- Highly confidential documents maybe accessed only by employees with appropriate clearance.
- Certain financial documents may be accessed only during working hours (08:00-18:00).
- Some engineering documents are accessible only to members of specific projects.
- Remote access should be restricted for highly confidential documents.
Suggest new conversation accepted for message db2b3ed2-73cb-4d63-9c99-5914445b1930
Federated Identity Management (FIM) System Design
1. Required Components
Identity Provider (IdP)
Each member institution (university or research institute) acts as an IdP — the authoritative source for authenticating its own users. The IdP:
- Maintains the user directory (via LDAP, Active Directory, etc.)
- Validates user credentials (username/password, MFA)
- Issues signed identity assertions/tokens containing user attributes (name, email, role, affiliation)
- Is trusted by the Service Provider to vouch for its users' identities
Example: MIT's Shibboleth IdP, Stanford's OIDC server.
Service Provider (SP)
The shared cloud research platform (hosted on a CSP) is the SP. It:
- Does not store or verify user credentials directly
- Relies entirely on IdP-issued tokens for authentication
- Receives and validates assertions, then grants access based on user attributes
- Exposes multiple sub-services (datasets, compute clusters, repositories, collaborative docs)
Federation Trust Relationship
This is the formal multilateral trust agreement among all IdPs and the SP. Key aspects:
| Aspect | Description |
|---|---|
| Circle of Trust | All member institutions agree to honor each other's assertions |
| Metadata Exchange | Each party shares endpoint URLs, entity IDs, and X.509 certificates |
| Federation Operator | A neutral broker (e.g., InCommon, eduGAIN) registers members and manages the shared metadata registry |
| Attribute Release Policy | Defines which user attributes each IdP will release to the SP |
| Trust is established before any user authentication occurs — it is an administrative/cryptographic contract, not a runtime negotiation. |
Authentication Protocol
For an academic research consortium, SAML 2.0 is the industry standard (used by InCommon/eduGAIN globally), with OpenID Connect (OIDC) as the modern alternative for API-based services.
SAML 2.0 (recommended primary protocol):
- XML-based assertion format
- Natively supported by Shibboleth, widely deployed in academia
- Supports signed and encrypted assertions
- Flows: SP-initiated SSO, IdP-initiated SSO
OpenID Connect / OAuth 2.0 (recommended for modern/API services):
- JSON/JWT-based, REST-friendly
- Better suited for mobile clients and REST APIs
- Uses Authorization Code Flow with PKCE for security
For this consortium, a hybrid approach is ideal — SAML 2.0 for legacy academic systems and OIDC for newer cloud-native services, bridged via a Federation Proxy/Hub.
2. Federated Authentication Flow Diagram
┌──────────────────────────────────────────────────────────────────────────┐
│ FEDERATION TRUST LAYER (eduGAIN/InCommon) │
│ [Shared Metadata Registry — certificates, endpoints] │
└────────────────────────┬─────────────────────────┬───────────────────────┘
│ Pre-established Trust │
┌──────────────┴──────────────┐ │
│ │ │
┌─────────▼─────────┐ ┌──────────▼───────┐ │ ┌───────────────────┐
│ University A IdP │ │ Institute B IdP │ │ │ University C IdP │
│ (Shibboleth/AD) │ │ (OIDC Server) │ └───► (LDAP-backed) │
└─────────┬─────────┘ └──────────────────┘ └───────────────────┘
│
│ ════════════ AUTHENTICATION FLOW (Steps 1-8) ════════════
│
┌───────▼──────────────────────────────────────────────────────────────┐
│ │
│ [1] User (Researcher @ Univ A) accesses https://research-platform.org│
│ │
│ [2] SP has no session → redirects user to Discovery Service │
│ (Where Is Your Home Institution?) │
│ │
│ [3] User selects "University A" → browser redirected to Univ A IdP │
│ with SAML AuthnRequest (signed by SP) │
│ │
│ [4] IdP prompts user for credentials (+ MFA if configured) │
│ User enters: username + password + OTP │
│ │
│ [5] IdP authenticates user successfully │
│ IdP generates signed SAML Assertion containing: │
│ • NameID (persistent pseudonym) │
│ • Attributes: affiliation=researcher, email, entitlements │
│ • Validity window (NotBefore / NotOnOrAfter) │
│ • Audience restriction → SP Entity ID │
│ │
│ [6] Browser POSTs SAML Response (Base64-encoded) to SP │
│ Assertion Consumer Service (ACS) endpoint │
│ │
│ [7] SP validates the assertion: │
│ ✔ Signature valid (using IdP cert from metadata) │
│ ✔ Audience matches SP entity ID │
│ ✔ Timestamp within validity window │
│ ✔ No replay (assertion ID not seen before) │
│ │
│ [8] SP creates local session, maps attributes to access roles │
│ → User granted access to authorized research resources │
│ │
└──────────────────────────────────────────────────────────────────────┘
USER ──(1)──► RESEARCH PLATFORM (SP)
│
(2) No session → redirect
│
USER ──(3)──► DISCOVERY SERVICE ──► UNIVERSITY A IdP
│
(4) Login prompt
│
USER enters credentials + MFA
│
(5) IdP issues signed SAML Assertion
│
USER ──(6)──► SP (ACS Endpoint) ◄─────────┘
│
(7) Validate assertion
│
(8) Grant access to platform resources
3. Security Risks and Mitigation Strategies
Risk 1: SAML Assertion Forgery / Token Tampering
Description: An attacker crafts or modifies a SAML assertion to impersonate a legitimate user or escalate privileges (e.g., changing affiliation=student to affiliation=admin).
Mitigations:
- Digital signatures on all assertions using RSA-SHA256 or ECDSA — SP must reject any unsigned or invalidly signed assertion
- Assertion encryption (XML Encryption) to prevent attribute inspection in transit
- Enforce strict schema validation on received assertions at the SP
- Use certificate rotation policies and pin expected IdP certificates in SP metadata
Risk 2: Replay Attacks
Description: An attacker intercepts a valid SAML assertion (e.g., via XSS or browser history) and replays it to gain unauthorized access to the platform.
Mitigations:
- One-time assertion IDs — SP maintains a short-term cache of processed assertion IDs and rejects duplicates
- Short validity windows —
NotBefore/NotOnOrAftertimestamps restricted to 2–5 minutes maximum - Enforce TLS (HTTPS) on all endpoints to prevent interception in the first place
- Use
InResponseTobinding in SP-initiated flows to tie responses to specific requests
Risk 3: Compromised Identity Provider (IdP Breach)
Description: If a single institution's IdP is compromised, an attacker can issue arbitrary valid assertions for all users of that institution, gaining access to all shared platform resources under trusted identities.
Mitigations:
- Mandatory MFA across all IdPs as a federation membership requirement — mitigates credential theft even if the IdP account store is breached
- Risk-based / step-up authentication — SP triggers re-authentication for sensitive resources (e.g., raw research data, admin panels)
- Attribute-based access control (ABAC) with least-privilege defaults — a compromised researcher account cannot access admin or compute cluster provisioning
- Security monitoring & anomaly detection at the SP — alert on unusual login patterns (geographic anomaly, access to atypical resources)
- Federation revocation process — the Federation Operator can rapidly remove a compromised IdP from the trusted metadata registry
Summary Table
| Risk | Attack Vector | Primary Mitigation |
|---|---|---|
| Assertion Forgery | Token tampering / crafting | Digital signatures + encryption |
| Replay Attack | Intercepted token reuse | One-time IDs + short TTL + TLS |
| IdP Compromise | Breached home institution | MFA mandate + step-up auth + ABAC |