- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
AppArmor profiles define what resources applications are able to access.
To set all profiles to either enforce
or complain
mode
run the following command to set all profiles to enforce
mode:
$ sudo aa-enforce /etc/apparmor.d/*
run the following command to set all profiles to complain
mode:
$ sudo aa-complain /etc/apparmor.d/*
To list unconfined processes run the following command:
$ sudo apparmor_status | grep processes
Any unconfined processes may need to have a profile created or activated for them and then be restarted.
Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This recommendation is intended to ensure that any policies that exist on the system are activated.
The following script can be run on the host to remediate the issue.
#!/bin/bash
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { dpkg-query --show --showformat='${db:Status-Status}\n' 'apparmor' 2>/dev/null | grep -q installed; }; then
var_apparmor_mode='enforce'
# make sure apparmor-utils is installed for aa-complain and aa-enforce
DEBIAN_FRONTEND=noninteractive apt-get install -y "apparmor-utils"
# Reload all AppArmor profiles
apparmor_parser -q -r /etc/apparmor.d/
# Set the mode
APPARMOR_MODE="$var_apparmor_mode"
if [ "$APPARMOR_MODE" = "enforce" ]
then
# Set all profiles to enforce mode
aa-enforce /etc/apparmor.d/*
fi
if [ "$APPARMOR_MODE" = "complain" ]
then
# Set all profiles to complain mode
aa-complain /etc/apparmor.d/*
fi
UNCONFINED=$(aa-status | grep "processes are unconfined" | awk '{print $1;}')
if [ $UNCONFINED -ne 0 ];
then
echo -e "***WARNING***: There are some unconfined processes:"
echo -e "----------------------------"
echo "The may need to have a profile created or activated for them and then be restarted."
for PROCESS in "${UNCONFINED[@]}"
do
echo "$PROCESS"
done
echo -e "----------------------------"
echo "The may need to have a profile created or activated for them and then be restarted."
fi
else
>&2 echo 'Remediation is not applicable, nothing was done'
fi