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

probe added to sysdump #449

Merged
merged 1 commit into from
Aug 27, 2024
Merged

probe added to sysdump #449

merged 1 commit into from
Aug 27, 2024

Conversation

Manik2708
Copy link
Contributor

@Manik2708 Manik2708 commented Jul 23, 2024

Fixes #305
Probe output is now being saved to karmor.probe in zip file.

@Manik2708
Copy link
Contributor Author

See this for reference!

Screenshot from 2024-07-23 20-15-19

@nyrahul
Copy link
Contributor

nyrahul commented Jul 23, 2024

Thanks @Manik2708, Please handle the go-sec findings failing in the CI.

probe/print.go Outdated Show resolved Hide resolved
sysdump/sysdump.go Outdated Show resolved Hide resolved
cmd/sysdump.go Outdated Show resolved Hide resolved
@Manik2708 Manik2708 requested a review from nyrahul July 23, 2024 17:39
@Manik2708
Copy link
Contributor Author

Sorry for the formatting error! Please re-run the workflow

probe/print.go Outdated Show resolved Hide resolved
@Manik2708
Copy link
Contributor Author

Please see the screenshots after the new commit:

Screenshot from 2024-07-27 00-02-10

Screenshot from 2024-07-27 00-01-59

@Manik2708
Copy link
Contributor Author

@Aryan-sharma11 @nyrahul @Prateeknandle @rootxrishabh Please review

cmd/probe.go Outdated Show resolved Hide resolved
probe/print.go Outdated Show resolved Hide resolved
probe/print.go Outdated Show resolved Hide resolved
probe/print.go Show resolved Hide resolved
@Aryan-sharma11
Copy link
Member

Aryan-sharma11 commented Jul 31, 2024

@Manik2708, I tested these changes locally, there are some improvements we can make

  1. The karmor probe data is being stored in file name karmor.probe instead let's make it karmor-probe.txt
  2. in first line we can see getting logs from kubearmor-apparmor-containerd-98c2c-q5jbb we don't need to print this
    image
  3. this is the karmor probe output with your changes
    image
    let's have the headings in bold text, for reference this is the current karmor probe's output
    image

@Manik2708
Copy link
Contributor Author

@Manik2708, I tested these changes locally, there are some improvements we can make

1. The karmor probe data is being stored in file name `karmor.probe` instead let's make it `karmor-probe.txt`

2. in first line we can see `getting logs from kubearmor-apparmor-containerd-98c2c-q5jbb` we don't need to print this
   ![image](https://private-user-images.githubusercontent.com/54109867/353716659-67d2ade2-940e-4216-81c3-2b921c8d44b0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MTgxMjYsIm5iZiI6MTcyMjQxNzgyNiwicGF0aCI6Ii81NDEwOTg2Ny8zNTM3MTY2NTktNjdkMmFkZTItOTQwZS00MjE2LTgxYzMtMmI5MjFjOGQ0NGIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDA5MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE1N2Q4YWZjZDliOTk3MzliN2ZiOGFlNTY2YTVkOGU2Y2ViODRhMTE4MDk1OWIyMmE2ZGQzOWY0MDAwNDI4ZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.flgfPL6oP6i3cLZwtppHJjZFu8lIJHUf7uEpG-V1VDk)

3. this is the karmor probe output with your changes
   ![image](https://private-user-images.githubusercontent.com/54109867/353717310-40bac0a3-d461-4cdb-bfc8-d11ed195ad09.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MTgxMjYsIm5iZiI6MTcyMjQxNzgyNiwicGF0aCI6Ii81NDEwOTg2Ny8zNTM3MTczMTAtNDBiYWMwYTMtZDQ2MS00Y2RiLWJmYzgtZDExZWQxOTVhZDA5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDA5MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxMjMzOTQzMGVjNWRkZDY1NmJhNDlkYWZhZTA2ZGJlMWI3YzgwZTZjNjY4NzIyNjFmMGEzMTU2ZWUxNTZhNDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.eZ82P-m3cNeXP3ZCkn70p0Q8UGyMFHqs0IS-FT9DDEY)
   let's have the headings in bold text, for reference this is the current karmor probe's output
   ![image](https://private-user-images.githubusercontent.com/54109867/353717999-75739dac-c5cd-4c2b-8e9c-d7a8ad9216a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MTgxMjYsIm5iZiI6MTcyMjQxNzgyNiwicGF0aCI6Ii81NDEwOTg2Ny8zNTM3MTc5OTktNzU3MzlkYWMtYzVjZC00YzJiLThlOWMtZDdhOGFkOTIxNmE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDA5MjM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTExMTgwZTMzNzQ1MWQ3YTUwMzNlYmUwYmJhOTRlZWNkNTA3M2U3YTk5ZWZkMjVhODc1YjBiMmYzOGJiZjY1OWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FJbuBNk0FfOJJXHyAfJaTE_JFh8yYw6kUfgH8YC84Mw)

@Aryan-sharma11 Have resolved all your suggestions. Please review! Thanks.

probe/print.go Outdated Show resolved Hide resolved
probe/print.go Outdated Show resolved Hide resolved
probe/probe.go Outdated Show resolved Hide resolved
probe/probe.go Outdated Show resolved Hide resolved
probe/probe.go Outdated Show resolved Hide resolved
@Manik2708
Copy link
Contributor Author

Sorry for being late @Aryan-sharma11, I think output should be alright now!

cmd/probe.go Outdated Show resolved Hide resolved
cmd/sysdump.go Outdated Show resolved Hide resolved
cmd/sysdump.go Outdated Show resolved Hide resolved
cmd/sysdump.go Outdated Show resolved Hide resolved
@Manik2708
Copy link
Contributor Author

@Aryan-sharma11 @nyrahul @Prateeknandle @rootxrishabh Please review!

sysdump/sysdump.go Outdated Show resolved Hide resolved
Copy link
Member

@Aryan-sharma11 Aryan-sharma11 left a comment

Choose a reason for hiding this comment

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

Everything looking good, just a minor nit to address

sysdump/sysdump.go Outdated Show resolved Hide resolved
@Aryan-sharma11
Copy link
Member

please squash the commits too.

Copy link
Member

@DelusionalOptimist DelusionalOptimist left a comment

Choose a reason for hiding this comment

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

@Manik2708 Please rebase with main.

probe/print.go Outdated Show resolved Hide resolved
@Prateeknandle
Copy link
Contributor

please clear the go-lint issue and then we'll merge this.
Thanks fro the PR @Manik2708

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

lint error fixed

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

formatting error

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

nocolor-text feature add

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

Update probe/print.go

Co-authored-by: Aryan Sharma <[email protected]>
Signed-off-by: Manik2708 <[email protected]>

Update probe/print.go

Co-authored-by: Aryan Sharma <[email protected]>
Signed-off-by: Manik2708 <[email protected]>

enhancements

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

enhancements

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

echancement

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

Update cmd/probe.go

Co-authored-by: Aryan Sharma <[email protected]>
Signed-off-by: Manik2708 <[email protected]>

flags remoeved

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

os.Stdout fix

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

another enhancement

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

linting fixed

Signed-off-by: Manik2708 <[email protected]>
@Prateeknandle Prateeknandle merged commit e7b1e60 into kubearmor:main Aug 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Aryan
Development

Successfully merging this pull request may close these issues.

Add karmor probe as a part of karmor sysdump
5 participants