Skip to content

Commit 81fdf48

Browse files
committed
Update README
1 parent 5e88d47 commit 81fdf48

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

+41-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# bidichk - checks for dangerous unicode character sequences
22

3-
[![Test Status](https://github.com/breml/bidichk/workflows/Go%20Matrix/badge.svg)](https://github.com/breml/logstash-config/actions?query=workflow%3AGo%20Matrix) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
3+
[![Test Status](https://github.com/breml/bidichk/workflows/Go%20Matrix/badge.svg)](https://github.com/breml/bidichk/actions?query=workflow%3AGo%20Matrix) [![Go Report Card](https://goreportcard.com/badge/github.com/breml/bidichk)](https://goreportcard.com/report/github.com/breml/bidichk) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
44

55
bidichk finds dangerous unicode character sequences in Go source files.
66

@@ -18,6 +18,46 @@ The following unicode characters are considered dangerous:
1818
* U+2068: FIRST-STRONG-ISOLATE
1919
* U+2069: POP-DIRECTIONAL-ISOLATE
2020

21+
## Installation
22+
23+
Download `bidichk` from the [releases](https://github.com/breml/bidichk/releases) or get the latest version from source with:
24+
25+
```shell
26+
go get github.com/breml/bidichk/cmd/bidichk
27+
```
28+
29+
## Usage
30+
31+
### golangci-lint
32+
33+
[golangci-lint](https://golangci-lint.run) supports thelper, so you can enable this linter and use it.
34+
35+
### Shell
36+
37+
Check everything:
38+
39+
```shell
40+
bidichk ./...
41+
```
42+
43+
### Enable only required unicode runes
44+
45+
If you run bidichk via golangci-lint look at [.golangci.example.yml](https://golangci-lint.run/usage/configuration/#config-file) for an example of the configuration.
46+
47+
Otherwise you can run bidichk with `--disallowed-runes` flag to specify the runes you consider harmful.
48+
49+
E.g. the following command considers only the `LEFT-TO-RIGHT-OVERRIDE` unicode rune as dangerous:
50+
51+
```shell
52+
bidichk --disallowed-runes LEFT-TO-RIGHT-OVERRIDE ./...
53+
```
54+
55+
For the full list of supported unicode runes [see above](#considered-dangerous-unicode-characters) or use
56+
57+
```shell
58+
bidichk --help
59+
```
60+
2161
## Inspiration
2262

2363
* ['Trojan Source' Bug Threatens the Security of All Code](https://krebsonsecurity.com/2021/11/trojan-source-bug-threatens-the-security-of-all-code/)

0 commit comments

Comments
 (0)