구성 변경에 대한 샘플 코드 감사
이 샘플 코드는 구성 시크릿 데이터에 대한 모든 변경 사항을 감사하고 로그를 syslog 라는 파일로 보냅니다.
[edit system]
syslog {
file syslog {
authorization info;
change-log info;
interactive-commands info;
}
}
이 샘플 코드는 최소 감사의 범위를 확장하여 비밀 데이터뿐만 아니라 구성에 대한 모든 변경 사항을 감사하고 로그를 syslog 라는 파일로 보냅니다.
[edit system]
syslog {
file syslog {
any any;
authorization info;
change-log any;
interactive-commands info;
kernel info;
pfe info;
}
}
예: 구성 변경에 대한 시스템 로깅
이 예제에서는 샘플 구성을 보여 주고 사용자 및 비밀 데이터를 변경합니다. 그런 다음 비밀 데이터가 원래 구성에 추가되고 명령으로 load 커밋될 때 감사 서버로 전송된 정보를 표시합니다.
[edit system]
location {
country-code US;
building B1;
}
...
login {
message "UNAUTHORIZED USE OF THIS ROUTER\n\tIS STRICTLY PROHIBITED!";
user admin {
uid 2000;
class super-user;
authentication {
encrypted-password “$ABC123”;
# SECRET-DATA
}
}
password {
format md5;
}
}
radius-server 192.0.2.15 {
secret “$ABC123” # SECRET-DATA
}
services {
ssh;
}
syslog {
user *{
any emergency;
}
file syslog {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
...
...
새 구성은 비밀 데이터 구성 문을 변경하고 새 사용자를 추가합니다.
user@host# show | compare
[edit system login user admin authentication]
– encrypted-password “$ABC123”; # SECRET-DATA
+ encrypted-password “$ABC123”; # SECRET-DATA
[edit system login]
+ user admin2 {
+ uid 2001;
+ class operator;
+ authentication {
+ encrypted-password “$ABC123”;
# SECRET-DATA
+ }
+ }
[edit system radius-server 192.0.2.15]
– secret “$ABC123”; # SECRET-DATA
+ secret “$ABC123”; # SECRET-DATA