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
This YAML rule helps detect specific host and port configurations in your code. For example, it checks if the port is set to something other than 8000 or if a particular host is used. It provides an error message prompting you to update the configuration.
8
+
9
+
### YAML
10
+
11
+
```yaml
12
+
id: detect-host-port
13
+
message: You are using $HOST on Port $PORT, please change it to 8000
14
+
severity: error
15
+
rule:
16
+
any:
17
+
- pattern: |
18
+
port: $PORT
19
+
- pattern: |
20
+
host: $HOST
21
+
```
22
+
23
+
### Example
24
+
25
+
<!-- highlight matched code in curly-brace {lineNum} -->
26
+
```yaml
27
+
db:
28
+
username: root
29
+
password: root
30
+
31
+
server:
32
+
host: 127.0.0.1
33
+
port: 8001
34
+
35
+
```
36
+
37
+
### Contributed by
38
+
[rohitcoder](https://twitter.com/rohitcoder) on [Discord](https://discord.com/invite/4YZjf6htSQ).
0 commit comments