Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New hashing algorithm for fingerprint processor #15418

Merged
merged 10 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Enable TLS 1.3 in all beats. {pull}12973[12973]
- Enable DEP (Data Execution Protection) for Windows packages. {pull}15149[15149]
- Spooling to disk creates a lockfile on each platform. {pull}15338[15338]
- Fingerprint processor adds a new xxhash hashing algorithm {pull}15418[15418]

*Auditbeat*

Expand Down
10 changes: 10 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4551,6 +4551,16 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--------------------------------------------------------------------
Dependency: github.com/OneOfOne/xxhash
Version: v1.2.6
Revision: 8f0be54a8d5ccf68817143d8c996147ec5cbd795
License type (autodetected): Apache-2.0
./vendor/github.com/OneOfOne/xxhash/LICENSE:
--------------------------------------------------------------------
Apache License 2.0


--------------------------------------------------------------------
Dependency: github.com/opencontainers/go-digest
Revision: ac19fd6e7483ff933754af248d80be865e543d22
Expand Down
2 changes: 1 addition & 1 deletion libbeat/processors/fingerprint/docs/fingerprint.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ The following settings are supported:
`fields`:: List of fields to use as the source for the fingerprint.
`ignore_missing`:: (Optional) Whether to ignore missing fields. Default is `false`.
`target_field`:: (Optional) Field in which the generated fingerprint should be stored. Default is `fingerprint`.
`method`:: (Optional) Algorithm to use for computing the fingerprint. Must be one of: `md5`, `sha1`, `sha256`, `sha384`, `sha512`. Default is `sha256`.
`method`:: (Optional) Algorithm to use for computing the fingerprint. Must be one of: `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `xxhash`. Default is `sha256`.
`encoding`:: (Optional) Encoding to use on the fingerprint value. Must be one of `hex`, `base32`, or `base64`. Default is `hex`.
1 change: 1 addition & 0 deletions libbeat/processors/fingerprint/fingerprint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestHashMethods(t *testing.T) {
"sha256": {"1208288932231e313b369bae587ff574cd3016a408e52e7128d7bee752674003"},
"sha384": {"295adfe0bc03908948e4b0b6a54f441767867e426dda590430459c8a147fbba242a38cba282adee78335b9e08877b86c"},
"sha512": {"f50ad51b63c92a0ed0c910527119b81806f3110f0afaa1dcb93506a78371ea761e50c0fc09b08c441d832dd2da1b45e5d8361adfb240e1fffc2695122a23e183"},
"xxhash": {"37bc50682fba6686"},
}

for method, test := range tests {
Expand Down
3 changes: 3 additions & 0 deletions libbeat/processors/fingerprint/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"crypto/sha512"
"hash"
"strings"

"github.com/OneOfOne/xxhash"
)

type hashMethod func() hash.Hash
Expand All @@ -34,6 +36,7 @@ var hashes = map[string]hashMethod{
"sha256": sha256.New,
"sha384": sha512.New384,
"sha512": sha512.New,
"xxhash": xxhash.NewHash64,
}

// Unpack creates the hashMethod from the given string
Expand Down
187 changes: 187 additions & 0 deletions vendor/github.com/OneOfOne/xxhash/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions vendor/github.com/OneOfOne/xxhash/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/OneOfOne/xxhash/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading