Tuesday, April 30, 2024

JIT Access

Just-in-Time Access

a.k.a.:

  • Just-In-Time (JIT) Permission Management
  • Just-In-Time Privileged Access Management (JIT PAM)

TL;DR

Grant as little access for as short of a time as possible and record/audit access.

JIT access workflow

At any given point, a JIT access system takes three things into account—location (where a user will utilize a privilege), action (what a user will do with the privilege), and time (for how long the privilege will be available). Here is how it works: 
  1. A user initiates a request for privileged access to a resource such as a network or virtual machine.
  2. The request now undergoes an approval process that is typically automated for efficiency. If not, an administrator with the requisite authority manually approves or rejects the privileged access request.
  3. If approved, the user gains the necessary level of privilege tailored for the task at hand. Note that the access is temporary and remains active for the duration needed to complete the designated task.
  4. Once the user concludes their task and logs out, the access privilege automatically expires, or the account is temporarily deactivated until the next instance.

Types of Just-In-Time Access

Broker and Remove Access or Justification-Based Access

This approach enables the creation of policies that require users to provide a justification for connecting to a specific target for a defined period of time. Typically, these users have a standing, privileged shared account and credentials for that account are managed, secured and rotated in a central vault and unknown to users even after using them to reduce the risk of privilege abuse.

Ephemeral Accounts

This just-in-time access solution mitigates risks through the provision of short-lived or one-time accounts. In this case, you create a temporary account to give a user limited access to complete a specific task. 

If a low-level or third-party user needs access to a resource, rather than creating a standard account, an ephemeral account is the best solution. This is because giving them access to a business-sensitive infrastructure for a long time can become a risk that malicious users can exploit. 

You create dynamic access using a one-time account that gives the user temporary privileges until the task is done. After completing the task, the account is automatically disabled or deleted.  

Temporary Elevation or Privilege Elevation

A user makes a request if they need a higher level of privileged access to perform a task. This approval is either granted by an automated system or manually approved by the administrator with specifics on how long the task will take.

This JIT access is designed to reduce the amount of time a user spends on a critical system. Once the time allocated to complete the task elapses, the system takes away the user’s privilege to access the system.

JIT Access: Best Practices 

Identify critical assets

Begin by identifying the accounts and assets with the most privileges, particularly those belonging to administrators, which pose the highest risk. Implement JIT access control for these accounts first and then gradually extend it throughout the organization.

Use role-based access control (RBAC)

Utilize role-based access control (RBAC) as supplementary solutions to define granular policies and circumstances for elevated access. Categorize accounts, differentiate their rights, and create control policies that users must satisfy to gain access. 

Define and enable temporary access

Apart from justification-based access, establish criteria for users requesting temporary access, including which accounts are eligible and the duration of access. Implement time-based controls, such as granting access to specific resources during predefined days and times. 

Record and audit activity 

An automated access management solution enables you to log all access activities, receive alerts for suspicious behavior, and record JIT-privileged access. Maintaining a comprehensive digital paper trail is essential for auditing, governance, and compliance with regulations such as SOC2 and PCI-DSS. 

Assign responsibility

Delegate responsibilities to employees and determine who will review permission requests. Properly training employees on granting and revoking access, especially during critical incidents like “break glass” and “on-call” situations, minimizes the risk of incidents. Automated JIT facilitates configuring access flows for these scenarios, helping resolve incidents promptly and eliminating bottlenecks. 

Use short-lived (ephemeral) credentials

Regularly rotate credentials manually to invalidate them, preventing hackers from exploiting stolen passwords. Employ a centralized vault with the highest level of security clearance to manage these credentials effectively. 

source: https://devops.com/what-is-just-in-time-jit-permission-management-and-why-is-it-essential/

Microsoft Entra Privileged Identity Management

Privileged Identity Management provides time-based and approval-based role activation to mitigate the risks of excessive, unnecessary, or misused access permissions on resources that you care about. Here are some of the key features of Privileged Identity Management:

  • Provide just-in-time privileged access to Microsoft Entra ID and Azure resources
  • Assign time-bound access to resources using start and end dates
  • Require approval to activate privileged roles
  • Enforce multifactor authentication to activate any role
  • Use justification to understand why users activate
  • Get notifications when privileged roles are activated
  • Conduct access reviews to ensure users still need roles
  • Download audit history for internal or external audit
  • Prevents removal of the last active Global Administrator and Privileged Role Administrator role assignments

source: https://learn.microsoft.com/en-us/entra/id-governance/privileged-identity-management/pim-configure

Related Terms


Friday, August 11, 2023

Marker Interface

The marker interface pattern is a design pattern in computer science, used with languages that provide run-time type information about objects. To use this pattern, a class implements a marker interface (also called tagging interface) which is an empty interface, and methods that interact with instances of that class test for the existence of the interface. Whereas a typical interface specifies functionality (in the form of method declarations) that an implementing class must support, a marker interface need not do so. The mere presence of such an interface indicates specific behavior on the part of the implementing class. 

source: https://en.wikipedia.org/wiki/Marker_interface_pattern

See also: Marker Interface Isn’t a Pattern or a Good Idea by Erik Dietrich, NDepend


Friday, August 4, 2023

Code Smell

"A code smell is a surface indication that usually corresponds to a deeper problem in the system. The term was first coined by Kent Beck while helping me with my [Martin Fowler] Refactoring book.

The quick definition above contains a couple of subtle points. Firstly a smell is by definition something that's quick to spot - or sniffable as I've recently put it. A long method is a good example of this.

The second is that smells don't always indicate a problem. Some long methods are just fine. You have to look deeper to see if there is an underlying problem there - smells aren't inherently bad on their own - they are often an indicator of a problem rather than the problem themselves." ~ Martin Fowler

