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

Added an event for default rule "Detect outbound connections to common miner pool ports" #176

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// SPDX-License-Identifier: Apache-2.0
/*
Copyright (C) 2024 The Falco Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package syscall

import (
"os/exec"

"github.com/falcosecurity/event-generator/events"
)

var _ = events.Register(
DetectOutboundConnectionsToCommonMinerPoolPorts,
events.WithDisabled(), // this rules is not included in falco_rules.yaml (stable rules), so disable the action
)

func DetectOutboundConnectionsToCommonMinerPoolPorts(h events.Helper) error {
curl, err := exec.LookPath("curl")
if err != nil {
h.Log().Warnf("Curl is needed to launch this action")
return err
}
cmd := exec.Command(curl, "http://mine.moneropool.com")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmh is GETting this link safe?

Copy link
Contributor Author

@GLVSKiriti GLVSKiriti Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont have an idea about that . I executed in my system 🙃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @leogr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless if it's safe or not, this approach will make the action unpredictable (that worries me more).

Are there any alternative approaches that do not involve talking with external servers? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FedeDP @leogr if we are worrying about this

Mmh is GETting this link safe?

then why cant we follow this approach i.e, let us add any example domain in the rule here, which can be used for testing purposes. So after that we can curl example.com which triggers the rule and safe to GET the request. WDYT? about this approach. IMO instead of curling the suspicious domains we can do this which will be beneficial for testing purposes

- list: http_miner_domains
  items: [
    "ca.minexmr.com",
    "de.minexmr.com",
    "fr.minexmr.com",
    "mine.moneropool.com",
    "mine.xmrpool.net",
    "pool.minexmr.com",
    "sg.minexmr.com",
    "xmr.crypto-pool.fr",
    "example.com" # Not a miner domain but used for testing purposes in falco
  ]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry. I had lost track of this. Anyway, adding example.com to the list does not seem a viable option to me since it may increase false positives.

return cmd.Run()
}
Loading