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 on triggering rule disallowed ssh connection #130

Merged
merged 1 commit into from
May 8, 2024

Conversation

h4l0gen
Copy link
Contributor

@h4l0gen h4l0gen commented Mar 18, 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:
we need to detect functionality of rule disallowed ssh connection
Which issue(s) this PR fixes:

Fixes #129

Special notes for your reviewer:

@h4l0gen
Copy link
Contributor Author

h4l0gen commented Mar 27, 2024

@leogr, as this rule is disabled by default, I enabled it here. On event execution, the rule is triggered successfully, as shown in the terminal output below.
Screenshot from 2024-03-27 17-51-26

@h4l0gen
Copy link
Contributor Author

h4l0gen commented Apr 4, 2024

@leogr @FedeDP I have used timeout tag to reset connection after 1 second to complete event. Please review it again. Thank You!!

)

func DisallowedSSHConnection(h events.Helper) error {
cmd := exec.Command("timeout", "1s", "ssh", "[email protected]", "-p", "22")
Copy link
Contributor

Choose a reason for hiding this comment

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

Check if ssh is present?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes @FedeDP, Let me modify it

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 I made changes and rule triggering successfully and throwing error too when ssh is not present.

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 as per our discussion here, This rule is also not triggering on localhost
Screenshot from 2024-04-12 10-01-35

Copy link
Member

Choose a reason for hiding this comment

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

Let's use example.com, if there's no alternative.
@FedeDP wdyt?

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 If using example.com looks good to you, then we are good to go with this PR, please take a look.

Signed-off-by: h4l0gen <[email protected]>

final

Signed-off-by: h4l0gen <[email protected]>
@leogr
Copy link
Member

leogr commented Apr 23, 2024

/assign @FedeDP

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 poiana added the lgtm label May 8, 2024
@poiana
Copy link

poiana commented May 8, 2024

LGTM label has been added.

Git tree hash: 0e27d3b86e3c0e1f9174f15818a7d3e486ff6e6c

@poiana
Copy link

poiana commented May 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 poiana added the approved label May 8, 2024
@poiana poiana merged commit 9a20da3 into falcosecurity:main May 8, 2024
4 checks passed
@h4l0gen h4l0gen deleted the kapil-8 branch May 8, 2024 12:56
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 for Disallowed SSH connection
4 participants