Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configure Firewall User Authentication with Unified Policies

SUMMARY Read this example to understand how to configure pass-through authentication and web authentication in a unified policy to restrict or permit users to access network resources.

Overview

Firewall user authentication enables you to authenticate users before users can access network resources behind a firewall. When you've enabled firewall user authentication, a user must provide a username and password for authentication when initiating a connection across the firewall.

Starting in Junos OS Release 21.2R1, we support firewall user authentication with unified policies. Support is available for both pass-through authentication and Web authentication. Table 1 provides workflow for pass-through authentication and Web authentication methods.

Table 1: Firewall User Authentication with Unified Policies Workflow
Firewall User Authentication Method Workflow
Pass-Through Authentication with a Traditional Security Policy and a Unified Policy
Pass-Through Authentication with a Traditional Security Policy and a Unified Policy with Dynamic Application as "any"
  • The unified policy enforces firewall authentication based on the pre-defined application such as FTP, Telnet, HTTP, or HTTPS service port as per the dynamic-application configured as “any” in the policy. In case a user sends traffic with other service port, and eventually the traffic could be identified as dynamic-application junos:HTTP, this traffic does not trigger the firewall authentication.
  • After successful authentication, the unified policy permits or blocks subsequent traffic that matches the unified policy rules.

See Configuration of Pass-Through Authentication with Unified Policy.

Web Authentication with a Unified Policy
  • The unified policy enforces firewall authentication when a user opens a browser and enters the IP address of the interface. The interface that users access must be enabled for the Web authentication.
  • After successful authentication, the unified policy permits or blocks subsequent traffic that matches the unified policy rules.

See Configuration of Web Authentication with Unified Policy.

Topology

Figure 1 shows the topology used in this example.
Figure 1: Topology: Configuring Firewall User Authentication with Unified PolicyTopology: Configuring Firewall User Authentication with Unified Policy

As shown in the topology, firewall users in the untrust zone need to access an external server (IP address 10.1.2.1) in the trust zone. The user authenticates with the security device before accessing the server. The device queries a local database to determine the authentication result. After successful authentication, the security device allows subsequent traffic from the same source IP address until the user's session times out and closes.

In this example, you'll configure the following functionality on the SRX Series Firewall:

  1. Configure a user database that is local to the security device in an access profile. Add one or more clients within the profile, representing end users. The client-name represents the username. Enter the password for each user in plain-text format.

  2. Associate access profile with pass-through or Web firewall authentication methods. Set a customized banner for display to the end user.
  3. Configure security policy to allow or restrict traffic and apply firewall user authentication for the allowed traffic.

Requirements

This example uses the following hardware and software components:

  • An SRX Series Firewall or vSRX Virtual Firewall
  • Junos OS Release 21.2R1

Before You Begin:

Configuration of Firewall User Authentication with Traditional Policy and Unified Policy

In this example, we'll configure pass-through authentication with both the traditional security policy and the unified policy. The configuration includes setting up security zones and interfaces, creating access profiles, and defining security policies as shown in the following table:
Table 2: Security Policies Details
Scenarios Policies Workflow When User Initiates a Session Result
Authentication with traditional security policy and unknown user Policy P1
  • Match criteria: source-identity -unknown/unauthenticated users
  1. Device searches for the user source identity in the user identification table (UIT).
  2. Policy considers the user as an unauthenticated-user if the source identity not available.
  3. Policy intercepts HTTP or HTTPS traffic from the user and triggers a firewall authentication prompt.
  4. After successful authentication, the policy permits or rejects the traffic based on the configured policy rules.
  5. Device creates an authentication entry in the user identification table by including IP address and username.
Permits an unauthenticated user after a successful firewall user authentication.
Authentication with unified policy and an authenticated user Policy P2
  • Match criteria: source-identity - authenticated-users
  • dynamic-application - junos:GOOGLE
  1. Device retrieves user and role information from the user identification table (UIT) if available.
  2. Security policy classifies the user as an authenticated user.
  3. After successful authentication, the policy permits or rejects the traffic based on the configured policy rules.
Permits an authenticated user without firewall user authentication.
Authentication with unified policy Policy P3
  • dynamic-application -junos:YAHOO
  1. Device searches the authentication profile PROFILE-1 to determine authentication result.
  2. After successful authentication, the policy permits or rejects the traffic based on the configured policy rules.
Permits traffic with firewall user authentication.

To redirect the traffic from an unauthenticated-user to a UAC captive portal for authentication, see Example: Configuring a User Role Firewall on an SRX Series Device.

