You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/books/disa_stig/disa_stig_part3.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,14 +12,14 @@ tags:
12
12
13
13
# Introduction
14
14
15
-
In part 1 of this series we covered how to build our web server with the base RHEL8 DISA STIG applied, and in part 2 we learned how to test the STIG compliance with the OpenSCAP tool. Now we’re going to actually do something with the system, and build a simple web application and apply the DISA web server STIG: <https://www.stigviewer.com/stig/web_server/>
15
+
In part 1 of this series, we covered how to build our web server with the base RHEL8 DISA STIG applied, and in part 2, we learned how to test the STIG compliance with the OpenSCAP tool. Now we’re going to do something with the system, build a simple web application and apply the DISA web server STIG: <https://www.stigviewer.com/stig/web_server/>
16
16
17
-
First lets compare what we’re getting into here, the RHEL 8 DISA STIG is targeted at a very specific platform so the controls are pretty easy to understand in that context, test, and apply. Application STIGs have to be portable across multiple platforms, so the content here is generic in order to work on different linux distributions (RHEL, Ubuntu, SuSE, etc)**. This means that tools like OpenSCAP won’t help us audit/remediate the configuration, we’re going to have to do this manually. Those STIGs are:
17
+
First lets compare what we’re getting into here, the RHEL 8 DISA STIG is targeted at a very specific platform so the controls are pretty easy to understand in that context, test, and apply. Application STIGs have to be portable across multiple platforms, so the content here is generic to work on different Linux distributions (RHEL, Ubuntu, SuSE, etc)**. Tools like OpenSCAP won’t help us audit/remediate the configuration. We’re going to have to do this manually. Those STIGs are:
18
18
19
-
* Apache 2.4 V2R5 - Server; which applies to the web server itself
20
-
* Apache 2.4 V2R5 - Site; Which applies to the web application / web site
19
+
* Apache 2.4 V2R5 - Server, which applies to the web server itself
20
+
* Apache 2.4 V2R5 - Site, which applies to the web application / website
21
21
22
-
For our guide, we’re going to create a simple web server that does nothing more than serve static content. We can use the changes we make here to make a base image and then use this base image when we build more complex web servers later.
22
+
For our guide, we will create a simple web server that does nothing more than serve static content. We can use the changes we make here to make a base image, and then we can use this base image when we build more complex web servers later.
23
23
24
24
## Apache 2.4 V2R5 Server Quickstart
25
25
@@ -68,7 +68,7 @@ systemctl start httpd
68
68
69
69
## Detail Controls Overview
70
70
71
-
If you’ve gotten this far, you’re probably interested in knowing more about what the STIG wants us to do. It helps to understand the importance of the control, and then how it applies to the application. Sometimes the control is technical (change X setting to Y) and other times it's operational (how you use it). Generally speaking, a technical control is something you can change with code, and an operational control probably isn’t.
71
+
If you’ve gotten this far, you’re probably interested in knowing more about what the STIG wants us to do. It helps to understand the importance of the control and how it applies to the application. Sometimes, the control is technical (change X setting to Y); other times, it's operational (how you use it). Generally speaking, a technical control is something you can change with code, and an operational control probably isn’t.
72
72
73
73
### Levels
74
74
@@ -81,7 +81,7 @@ If you’ve gotten this far, you’re probably interested in knowing more about
81
81
* Technical - 24 controls
82
82
* Operational - 23 controls
83
83
84
-
We’re not going to cover the "why" for these changes in this article, just what needs to happen if it is a technical control. If there is nothing we can change like in the case of an Operational control, the **Fix:** field will be none. The good news in a lot of these cases, this is already the default in Rocky Linux 8, so you don’t need to change anything at all.
84
+
We’re not going to cover the "why" of these changes in this article; we'll discuss what needs to happen if it is a technical control. If there is nothing we can change, like in the case of an Operational control, the **Fix:** field will be none. The good news in a lot of these cases is that this is already the default in Rocky Linux 8, so you don’t need to change anything at all.
Copy file name to clipboardExpand all lines: docs/books/web_services/053-load-balancer-proxies-squid.md
+49-49Lines changed: 49 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
author: Antoine Le Morvan
3
-
contributors:
3
+
contributors: Ganna Zhyrnova
4
4
title: Part 5.3 Squid
5
5
tags:
6
6
- squid
@@ -10,11 +10,11 @@ tags:
10
10
11
11
## Squid
12
12
13
-
In this chapter, you will learn about Squid, the HTTP proxy cache.
13
+
This chapterwill teach you about Squid, the HTTP proxy cache.
14
14
15
15
****
16
16
17
-
**Objectives**: In this chapter, you will learn how to:
17
+
**Objectives**: You will learn how to:
18
18
19
19
:heavy_check_mark: install squid
20
20
:heavy_check_mark: configure it to be a proxy and cache HTTP content.
@@ -32,22 +32,22 @@ In this chapter, you will learn about Squid, the HTTP proxy cache.
32
32
33
33
Setting up a proxy server involves choosing between two types of architecture:
34
34
35
-
* A standard proxy architecture, requiring specific configuration of each client and their web browsers
35
+
* A standard proxy architecture requiring specific configuration of each client and their web browsers
36
36
* Captive proxy architecture, which involves intercepting the frames sent by the client and rewriting them to the proxy server
37
37
38
-
In either case, a break in the network occurs: A client can no longer physically address a remote server directly, without going through a proxy server.
38
+
In either case, a break in the network occurs: A client can no longer physically address a remote server directly without going through a proxy server.
39
39
40
-
Two firewalls protect the client workstation, never communicating directly with the outside network.
40
+
Two firewalls protect the client workstation but never communicate directly with the outside network.
This architecture requires browser configuration on the client workstation.
47
47
48
-
There is no need to configure all client workstations with a captive proxy.
48
+
You don't need to configure all client workstations with a captive proxy.
49
49
50
-
The configuration takes place at the gateway level, which receives the client requests and transparently rewrites the frames to send them to the proxy.
50
+
The configuration occurs at the gateway level, where it receives client requests and transparently rewrites the frames to send them to the proxy.
@@ -57,18 +57,18 @@ The configuration takes place at the gateway level, which receives the client re
57
57
58
58
In the case of standard proxy or captive proxy architecture, one of the primary interests of this type of service is to act as a cache.
59
59
60
-
In this way, a file downloaded once from the WAN (and therefore potentially from a slower link than the LAN) stores itself in memory in the proxy-cache, for subsequent clients to use. In this way, bandwidth optimization of the slow link occurs.
60
+
In this way, a file downloaded once from the WAN (potentially from a slower link than the LAN) stores itself in memory in the proxycache for subsequent clients to use. This optimizes bandwidth on the slow link.
61
61
62
-
As you will see later, this is not the only use for a proxy.
62
+
As you will see later, there are other uses for a proxy.
63
63
64
64
Deploying a proxy can:
65
65
66
-
* Deny access to certain resources based on various parameters
66
+
* Deny access to specific resources based on various parameters
67
67
* Set up authentication and monitoring of clients' Internet activities
68
68
* Set up a hierarchy of distributed caches
69
69
* Hide the LAN architecture from a WAN point of view (how many clients are there on the LAN?)
70
70
71
-
The benefits are many:
71
+
Among the advantages are the following:
72
72
73
73
* Anonymity on the Internet
74
74
* Authentication
@@ -86,7 +86,7 @@ The benefits are many:
86
86
87
87
The proxy service becomes a critical service requiring high availability.
88
88
89
-
When operating a Squid Proxy server, the administrator has to exploit the logs. It is therefore essential to know the main HTTP response codes.
89
+
When operating a Squid Proxy server, the administrator must exploit the logs. Therefore, it is essential to know the main HTTP response codes.
90
90
91
91
| Code | Categories |
92
92
|------|------------------------|
@@ -98,17 +98,17 @@ When operating a Squid Proxy server, the administrator has to exploit the logs.
98
98
99
99
Examples:
100
100
101
-
* 200: ok
102
-
* 301: Moved Permanently
103
-
* 302: Moved Temporarily
104
-
* 304: Not modified
105
-
* 400: Bad request
106
-
* 401: Unauthorized
107
-
* 404: Not found
101
+
* 200: ok
102
+
* 301: Moved Permanently
103
+
* 302: Moved Temporarily
104
+
* 304: Not modified
105
+
* 400: Bad request
106
+
* 401: Unauthorized
107
+
* 404: Not found
108
108
109
109
#### About Squid
110
110
111
-
Squid supports HTTP and ftp protocols.
111
+
Squid supports HTTP and FTP protocols.
112
112
113
113
The advantages of installing a solution based on the Squid server:
114
114
@@ -148,24 +148,24 @@ Service logs (stop and restart) are in `/var/log/squid.cache.log`, while client
148
148
149
149
The `squid` command controls the squid server.
150
150
151
-
Syntaxe of the command:
151
+
Syntax of the command:
152
152
153
153
```bash
154
154
squid [-z|-s|-k parse|-k rotate]
155
155
```
156
156
157
157
| Option | Description |
158
158
|-------------|------------------------------|
159
-
|`-z`|Initialize cache directories |
159
+
|`-z`|Initializes cache directories |
160
160
|`-s`| Enables syslog logging |
161
161
|`-k parse`| Test configuration file |
162
162
|`-k rotate`| Rotates logs |
163
163
164
-
Logging client requests can quickly lead to the storage of large amount of data.
164
+
Logging client requests can quickly lead to storing large amounts of data.
165
165
166
166
It is a good idea to regularly create a new log file and archive the old one in compressed format.
167
167
168
-
Do this either manually, with the `-k rotate` option of the `squid` command, or automatically with the dedicated Linux service `logrotate`.
168
+
You can do this either manually, with the `-k rotate` option of the `squid` command, or automatically with the dedicated Linux service `logrotate`.
169
169
170
170
### Configuration
171
171
@@ -179,7 +179,7 @@ http_port num_port
179
179
180
180
!!! Note
181
181
182
-
By default, the port number is set to 3128, but it is frequently changed to 8080. Do not forget to open the corresponding firewall port!
182
+
The port number is set to 3128 by default but frequently changes to 8080. Remember to open the corresponding firewall port!
183
183
184
184
When the service restarts, the Squid server will listen on the port defined by the `http_port` directive.
185
185
@@ -203,15 +203,15 @@ cache_mem 1 GB
203
203
204
204
The Internet Cache Protocol (ICP) enables neighboring Squid servers to exchange requests. It is common practice to propose a hierarchy of proxies that share their information bases.
205
205
206
-
The `icp_port` directive defines the port number Squid uses to send and receives ICP requests from neighboring Squid servers.
206
+
The `icp_port` directive defines the port number Squid uses to send and receive ICP requests from neighboring Squid servers.
207
207
208
208
!!! Tip
209
209
210
210
Set to 0 to deactivate.
211
211
212
212
* Anonymous FTP user `ftp_user`
213
213
214
-
The `ftp_user` directive associates an FTP user with anonymous FTP connections. The user must be a valid e-mail address.
214
+
The `ftp_user` directive associates an FTP user with anonymous FTP connections. The user must have a valid e-mail address.
215
215
216
216
```bash
217
217
ftp_user bob@rockylinux.lan
@@ -233,7 +233,7 @@ acl LUNCHTIME time 12:00-14:00
233
233
http_access deny LUNCHTIME
234
234
```
235
235
236
-
A larger discussion of ACLs is in the "Advanced configuration" section.
236
+
A more extensive discussion of ACLs is in the "Advanced configuration" section.
237
237
238
238
* Maximum size of a cached object `maximum_object_size`
239
239
@@ -249,7 +249,7 @@ Example:
249
249
maximum_object_size 32 MB
250
250
```
251
251
252
-
If the object size is greater than the `maximum_object_size` limit, the object is not cached.
252
+
The object is not cached if the object size is greater than the `maximum_object_size` limit.
253
253
254
254
* Proxy server name `visible_hostname`
255
255
@@ -267,15 +267,15 @@ visible_hostname proxysquid
267
267
268
268
!!! Note
269
269
270
-
The value supplied may be different from the host name.
270
+
The value supplied may be different from the hostname.
271
271
272
272
* Define a cache for squid `cache_ufs`
273
273
274
274
```bash
275
275
cache_ufs format path size nbFolderNiv1 nbFolderNiv2
276
276
```
277
277
278
-
It is possible to define multiple caches on different file systems to optimize access times.
278
+
IDefining multiple caches on different file systems to optimize access times is possible.
279
279
280
280
Example:
281
281
@@ -371,15 +371,15 @@ acl XXX proto HTTP FTP
371
371
372
372
Different cache algorithms exist with different characteristics:
373
373
374
-
* LRU - *Least Recently Used*: removes the oldest objects from RAM
374
+
* LRU - *Least Recently Used*: removes the oldest objects from the RAM
375
375
* LRU-THOLD: copies an object to the cache according to its size
376
376
* MRU: *Most Recently Used*: deletes the least requested data
377
-
* GDSF: *Greedy Dual Size Frequency*: deletes according to original size and access time with the smallest retained.
378
-
* LFUDA: *Least Frequently Used With Dynamic Aging*: same as GDSF, but without the notion of size. Useful for caches with large files.
377
+
* GDSF: *Greedy Dual Size Frequency*: deletes according to original size and access time with the smallest retained
378
+
* LFUDA: *Least Frequently Used With Dynamic Aging*: same as GDSF, but without the notion of size. Useful for caches with large files
379
379
380
380
#### Client authentication
381
381
382
-
Squid relies on external programs to manage authentication. Basing it on a simple flat file such as `htpasswd`is possible, or on LDAP, SMB, PAM or other services.
382
+
Squid relies on external programs to manage authentication. It can be based on a simple flat file such as `htpasswd` or on LDAP, SMB, PAM, or other services.
383
383
384
384
Authentication can also be a legal necessity. Remember to get your users to sign a usage charter!
The content is not cached here as you are requesting an `https`connexion to the remote server.
499
+
The content is not cached here as you request an `https`connection to the remote server.
500
500
501
-
#### Task 3: Configure DNS to use your proxy server
501
+
#### Task 3: Configure DNS to use your proxy server
502
502
503
503
Edit the `/etc/dnf/dnf.conf` file to use the proxy squid:
504
504
@@ -527,15 +527,15 @@ Verify on your terminal that the `dnf` connection uses your proxy to download it
527
527
1723794176.255 1 192.168.1.10 TCP_HIT/200 655447 GET http://miroir.univ-lorraine.fr/rocky/9.4/AppStream/x86_64/os/repodata/1af312c9-7139-43ed-8761-90ba3cd55461-UPDATEINFO.xml.gz - HIER_NONE/- application/x-gzip
528
528
```
529
529
530
-
In this example, you can see one connection with a TCP_MISS (not present in the cache) and another one with TCP_HIT (use the cache to answer the client).
530
+
In this example, you can see one connection with a TCP_MISS (not present in the cache) and another with TCP_HIT (use the cache to answer the client).
531
531
532
532
### Conclusion
533
533
534
-
Congratulations! You now have the knowledge you need to install squid on your local network, enabling you to centralize your outgoing connections to the Internet and secure your local network.
534
+
You now have the knowledge you need to install Squid on your local network. This will enable you to centralize your outgoing connections to the Internet and secure your local network.
535
535
536
536
### Check your Knowledge
537
537
538
-
:heavy_check_mark: What is the port listened per default by a squid server?
538
+
:heavy_check_mark: What is the port listened to by a squid server per default?
0 commit comments