Skip to content

Commit 141a455

Browse files
GLVSKiritipoiana
authored andcommitted
Added event for default rule read ssh information
Signed-off-by: GLVS Kiriti <[email protected]>
1 parent 767157d commit 141a455

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//go:build linux
2+
// +build linux
3+
4+
// SPDX-License-Identifier: Apache-2.0
5+
/*
6+
Copyright (C) 2023 The Falco Authors.
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package syscall
19+
20+
import (
21+
"github.com/falcosecurity/event-generator/events"
22+
23+
"os"
24+
)
25+
26+
var _ = events.Register(
27+
ReadSshInformation,
28+
events.WithDisabled(), // the rule is not enabled by default, so disable the action too
29+
)
30+
31+
func ReadSshInformation(h events.Helper) error {
32+
const filename = "/root/.ssh/known_hosts"
33+
h.Log().Info("attempting to simulate SSH information read")
34+
file, err := os.Open(filename)
35+
defer file.Close()
36+
return err
37+
}

0 commit comments

Comments
 (0)