📞 🇺🇸 +1 361 304 4309 📞 🇮🇳 +91 76769 02281 ✉️ [email protected]
Security & Hardening

How to Configure AppArmor on Ubuntu for Application Security

How to Configure AppArmor on Ubuntu for Application Security

AppArmor confines applications to a defined set of resources — if a web application is compromised, AppArmor prevents the attacker from accessing files outside the defined profile.

Check Status

sudo apparmor_status
sudo apt install apparmor-utils apparmor-profiles -y

Enable Profile for Nginx

sudo aa-enforce /etc/apparmor.d/usr.sbin.nginx

Create Custom Profile

sudo aa-genprof /usr/bin/myapp
# Run app, then let aa-genprof build profile

Test in Complain Mode

sudo aa-complain /usr/bin/myapp  # log only
sudo aa-logprof                  # review logs
sudo aa-enforce /usr/bin/myapp   # enforce

Conclusion

AppArmor provides defence-in-depth for server applications. Our team implements mandatory access control as part of comprehensive hardening.

#apparmor #security #ubuntu #mandatory-access
Share:
🛠️ Need Expert Help?

Don't want to do this yourself?

Our certified engineers implement this for you — correctly, securely, and within hours. Available 24/7 with 15-minute emergency response.

  • ✅ 19+ years experience
  • ✅ 60+ certified engineers
  • ✅ 1,600+ servers managed
  • ✅ 40+ countries served
  • ✅ Plans from $49/mo

Get Expert Help — Free Consultation

We respond within 4 hours · No commitment required

Please enter your name and a valid email.

No spam. Privacy Policy

Comments