-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Document apparmor #393
Comments
I just had to deploy a PR five times changing to complain and back to enforce to dance around this apparmor nonsense. @liushuyu any help here would be greatly appreciated. This is making it much harder to make website changes. |
The local settings are at So AppArmor is enabled for security isolation purposes, as we have encountered directory traversal exploits on the server before.
On a modern Linux system, you can use |
This breaks automatic deployments but going one-by-one through logprof is the wrong way. It took 5 deployments for this nonsense to deploy an update. There must be a way for these to live together in harmony that doesn't involve us monitoring for what each process does and whitelisting it. |
I think turning on complaint mode the first time and deploying it once should give |
It didn't. I've already stated that twice. |
In regards to the security of this system, git-deploy can upload arbitrary code so I'm not sure how this apparmor helps. It doesn't prevent |
I see. So the issue is still
Also, you don't have to turn off complaint mode to generate the AppArmor rulesets. I know this is problematic, as with SELinux (used in Fedora/RHEL), these MAC (Mandatory Access Control) systems are very much like enterprise software |
I can agree, but we still have to improve the situation somehow, isn't it? We still review the source repository from which it downloads the code, so this is more of preventing unknown access. The initial thought was to secure the |
This is objectively wrong. Without it, the deployment is in an undefined state, so you'd have to deploy for every apparmor "branch" that gets in your way as you fall to the ground.
How would I even know? I put it in complain, run |
Got it.
I see. So our course of action is to turn off ArmArmor completely? I think that's fine by me as well. |
If you're comfortable with fixing it for git-deploy, I'm fine with that solution, but in its current state, we don't have a document explaining how to get each service we offer to work with AppArmor. The issue that I have is this:
The "arbitrary code" I'm referring to is anything in our source tree that can be executed by the nginx user (e.g. php scripts, cron entries) but we have an expectation that that cannot happen unless our actions password is leaked. I am all for a second layer of security, but I just think we need to treat it like a breaking change and make sure we have a reproducible environment, document the steps, and then we can have project steps to reference when we find out we missed something or an updated package or code snippet behaves differently than before. e.g. a living wiki doc. |
I'm trying to fix our deployment script however @liushuyu it appears that by default apparmor is enabled, but it's not obvious at all what the settings are or how to fix it.
This post describes it best: https://www.reddit.com/r/openSUSE/comments/kanlom/phpfpm_is_blocked_by_apparmor/
Quoting:
One of the commenters says that they wasted 12 hours on this problem. I believe it.
For now, I'm using:
... but what does this even do? The above article says to use
sudo aa-logprof
to "Allow or deny whatever AppArmor would have blocked", but that seems a bit presumptuous without reviewing them.I think reviewing syslog is the way:
sudo tail -f /var/log/syslog |grep audit
... but the events seem to vanish after
complain
has been toggled on and off. How do I actually allow these? Is there a procedure that isn't so esoteric?The text was updated successfully, but these errors were encountered: