Skip to content

Commit c836df2

Browse files
authored
Merge branch 'main' into edits_wireguardvpn_sysctl
2 parents e6ea015 + d0f38ad commit c836df2

File tree

3 files changed

+69
-69
lines changed

3 files changed

+69
-69
lines changed

docs/books/disa_stig/disa_stig_part3.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ tags:
1212

1313
# Introduction
1414

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/>
1616

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:
1818

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
2121

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.
2323

2424
## Apache 2.4 V2R5 Server Quickstart
2525

@@ -68,7 +68,7 @@ systemctl start httpd
6868

6969
## Detail Controls Overview
7070

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.
7272

7373
### Levels
7474

@@ -81,7 +81,7 @@ If you’ve gotten this far, you’re probably interested in knowing more about
8181
* Technical - 24 controls
8282
* Operational - 23 controls
8383

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.
8585

8686
## Apache 2.4 V2R5 - Server Details
8787

docs/books/web_services/053-load-balancer-proxies-squid.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: Antoine Le Morvan
3-
contributors:
3+
contributors: Ganna Zhyrnova
44
title: Part 5.3 Squid
55
tags:
66
- squid
@@ -10,11 +10,11 @@ tags:
1010

1111
## Squid
1212

13-
In this chapter, you will learn about Squid, the HTTP proxy cache.
13+
This chapter will teach you about Squid, the HTTP proxy cache.
1414

1515
****
1616

17-
**Objectives**: In this chapter, you will learn how to:
17+
**Objectives**: You will learn how to:
1818

1919
:heavy_check_mark: install squid
2020
: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.
3232

3333
Setting up a proxy server involves choosing between two types of architecture:
3434

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
3636
* Captive proxy architecture, which involves intercepting the frames sent by the client and rewriting them to the proxy server
3737

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.
3939

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.
4141

4242
![Proxy-based architecture](img/squid-architecture-proxy.png)
4343

4444
!!! Note
4545

4646
This architecture requires browser configuration on the client workstation.
4747

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.
4949

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.
5151

5252
![Captive proxy-based architecture](img/squid-architecture-proxy-captif.png)
5353

@@ -57,18 +57,18 @@ The configuration takes place at the gateway level, which receives the client re
5757

5858
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.
5959

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 proxy cache for subsequent clients to use. This optimizes bandwidth on the slow link.
6161

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.
6363

6464
Deploying a proxy can:
6565

66-
* Deny access to certain resources based on various parameters
66+
* Deny access to specific resources based on various parameters
6767
* Set up authentication and monitoring of clients' Internet activities
6868
* Set up a hierarchy of distributed caches
6969
* Hide the LAN architecture from a WAN point of view (how many clients are there on the LAN?)
7070

71-
The benefits are many:
71+
Among the advantages are the following:
7272

7373
* Anonymity on the Internet
7474
* Authentication
@@ -86,7 +86,7 @@ The benefits are many:
8686

8787
The proxy service becomes a critical service requiring high availability.
8888

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.
9090

9191
| Code | Categories |
9292
|------|------------------------|
@@ -98,17 +98,17 @@ When operating a Squid Proxy server, the administrator has to exploit the logs.
9898

9999
Examples:
100100

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
108108

109109
#### About Squid
110110

111-
Squid supports HTTP and ftp protocols.
111+
Squid supports HTTP and FTP protocols.
112112

113113
The advantages of installing a solution based on the Squid server:
114114

@@ -148,24 +148,24 @@ Service logs (stop and restart) are in `/var/log/squid.cache.log`, while client
148148

149149
The `squid` command controls the squid server.
150150

151-
Syntaxe of the command:
151+
Syntax of the command:
152152

153153
```bash
154154
squid [-z|-s|-k parse|-k rotate]
155155
```
156156

157157
| Option | Description |
158158
|-------------|------------------------------|
159-
| `-z` | Initialize cache directories |
159+
| `-z` | Initializes cache directories |
160160
| `-s` | Enables syslog logging |
161161
| `-k parse` | Test configuration file |
162162
| `-k rotate` | Rotates logs |
163163

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.
165165