CLI Quick Configuration

To quickly configure this example on your SRX Series Firewall, copy the following commands, paste them into a text file. Remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Step-by-Step Procedure

  1. Configure interfaces.

  2. Create security zones and assign the interfaces.

  3. Set up access profile and add user details.

    We've added two users CLIENT-1 and CLIENT-2 with passwords and assigned these users to client-group GROUP-1.

  4. Configure authentication methods and assign the access profile.

  5. Configure an SSL termination profile.

  6. Configure a security policy to permit unauthenticated users with firewall user authentication.

  7. Configure a security policy to permit authenticated users without firewall user authentication.

  8. Configure a security policy to permit the traffic with firewall user authentication.

  9. Add an entry to a local authentication table. Note that each entry must include an IP address.

Results

From configuration mode, confirm your configuration by entering the show security command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

[edit ][edit][edit]

[edit]

If you are done configuring the feature on your device, enter commit from configuration mode.

Verifying Firewall User Authentication Is Working

To verify that the firewall user authentication is working, open a Web browser on the client machine. Access the server by entering the server IP address 10.1.2.1. The system prompts for the login and password details as shown in Figure 2.

Figure 2: Pass-Through Authentication PromptPass-Through Authentication Prompt

After successfully entering the credentials, you can access the server.

Configuration of Pass-Through Authentication with Unified Policy

In this example, we'll configure pass-through authentication with a unified policy. The configuration includes setting up security zones and interfaces, creating access profiles, and defining a unified policy. In the unified policy, we define the match criteria dynamic application as any.

CLI Quick Configuration

To quickly configure this example on your SRX Series Firewall, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Step-by-Step Procedure

  1. Configure interfaces.

  2. Define security zones and assign interfaces.

  3. Set up access profile and add user details.

    We've added two users CLIENT-1 and CLIENT-2 with passwords and assigned the users to client-group GROUP-1.

  4. Configure authentication methods and assign the access profile.

  5. Configure an SSL termination profile.

  6. Configure a security policy with dynamic application as any.

Results

From configuration mode, confirm your configuration by entering the show security command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

[edit]

[edit]

[edit]

[edit]

If you are done configuring the feature on your device, enter commit from configuration mode.

Verifying Pass-Through Authentication Is Working

To verify that firewall user authentication is working, open a Web browser on the client machine. Access the server by entering server IP address 10.1.2.1. The system prompts for login and password details as shown in Figure 3.

Figure 3: Pass-Through Authentication PromptPass-Through Authentication Prompt

After successfully entering the credentials, you can access the server.

Configuration of Web Authentication with Unified Policy

In this example, we'll configure Web authentication with a unified policy. The configuration includes setting up security zones and interfaces, creating access profiles, and defining a unified policy. For Web authentication, we'll define a success banner for HTTP sessions.

CLI Quick Configuration

To quickly configure this example on your SRX Series Firewall, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Step-by-Step Procedure

  1. Create interfaces.

    Use a secondary IP address for the Web authentication. In this example, we're using 10.1.1.253/24 for web authentication. Note that the secondary IP address must use the same subnet as primary IP address.

  2. Create security zones and assign interfaces.

  3. Enable the interface for the Web authentication.
  4. Set up access profile and add user details.

    We've added two users CLIENT-1 and CLIENT-2 with passwords and assigned the users to client-group GROUP-1.

  5. Configure Web authentication properties

  6. Create a security policy with dynamic-application.

Results

From configuration mode, confirm your configuration by entering the show security command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

[edit]

[edit]

[edit]

[edit]

[edit]

If you are done configuring the feature on your device, enter commit from configuration mode.

Verifying Web Authentication Is Working

To verify that Web authentication is working, open a Web browser on the client machine. First, access the security device using a Web browser. Use the IP address 10.1.1.253 which we've configured for Web authentication. The device prompts for a username and password as shown in Figure 4.

Figure 4: Web Authentication PromptWeb Authentication Prompt

After successful authentication, the system displays the configured banner as shown in Figure 5, and you can get access to the server.

Figure 5: Web Authentication BannerWeb Authentication Banner

Verification

Monitoring Firewall Users

Purpose

Display firewall authentication user history to verify the firewall users details.

Action

From operational mode, enter these show commands:

Meaning

Command output provides details such as logged in users, authentication method used, profile applied, login attempts and so on.

Verifying Security Policy Utilization Details

Purpose

Display the utility rate of security policies according to the number of hits received.

Action

From operational mode, enter these show commands:

Meaning

Command output provides details on the security policies applied on the traffic.