이 페이지에서는 커스텀 액세스 수준에서 CEL(Common Expression Language) 표현식을 빌드하는 데 사용되는 객체 및 속성을 자세히 설명합니다. 예시가 포함되어 있습니다.
CEL에 대한 자세한 내용은 CEL 언어 정의 를 참조하세요.
객체
Access Context Manager는 액세스 수준 속성을 포함하는 4개의 객체를 제공합니다.
객체
origin
요청의 출처를 식별하는 속성을 포함합니다.
request.auth
요청의 인증 및 승인 측면을 식별하는 속성을 포함합니다.
levels
다른 액세스 수준에 대한 종속 항목을 정의하는 속성을 포함합니다.
device
요청이 시작된 기기를 설명하는 속성을 포함합니다.
origin
속성
이 섹션에는 origin
객체에서 지원하는 속성이 나와 있습니다.
속성
ip
유형
문자열
설명
요청이 시작된 IP 주소입니다. IP 주소를 확인할 수 없는 경우 origin.ip
는 오류로 평가됩니다. 문자열 비교 대신 inIpRange
를 사용하여 원본 IP 주소가 특정 IP 주소 범위에 있는지 확인하는 것이 좋습니다.
경고: origin.ip
를 빈 문자열과 비교하지 마세요. 동작이 정의되지 않았습니다.
예시:
inIpRange ( origin.ip , [ "203.0.113.24" ])
region_code
유형
문자열
설명
요청이 시작된 국가 또는 지역의 ISO 3166-1 alpha-2 코드 입니다. 지역 코드를 확인할 수 없는 경우 origin.region_code
는 오류로 평가됩니다.
경고: origin.region_code
를 빈 문자열과 비교하지 마세요. 동작이 정의되지 않았습니다.
예시:
origin.region_code == "GB"
origin.region_code in [ "US" , "FR" , "JP" ]
request.auth
속성
이 섹션에는 request.auth
객체에서 지원하는 속성이 나와 있습니다.
속성
principal
유형
string, list(string)
설명
요청을 발급한 사용자의 고유 ID입니다.
request.auth.principal
의 값은 하나 이상의 순 사용자 ID여야 합니다. Admin SDK Directory API 를 사용하여 UUID를 가져올 수 있습니다.
값은 다음 형식이어야 합니다. https://accounts.google.com/UUID
여기서 UUID 는 사용자의 UUID입니다.
예시:
request.auth.principal == "https://accounts.google.com/1134924314572461055"
request.auth.principal in [ "https://accounts.google.com/1134924314572461055" , "https://accounts.google.com/3134824314572461115" ]
claims.crd_str.pwd
유형
부울
설명
사용자는 비밀번호로 인증되었습니다.
예시:
request.auth.claims.crd_str.pwd == true
claims.crd_str.push
유형
부울
설명
사용자는 모바일 기기로 보낸 푸시 알림을 통해 인증되었습니다.
예시:
request.auth.claims.crd_str.push == true
claims.crd_str.sms
유형
부울
설명
사용자는 SMS로 전송된 코드를 사용하거나 전화 통화를 통해 인증되었습니다.
예시:
request.auth.claims.crd_str.sms == true
claims.crd_str.swk
유형
부울
설명
2SV는 휴대전화와 같은 소프트웨어 키를 보안 키로 사용했습니다.
예시:
request.auth.claims.crd_str.swk == true
claims.crd_str.hwk
유형
부울
설명
2SV는 Google Titan 키와 같은 하드웨어 키를 사용했습니다.
예시:
request.auth.claims.crd_str.hwk == true
claims.crd_str.otp
유형
부울
설명
사용자는 일회용 비밀번호 메서드(Google OTP 및 백업 코드)로 통해 인증되었습니다.
예시:
request.auth.claims.crd_str.otp == true
claims.crd_str.mfa
유형
부울
설명
사용자는 이 표의 메서드 중 하나(pwd 제외)로 인증되었습니다.
예시:
request.auth.claims.crd_str.mfa == true
사용자 인증 정보 강도 정책에 대한 자세한 내용은 사용자 인증 정보 강도 정책 구성 을 참조하세요.
levels
속성
이 섹션에는 levels
객체에서 지원하는 속성이 나와 있습니다.
속성
level name
유형
부울
설명
level name 는 기존 액세스 수준의 이름에 해당합니다.
사용할 경우 커스텀 액세스 수준의 다른 요구사항 외에 지정된 액세스 수준의 조건도 충족해야 합니다.
예:
levels.allow_corp_ips
여기서 allow_corp_ips
는 액세스 수준의 이름입니다.
device
속성
이 섹션에는 device
객체에서 지원하는 속성이 나와 있습니다. 요청의 식별자와 연결된 기기가 없으면 다음 속성은 모두 오류로 평가됩니다.
속성
encryption_status
유형
열거형
설명
기기의 암호화 상태를 설명합니다.
열거형 값:
enum DeviceEncryptionStatus {
// The encryption status of the device is not specified or not known.
ENCRYPTION_UNSPECIFIED == 0 ;
// The device does not support encryption.
ENCRYPTION_UNSUPPORTED == 1 ;
// The device supports encryption, but is currently unencrypted.
UNENCRYPTED == 2 ;
// The device is encrypted.
ENCRYPTED == 3 ;
}
예:
device.encryption_status == DeviceEncryptionStatus.ENCRYPTED
is_admin_approved_device
유형
부울
설명
기기가 도메인 관리자의 승인을 받았는지 여부
예:
device.is_admin_approved_device == true
is_corp_owned_device
유형
부울
설명
기기를 조직에서 소유하는지 여부
예:
device.is_corp_owned_device == true
is_secured_with_screenlock
유형
부울
설명
기기의 화면 잠금 기능이 사용 설정되었는지 여부
예:
device.is_secured_with_screenlock == true
os_type
유형
열거형
설명
기기가 사용 중인 운영체제를 식별합니다.
열거형 값:
enum OsType {
// The operating system of the device is not specified or not known.
OS_UNSPECIFIED == 0 ;
// A desktop Mac operating system.
DESKTOP_MAC == 1 ;
// A desktop Windows operating system.
DESKTOP_WINDOWS == 2 ;
// A desktop Linux operating system.
DESKTOP_LINUX == 3 ;
// An Android operating system.
ANDROID == 4 ;
// An iOS operating system.
IOS == 5 ;
// A desktop ChromeOS operating system.
DESKTOP_CHROME_OS == 6 ;
}
예:
device.os_type == OsType.DESKTOP_MAC
device.os_type ! = OsType.OS_UNSPECIFIED
vendors
유형
map<string, Vendor> vendors;
설명
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA products and features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
vendors
객체는 서드 파티 보안 및 엔드포인트 관리 공급업체에서 제공하는 데이터에 액세스하는 데 사용됩니다. 각 공급업체는 3개의 공유 최상위 속성(is_compliant_device
, is_managed_device
, device_health_score
)을 채울 수 있습니다.
또한 공급업체는 data
속성을 사용하여 참조하는 자체 키와 값을 제공할 수 있습니다.
data
속성에 사용할 수 있는 키는 공급업체마다 다릅니다. 정책 표현식의 키 값을 비교할 때 일관적이어야 합니다. 예를 들어 키 값이 문자열 또는 부울일 것으로 예상된다면 그에 맞게 정책 표현식의 문자열 또는 부울과 비교해야 합니다. 값이 정수인 경우 정책 표현식의 Double 숫자와 비교해야 합니다.
참고: 사용 가능한 공급업체와 공급업체별 키의 전체 목록은 없습니다.
열거형 값:
// Health score of the device as provided by the vendor (possibly third party).
enum DeviceHealthScore {
// The health score for the device is not specified or unknown.
DEVICE_HEALTH_SCORE_UNSPECIFIED = 0 ;
// The health of the device is very poor.
VERY_POOR = 1 ;
// The health of the device is poor.
POOR = 2 ;
// The health of the device is ok.
NEUTRAL = 3 ;
// The health of the device is good.
GOOD = 4 ;
// The health of the device is very good.
VERY_GOOD = 5 ;
}
예:
device.vendors [ "some_vendor" ] . is_compliant_device == true
device.vendors [ "some_vendor" ] . is_managed_device == true
device.vendors [ "some_vendor" ] . device_health_score == DeviceHealthScore.VERY_GOOD
device.vendors [ "some_vendor" ] . data [ "is_device_compromised" ] == true
device.vendors [ "some_vendor" ] . data [ "some_num" ] == 1.0
참고: is_device_compromised
은 공급업체가 정의한 키를 나타내는 예시일 뿐입니다.
android_device_security.verified_boot
유형
부울
설명
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA products and features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
Android 자체 검사 부팅 상태가 green
인지 여부
예시:
device.android_device_security.verified_boot == true
android_device_security.cts_profile_match
유형
부울
설명
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA products and features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
기기에서 CTS 프로필 규정 준수 를 통과하는지 여부
예시:
device.android_device_security.cts_profile_match == true
android_device_security.verify_apps_enabled
유형
부울
설명
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA products and features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
기기에 Google Play 프로텍트 인증 앱이 사용 설정되었는지 여부
예시:
device.android_device_security.verify_apps_enabled == true
android_device_security.has_potentially_harmful_apps
유형
부울
설명
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA products and features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
기기에서 잠재적으로 위험한 앱 이 발견되었는지 여부
예시:
device.android_device_security.has_potentially_harmful_apps == true
ios_device_security.is_device_jailbroken
유형
부울
설명
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section
of the Service Specific Terms .
Pre-GA products and features are available "as is" and might have limited support.
For more information, see the
launch stage descriptions .
iOS 기기가 탈옥 된 것으로 확인되었는지 여부입니다.
예:
device.ios_device_security.is_device_jailbroken == true
verified_chrome_os
유형
부울
설명
인증된 Chrome OS 가 설치된 기기에서 요청이 전송되었는지 여부
예시:
device.verified_chrome_os == true
chrome.management_state
유형
문자열
설명
브라우저가 올바른 브라우저 수준 또는 프로필 수준에서 관리되고, 기업이 올바른 도메인에 속하는지 확인합니다.
정책이 중앙에서 관리되고 푸시되며 관리 브라우저 또는 프로필의 도메인이 서버 측의 예상 도메인과 일치하는 경우 브라우저가 관리되는 것으로 간주됩니다.
다음은 사용 가능한 Chrome 관리 상태입니다.
상태
MANAGED
고객이 브라우저 또는 프로필을 관리합니다.
UNMANAGED
고객이 브라우저 또는 프로필을 관리하지 않습니다.
MANAGED_BY_OTHER_DOMAIN
다른 고객이 브라우저 또는 프로필을 관리합니다.
PROFILE_MANAGED
고객이 프로필을 관리합니다.
BROWSER_MANAGED
고객이 브라우저를 관리합니다.
예:
device.chrome.management_state in
[
ChromeManagementState.CHROME_MANAGEMENT_STATE_BROWSER_MANAGED ,
ChromeManagementState.CHROME_MANAGEMENT_STATE_PROFILE_MANAGED ,
]
chrome.versionAtLeast
유형
문자열
설명
브라우저가 특정 최소 버전 이상인지 여부
예시:
device.chrome.versionAtLeast ( "88.0.4321.44" )
chrome.is_realtime_url_check_enabled
유형
부울
설명
실시간 URL 확인 커넥터가 사용 설정되어 있는지 여부
예시:
device.chrome.is_realtime_url_check_enabled == true | false
chrome.is_file_upload_analysis_enabled
유형
부울
설명
파일 업로드 분석 커넥터가 사용 설정되어 있는지 여부
예시:
device.chrome.is_file_upload_analysis_enabled == true | false
chrome.is_file_download_analysis_enabled
유형
부울
설명
파일 다운로드 분석 커넥터가 사용 설정되어 있는지 여부
예시:
device.chrome.is_file_download_analysis_enabled == true | false
chrome.is_bulk_data_entry_analysis_enabled
유형
부울
설명
대량 텍스트(붙여넣기) 분석 커넥터가 사용 설정되어 있는지 여부
예시:
device.chrome.is_bulk_data_entry_analysis_enabled == true | false
chrome.is_security_event_analysis_enabled
유형
부울
설명
보안 관련 활동 보고 커넥터가 사용 설정되어 있는지 여부
예시:
device.chrome.is_security_event_analysis_enabled == true | false
함수
Access Context Manager는 커스텀 액세스 수준의 CEL 표현식에 사용할 수 있도록 다음 기능을 제공합니다.
함수
inIpRange(address, [subnets])
유형
(string, list(string)) -< boolean
설명
IP 주소가 지정된 서브넷 중 하나에 속하는지 확인합니다.
경고: 원본 IP 주소가 특정 비공개 IP 서브넷에 있는지 확인할 때는 이 함수를 사용하지 마세요. Google 내의 비공개 IP 주소는 변경될 수 있습니다.
예시:
inIpRange ( origin.ip , [ "192.0.2.0/24" , "198.51.100.0/24" , "203.0.113.0/24" ])
device.versionAtLeast(minVersion)
유형
DeviceType.(string) -> boolean
설명
기기 운영체제가 특정 버전 이상인지 확인합니다. 이 함수를 device.os_type
속성과 함께 사용하는 것이 좋습니다.
예:
device.versionAtLeast ( "10.0" ) == true
certificateBindingState(origin, device)
유형
(Peer, DeviceType) -> integer
설명
원본과 연결된 클라이언트 인증서가 기기와 일치하는지 확인하고 상태를 보고합니다.
함수가 반환하는 상태는 다음 중 하나일 수 있습니다.
CertificateBindingState.CERT_MATCHES_EXISTING_DEVICE
CertificateBindingState.CERT_NOT_MATCHING_EXISTING_DEVICE
CertificateBindingState.CERT_STATE_UNKNOWN
예시:
certificateBindingState ( origin , device ) == CertificateBindingState.CERT_MATCHES_EXISTING_DEVICE
startsWith()
유형
string.(string) -> bool
설명
문자열 피연산자가 프리픽스 인수로 시작하는지 여부를 테스트합니다.
예시:
"Sample string" . startsWith ( "Sample" )
endsWith()
유형
string.(string) -> bool
설명
문자열 피연산자가 서픽스 인수로 끝나는지 여부를 테스트합니다.
예시:
"Sample string" . endsWith ( "string" )
origin.clientCertFingerprint()
유형
Origin.() -> string
설명
원본과 연결된 인증서의 디지털 지문을 반환합니다. 매크로에서 이를 사용하여 기기 인증서를 테스트할 수 있습니다.
예시:
// Checks if the enterprise certificate associated with the origin matches the device.
device.certificates.exists ( cert , cert.is_valid && cert.cert_fingerprint == origin.clientCertFingerprint ())
CEL 표현식 매크로
커스텀 액세스 수준의 CEL 표현식에 다음 매크로를 사용할 수 있습니다.
매크로
설명
has(e.f)
필드를 사용할 수 있는지 여부를 테스트합니다. 자세한 내용은 필드 선택 을 참조하세요. 예를 들면 다음과 같습니다.
has({"key": "value"}.key)
has(device.vendors.some_vendor)
e.all(x, p)
e
목록의 모든 요소 또는 e
맵의 키에 대한 조건자를 보존하는지 여부를 테스트합니다. 여기서 x
는 요소 또는 키에 결합되는 p
에서 사용되는 식별자입니다. all()
매크로는 요소별 조건자 결과를 and
(&&) 연산자와 결합하므로 조건자가 false로 평가되면 매크로에서 다른 조건자의 오류를 무시하고 false로 평가합니다. 예를 들면 다음과 같습니다.
일부 요소가 1보다 크지 않으므로 false가 반환됩니다.
[1,2,3].all(x, x > 1)
e.exists(x, p)
all()
매크로와 비슷하지만 조건자 결과를 or
(||) 연산자와 결합합니다. 예를 들면 다음과 같습니다.
목록에 1보다 큰 요소가 하나 이상 있으므로 true를 반환합니다.
[1,2,3].exists(x, x > 1)
기기와 연결된 엔터프라이즈 인증서가 발급기관과 일치하는지 확인합니다.
device.certificates.exists(cert, cert.is_valid && cert.issuer == "EMAILADDRESS=test_inter1@beyondcorp.in, CN=inter_1, OU=BCEDemo_1, O=BCEDemo, L=NCR, ST=UP, C=IN")
e.exists_one(x, p)
exists()
매크로와 비슷하지만 정확히 요소 또는 키 하나의 조건자가 true로 평가되고 나머지가 false인 경우에만 true로 평가됩니다. 다른 불리언 결과 조합은 false로 평가되며 조건자 오류가 발생하면 매크로로 인해 오류가 발생합니다. 예를 들면 다음과 같습니다.
2개 이상의 요소가 1보다 크므로 false를 반환합니다.
[1,2,3].exists_one(x, x > 1)
CEL 표현식 예시
이 섹션에는 커스텀 액세스 수준을 만드는 데 사용되는 CEL 표현식의 예시가 포함되어 있습니다.
예시 1
device.encryption_status == DeviceEncryptionStatus.ENCRYPTED && ( origin.region_code in [ "US" ] || device.is_admin_approved_device )
이 예시는 요청을 허용하기 위해 다음 조건을 충족해야 하는 액세스 수준을 나타냅니다.
요청이 시작된 기기가 암호화됩니다.
다음 중 하나 이상에 해당합니다.
예시 2
( device.os_type == OsType.DESKTOP_WINDOWS && device.is_corp_owned_device ) || ( device.os_type == OsType.DESKTOP_MAC && device.is_admin_approved_device && device.versionAtLeast ( "10.11.0" ))
이 예시는 요청을 허용하기 위해 다음 조건을 충족해야 하는 액세스 수준을 나타냅니다.
예시 3
( certificateBindingState ( origin , device ) == CertificateBindingState.CERT_MATCHES_EXISTING_DEVICE )
이 예시는 요청을 허용하기 위해 다음 조건을 충족해야 하는 액세스 수준을 나타냅니다.
certificateBindingState
확장 프로그램 함수는 요청 시 제공되는 인증서가 기기가 엔드포인트 확인 에 등록될 때 등록된 기기 인증서 중 하나와 일치하는지 확인합니다.