166166
It is a good idea to regularly create a new log file and archive the old one in compressed format.
167167

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`.
169169

170170
### Configuration
171171

@@ -179,7 +179,7 @@ http_port num_port
179179

180180
!!! Note
181181

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!
183183

184184
When the service restarts, the Squid server will listen on the port defined by the `http_port` directive.
185185

@@ -203,15 +203,15 @@ cache_mem 1 GB
203203

204204
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.
205205

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.
207207

208208
!!! Tip
209209

210210
Set to 0 to deactivate.
211211

212212
* Anonymous FTP user `ftp_user`
213213

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.
215215

216216
```bash
217217
ftp_user bob@rockylinux.lan
@@ -233,7 +233,7 @@ acl LUNCHTIME time 12:00-14:00
233233
http_access deny LUNCHTIME
234234
```
235235

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.
237237

238238
* Maximum size of a cached object `maximum_object_size`
239239

@@ -249,7 +249,7 @@ Example:
249249
maximum_object_size 32 MB
250250
```
251251

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.
253253

254254
* Proxy server name `visible_hostname`
255255

@@ -267,15 +267,15 @@ visible_hostname proxysquid
267267

268268
!!! Note
269269

270-
The value supplied may be different from the host name.
270+
The value supplied may be different from the hostname.
271271

272272
* Define a cache for squid `cache_ufs`
273273

274274
```bash
275275
cache_ufs format path size nbFolderNiv1 nbFolderNiv2
276276
```
277277

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.
279279

280280
Example:
281281

@@ -371,15 +371,15 @@ acl XXX proto HTTP FTP
371371

372372
Different cache algorithms exist with different characteristics:
373373

374-
* LRU - *Least Recently Used*: removes the oldest objects from RAM
374+
* LRU - *Least Recently Used*: removes the oldest objects from the RAM
375375
* LRU-THOLD: copies an object to the cache according to its size
376376
* 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
379379

380380
#### Client authentication
381381

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.
383383

384384
Authentication can also be a legal necessity. Remember to get your users to sign a usage charter!
385385

@@ -404,9 +404,9 @@ squidclient -s -h localhost -p 8080 http://localhost/
404404
| Option | Description |
405405
|--------|-----------------------------------------------|
406406
| `-s` | Silent mode (displays nothing in the console) |
407-
| `-h` | Define target proxy |
407+
| `-h` | Defines target proxy |
408408
| `-p` | Listening port (default 3128) |
409-
| `-r` | Force server to reload object |
409+
| `-r` | Forces the server to reload the object |
410410

411411
#### Analyze logs
412412

@@ -441,11 +441,11 @@ sudo firewall-cmd --reload
441441

442442
### Workshop
443443

444-
In this workshop, you will install squid on your server and use it to download updates.
444+
In this workshop, you will install Squid on your server and use it to download updates.
445445

446-
#### Task 1 : Install and configure squid
446+
#### Task 1: Install and configure Squid
447447

448-
Install squid:
448+
Install Squid:
449449

450450
```bash
451451
sudo dnf install squid
@@ -469,15 +469,15 @@ sudo squid -z
469469
sudo systemctl start squid
470470
```
471471

472-
#### Task 2 : Use your proxy with curl
472+
#### Task 2: Use your proxy with curl
473473

474474
Open a new terminal on your proxy server to follow the proxy's access.
475475

476476
```bash
477477
sudo tail -f /var/log/squid/access.log
478478
```
479479

480-
On the second terminal, use `curl` to access to a web page through the proxy:
480+
On the second terminal, use `curl` to access a web page through the proxy:
481481

482482
```bash
483483
$ curl -I --proxy "http://192.168.1.10:3128" https://docs.rockylinux.org
@@ -488,17 +488,17 @@ content-type: text/html
488488
...
489489
```
490490

491-
As you can see, two HTTP connections exist. The first one with the proxy and the second one from the proxy to the remote server.
491+
As you can see, two HTTP connections exist. The first is with the proxy, and the second is from the proxy to the remote server.
492492

493493
You can see the trace on your second terminal:
494494

495495
```bash
496496
1723793294.548 77 192.168.1.10 TCP_TUNNEL/200 3725 CONNECT docs.rockylinux.org:443 - HIER_DIRECT/151.101.122.132 -
497497
```
498498

499-
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.
500500

501-
#### Task 3 : Configure DNS to use your proxy server
501+
#### Task 3: Configure DNS to use your proxy server
502502

503503
Edit the `/etc/dnf/dnf.conf` file to use the proxy squid:
504504

@@ -527,15 +527,15 @@ Verify on your terminal that the `dnf` connection uses your proxy to download it
527527
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
528528
```
529529

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).
531531

532532
### Conclusion
533533

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.
535535

536536
### Check your Knowledge
537537

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?
539539

540540
* [ ] 8080
541541
* [ ] 1234

0 commit comments

Comments
 (0)