source: https://martinfowler.com/bliki/CodeSmell.html

During code reviews, when you sniff a smell, link to the 'Smells and Heuristics' chapter from Bob Martin's excellent book: Clean Code

Clean Code: Smells and Heuristics

Suggested:


 

Friday, July 7, 2023

Zeigarnik Effect

When we finish a task, we get
closure and stop thinking about it.
When we don’t finish tasks, we
keep thinking about them.
We yearn for completion.

Defined by Bluma Zeigarnik, a Lithuanian-Soviet psychologist who in the 1920s conducted a study on memory, in which she compared memory in relation to incomplete and complete tasks.

In her study, Zeigarnik found a strong correlation between the memory of an incomplete task and the desire to close the loop. She declared that if we have tasks that are incomplete, we consume brainpower by holding onto the memory; our subconscious continues to remind (or nag) our conscious mind.

A few open loops might be good for our productivity; they remind us to bring these tasks to completion.

If there are too many open loops, however, you may suffer cognitive overload: that feeling of stress that comes when a significant amount of mental resources are tied up.

source: Agile Coffee

On the positive side is the adage "always leave them wanting more". Intentionally stopping a task before you are exhausted can be a motivation to get back to that task again soon.

Saturday, April 15, 2023

monotonic sequence

A monotonic sequence is always increasing or always decreasing. Monotonicity does not imply uniform increasing (or decreasing) values. That is, the values may not be strictly sequential. While 1, 2, 3, 4 is a monotonic sequence, so is 4, 125, 291, 1424. 

Example usage: ServiceBusReceivedMessage.SequenceNumber Property

The sequence number is a unique 64-bit integer assigned to a message as it is accepted and stored by the broker and functions as its true identifier. For partitioned entities, the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase. They roll over to 0 when the 48-64 bit range is exhausted.

That it can roll over means it's not strictly monotonic.

Monotonicity in election methods

Monotonicity is an election method criterion that requires the following:

Ranking or rating a candidate higher should never cause that candidate to lose, nor should ranking or rating a candidate lower ever cause that candidate to win, assuming all other candidates remain rated or ranked the same.

In other words, an election method is non-monotonic if either of the following is possible:

  • A winner can be changed to a loser by experiencing an increase in support, OR
  • A loser can be changed to a winner by experiencing a decrease in support.

One noteworthy non-monotonic election method is instant runoff voting (IRV).

source: https://electionscience.org/library/monotonicity/


Tuesday, December 6, 2022

cargo cult

During World War II, American troops arrived by planes and ships to some Pacific islands and, during their stay, gave goods to the inhabitants. When the war ended, the troops stopped going to the islands and the natives stopped receiving the precious goods and gifts. And then there was an eye-catching phenomenon: the natives began to build monuments shaped like airplanes. They believed that by repeating exactly what they had seen those gods from heaven do, more planes would magically come with goods and gifts.

This phenomenon is what we call Cargo Cult. The concept is used as a metaphor to describe a very valid problem: the effort to try to replicate certain results by mimicking behaviors – rituals – without understanding the true causes that lead to those results.

source: The Opposite of Agility: Rituals, Ceremonies, and the Cargo Cult

See also: dogmatism (twotw)

Saturday, August 6, 2022

Strangler Fig pattern

Incrementally migrate a legacy system by gradually replacing specific pieces of functionality with new applications and services. As features from the legacy system are replaced, the new system eventually replaces all of the old system's features, strangling the old system and allowing you to decommission it.

source: https://docs.microsoft.com/en-us/azure/architecture/patterns/strangler-fig

Modernize an application by incrementally developing a new (strangler) application around the legacy application. In this scenario, the strangler application has a microservice architecture.


source: https://microservices.io/patterns/refactoring/strangler-application.html

Short blog by Martin Fowler on the etymology: StranglerFigApplication

Saturday, May 7, 2022

Onion Software Architecture

Onion Architecture is based on the inversion of control principle. Onion Architecture is comprised of multiple concentric layers interfacing each other towards the core that represents the domain.

Onion Architecture solved these problem by defining layers from the core to the Infrastructure. It applies the fundamental rule by moving all coupling towards the center. This architecture is undoubtedly biased toward object-oriented programming, and it puts objects before all others. At the center of Onion Architecture is the domain model, which represents the business and behavior objects. Around the domain layer are other layers, with more behaviors.

Domain Layer

At the center part of the Onion Architecture, the domain layer exists; this layer represents the business and behavior objects. The idea is to have all of your domain objects at this core. It holds all application domain objects. Besides the domain objects, you also could have domain interfaces. These domain entities don’t have any dependencies. Domain objects are also flat as they should be, without any heavy code or dependencies.

Repository Layer

This layer creates an abstraction between the domain entities and business logic of an application. In this layer, we typically add interfaces that provide object saving and retrieving behavior typically by involving a database. This layer consists of the data access pattern, which is a more loosely coupled approach to data access.

Services Layer

The Service layer holds interfaces with common operations, such as Add, Save, Edit, and Delete. The Service layer also could hold business logic for an entity. In this layer, service interfaces are kept separate from its implementation, keeping loose coupling and separation of concerns in mind.

UI Layer

It’s the outer-most layer, and keeps peripheral concerns like UI and tests. For a Web application, it represents the Web API or Unit Test project. This layer has an implementation of the dependency injection principle so that the application builds a loosely coupled structure and can communicate to the internal layer via interfaces.

source: https://www.codeguru.com/csharp/understanding-onion-architecture/

More: https://jeffreypalermo.com/tag/onion-architecture/