Skip to content

Commit 270b88d

Browse files
chore: Update docs
1 parent 8aff7af commit 270b88d

5 files changed

Lines changed: 73 additions & 1 deletion

File tree

47.2 KB
Loading
14.1 KB
Loading

docs/user_guide/preset_policy.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ directory, but you can put it whever makes sense for your environment.
9999
ansible.builtin.set_fact:
100100
policy_match: true # Set the fact that we did match a policy
101101
source_address_group: PRESET_JUMPHOST_INBOUND_SOURCE # In this case, the policy preset is an address_group type
102+
destination_address_group: PRESET_JUMPHOST_INBOUND_DESTINATION # In this case, the policy preset is an address_group type
102103
application_group: PRESET_JUMPHOST_APPS # If an application is passed, we should also include it in the policy.
103104
device_group: Lab # Finally, we set the device group!
104105
when:
106+
- source_ip is defined
107+
- destination_ip is defined
105108
- "'10.10.11.0/24' | ansible.utils.network_in_network( destination_ip )"
106109
- "not '10.0.0.0/8' | ansible.utils.network_in_network( source_ip )"
110+
107111
```
108112

109113
### Including the policy
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Preset Policy - URL lists
2+
3+
Preset policy can also be based on URL lists based instead of IP. This is very useful when dealing with outbound user
4+
access to internet websites.
5+
6+
## Building a Sanctioned URL List-based policy
7+
8+
For URL category based policy, most of the time a "sanctioned" policy is simply based on the requesting user.
9+
10+
So your policy may look like this:
11+
12+
source user group | destination website
13+
--- |---------------------|
14+
Human Resources | www.facebook.com
15+
16+
!!! note
17+
This automation does not resolve users to user-groups. That's up to you.
18+
19+
## Creating the URL List
20+
21+
Create the URL Category as a URL list in Panorama.
22+
23+
![img.png](define_url_category.png)
24+
25+
## Defining the preset security rule
26+
27+
Now, create a new security rule that references the created URL category.
28+
29+
It's up to you how much you "lock down" this policy. You could use specific applications, IPs, ports...whatever makes
30+
sense for your environment.
31+
32+
![img.png](define_url_security_rule.png)
33+
34+
## Create a Policy Tasks File
35+
36+
(for more information on this, see [creating a policy tasks file](preset_policy.md#create-a-policy-tasks-file))
37+
38+
```yaml title="user_outbound_policy.yml"
39+
---
40+
- name: Match Users Internet Policy
41+
ansible.builtin.set_fact:
42+
policy_match: true # Set the fact that we did match a policy
43+
destination_url_category: PRESET_USER_OUTBOUND_URLS # In this case, the policy preset is a URL Category type
44+
device_group: Lab # Finally, we set the device group!
45+
when:
46+
- "source_user_group == 'Human Resources'"
47+
- url is defined
48+
```
49+
50+
## Including the policy
51+
52+
(for more information on this, see [including your sanctioned policy](preset_policy.md#including-the-policy))
53+
54+
```yaml title="add_policy.yml"
55+
# Outbound User access to websites
56+
- name: Test against outbound user access
57+
ansible.builtin.include_tasks:
58+
file: preset/user_outbound_policy.yml
59+
```
60+
61+
## Running the playbook
62+
63+
Note that nothing changes from the point of execution. You still run the same playbook, and as long as you're including
64+
`add_policy.yml`, any policies that define a destination_url_category will correctly update the category.
65+
66+
```shell
67+
ansible-playbook playbooks/orchestrator/lab_policy.yml
68+
```

playbooks/orchestrator/add_policy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
ansible.builtin.include_tasks:
2323
file: preset/ssh_jumpserver_inbound_access.yml
2424

25-
# SSH Jump Server Policy
25+
# Outbound User access to websites
2626
- name: Test against outbound user access
2727
ansible.builtin.include_tasks:
2828
file: preset/user_outbound_policy.yml

0 commit comments

Comments
 (0)