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

Create profile for sing-box #273

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Create profile for sing-box #273

merged 2 commits into from
Jan 24, 2024

Conversation

npwc
Copy link
Contributor

@npwc npwc commented Jan 16, 2024

@roddhjav
Copy link
Owner

roddhjav commented Jan 16, 2024

Thanks for your PR. Please have a look at the profile guideline: https://apparmor.pujol.io/development/guidelines to ensure your profile respect the guideline of this project.

Looking at the documentation of sing-box. I have the feeling, this profile only works for your use case of the proxy (with tor), what about other feature?

@{exec_path} = /{,usr/}{,local/}bin/sing-box
profile sing-box @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice>
Copy link
Owner

Choose a reason for hiding this comment

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

use nameservice-strict


include <tunables/global>

@{exec_path} = /{,usr/}{,local/}bin/sing-box
Copy link
Owner

Choose a reason for hiding this comment

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

Use @{bin}/sing-box (local program are purposely not confined by default profiles)

include <abstractions/nis>
include <abstractions/ssl_certs>
include <abstractions/ssl_keys>
include <abstractions/tor>
Copy link
Owner

Choose a reason for hiding this comment

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

There is no such abstraction.

/usr/{,local/}share/sing-box/geosite.db r,

owner /{,usr/local/}etc/sing-box/config.json r,
owner @{home_dirs}/.local/share/certmagic/** rw,
Copy link
Owner

Choose a reason for hiding this comment

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

@{home_dirs) does not exist. Use: owner @{user_share_dirs}/certmagic/** rw,

/proc/meminfo r,
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,

/usr/bin/tor mrix,
Copy link
Owner

Choose a reason for hiding this comment

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

Use the @{bin} variable.

include <abstractions/ssl_certs>
include <abstractions/ssl_keys>
include <abstractions/tor>
include <abstractions/user-tmp>
Copy link
Owner

Choose a reason for hiding this comment

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

This abstraction is quite board, can you restrict this a bit.

@npwc
Copy link
Contributor Author

npwc commented Jan 16, 2024

Thanks for your PR. Please have a look at the profile guideline: https://apparmor.pujol.io/development/guidelines.html to ensure your profile respect the guideline of this project.

Looking at the documentation of sing-box. I have the feeling, this profile only works for your use case of the proxy (with tor), what about other feature?

Yes, part of profile only work for me.

Now my specific profile has been removed, only a generic scenario remains.

@roddhjav roddhjav force-pushed the main branch 2 times, most recently from 7e0f337 to d3751d3 Compare January 24, 2024 20:52
@roddhjav roddhjav merged commit e7dc2fb into roddhjav:main Jan 24, 2024
2 checks passed
@roddhjav
Copy link
Owner

roddhjav commented Jan 24, 2024

Thanks. Merged.

For future contribution, please try to follow the profile guideline as I have done with 8f82547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants