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

adding an event for disallowed_ssh_connection_non_standard_port #144

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

h4l0gen
Copy link
Contributor

@h4l0gen h4l0gen commented Mar 19, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind documentation

/kind tests

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area commands

/area pkg

/area events

What this PR does / why we need it:
this triggers rule disallowed ssh connection non standard port
Which issue(s) this PR fixes:

Fixes #142

Special notes for your reviewer:

@h4l0gen
Copy link
Contributor Author

h4l0gen commented Mar 19, 2024

TCP protocol condition is met by SSH connection, as SSH uses TCP protocol

@h4l0gen
Copy link
Contributor Author

h4l0gen commented Apr 4, 2024

Hii @FedeDP @leogr this event triggered stable rule successfully
image
Please provide your feedback. Thank You!!

@h4l0gen h4l0gen requested a review from FedeDP April 5, 2024 13:36
}
}
// non_standard_port : 443
cmd := exec.Command("timeout", "1s", path, "[email protected]", "-p", "443")
Copy link
Member

Choose a reason for hiding this comment

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

@h4l0gen

Generally speaking, it is good practice to use example domains.

Just a doubt: will it work with localhost as well? 🤔

If so, it would be preferable, to avoid outbound traffic. Otherwise, it's ok as-is now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leogr let me check..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leogr Its not working on localhost :)
image

Copy link
Member

Choose a reason for hiding this comment

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

@FedeDP what do you think about using example.net ?

Copy link
Contributor

@FedeDP FedeDP Apr 22, 2024

Choose a reason for hiding this comment

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

I think localhost should work just fine; in your case it is not working because you are actually succeeding in logging in (ie: you have an ssh daemon on port 443(?))
I'd try to connect to localhost to a different port, like 4444, and see if that triggers the rule.

See https://github.com/falcosecurity/rules/blob/main/rules/falco_rules.yaml#L1207 for the ports that can be used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Uh nope, the rule triggers only for outbound connections, therefore it won't fire for localhost. See: https://github.com/falcosecurity/rules/blob/main/rules/falco_rules.yaml#L1223C5-L1223C13

I guess it's ok then.

Copy link
Contributor Author

@h4l0gen h4l0gen Apr 22, 2024

Choose a reason for hiding this comment

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

Yes, @FedeDP, if everything seems good, then we are good to proceed with this PR and this one?

FedeDP
FedeDP previously approved these changes Apr 22, 2024
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link

poiana commented Apr 22, 2024

LGTM label has been added.

Git tree hash: a20a55c5c4b96b8994af375195aa17a7415357fd

@h4l0gen
Copy link
Contributor Author

h4l0gen commented Apr 22, 2024

@FedeDP I think branch protection rules interfered with merging this event :)

@FedeDP
Copy link
Contributor

FedeDP commented Apr 22, 2024

@FedeDP I think branch protection rules interfered with merging this event :)

What do you mean?

@FedeDP
Copy link
Contributor

FedeDP commented Apr 22, 2024

Can you squash this one into a single commit and rebase on top of main?

@h4l0gen
Copy link
Contributor Author

h4l0gen commented Apr 22, 2024

@FedeDP please add LGTM label again. Sorry for the inconvenience :)

@poiana
Copy link

poiana commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, h4l0gen, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link

poiana commented Apr 23, 2024

LGTM label has been added.

Git tree hash: a7f834693ed0cecfc5334dbb6daff584785ef6a5

@poiana poiana merged commit d2d4264 into falcosecurity:main Apr 23, 2024
4 checks passed
@leogr leogr added this to the v0.12.0 milestone Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

event on Disallowed SSH connection non standard port
4 participants