The page has been translated by Gen AI.

JSON Writing Guide

Policies are divided into credential-based policies and resource-based policies.

  • Credential-based policy: a policy assigned to the principal (the entity performing actions) such as users, groups, or roles.
  • Resource-based policy: a policy granted to a resource that decides whether to allow or deny (Effect) an action (Action) on a specific resource (Resource) only for a principal (Principal).
Reference
Generally, for credential-based policies you do not need to specify a separate Pricpal property, but for resource-based policies you must specify the Pricpal property.

Resource-based policy

A resource-based policy is a policy that grants the specified principal (requester) permission to perform specific actions on the resource. Therefore, a resource-based policy is attached directly to the resource, only the users defined in the policy can enforce it, and the user to whom the policy is assigned becomes the security principal.

Caution
Since a resource-based policy designates the principal through the Principal attribute, you must include the Principal attribute when creating the policy.
Color mode
{
  "Version": "2024-07-01"
  "Statement": [
        {
            "Sid": "statement1"
            "Action": ["object-store:UploadObject"],
            "Principal": {
                "scp":"srn:e::1234:::scp-iam:user/abc3d3442"
            },
            "Effect": "Allow"
            "Resource": "srn:e:::::object-store:bucket/foo"
        }
    ]
}
{
  "Version": "2024-07-01"
  "Statement": [
        {
            "Sid": "statement1"
            "Action": ["object-store:UploadObject"],
            "Principal": {
                "scp":"srn:e::1234:::scp-iam:user/abc3d3442"
            },
            "Effect": "Allow"
            "Resource": "srn:e:::::object-store:bucket/foo"
        }
    ]
}
Example of allowing the UploadObject action on a bucket resource to fool only for a specific user

Resource-Based Policy Structure

The syntax structure and item-by-item description of resource-based policies are as follows.

Color mode
{
  "Version": "2024-07-01",                                 # Policy grammar version (fixed to 2024-07-01)
  "Statement": [
    {
      "Sid": "statement1",                                 # policy element ID
      "Effect": "Allow",                                   # Policy effect
      "Action": ["iam:showUser"],                          # Action defined in the policy
      "Principal": {
          "scp":"srn:e::1234:::iam:user/ROOT"              # the entity that is the target of the policy
      }
      "Resource": "srn:e::kr-west1:::scp-iam:group/foo",   # resource for which the policy action is allowed
      "Condition": {                                       # policy condition
          "StringEquals": {
            "iam:userName": [
              scp_test_user
              ]
          }
        }
    }
  ]
}
{
  "Version": "2024-07-01",                                 # Policy grammar version (fixed to 2024-07-01)
  "Statement": [
    {
      "Sid": "statement1",                                 # policy element ID
      "Effect": "Allow",                                   # Policy effect
      "Action": ["iam:showUser"],                          # Action defined in the policy
      "Principal": {
          "scp":"srn:e::1234:::iam:user/ROOT"              # the entity that is the target of the policy
      }
      "Resource": "srn:e::kr-west1:::scp-iam:group/foo",   # resource for which the policy action is allowed
      "Condition": {                                       # policy condition
          "StringEquals": {
            "iam:userName": [
              scp_test_user
              ]
          }
        }
    }
  ]
}
Resource feeling policy grammar structure
ItemdescriptionRequired
Version
  • “Define the version of the policy language”
  • Used with a different meaning than the policy version, and the current version is ““2024-07-01""
Required
StatementInformation on the key elements of the policyRequired
Statement.SidPolicy element ID (unique ID for elements within the same policy)Select
Statement.EffectPolicy application effect ( Allow : Allow /  Deny : Deny )Required
Statement.PrincipalSecurity PrincipalRequired
Statement.ActionPolicy target action (must specify either Action or NotAction)Select
Statement.ResourceList of resources subject to policy evaluationRequired
Statement.ConditionPolicy decision condition informationSelection
Table. Description of each item in the policy structure

Version

Version is used with a different meaning from the policy version, and the current version is “2024-07-01”.

{
   "Version" : "2024-07-01"
}

Statement

Statement is information about the main elements of a policy and can be defined as a single element or an array of individual elements.

"Statement" : [{statement}]
"Statement" : [{statement}, {statement}, {statement}]
Reference
If there are two or more policy elements, write multiple elements inside the array. In this case, the operation between each element is defined as OR.

Statement.Effect

Statement.Effect defines whether the policy action is allowed.

"Effect" : "Allow" # 허용
"Effect" : "Deny"  # 거부
Caution
Write with case sensitivity.

Statement.Principal

Statement.Principal specifies the entity that is allowed or denied access to a resource in a resource-based policy.
The subjects that can be specified in the Principal element are as follows.

  • root user
  • IAM user
  • IAM role
  • service account
Caution
  • Principal can have one or more values, and when there are multiple, write them as an array.
  • Principal cannot use wildcard(*).
"Principal" : { "scp": "srn:e::1234:::iam:user/root_user_id" }

"Principal" : {
    "scp": [
        "srn:e::1234:::iam:user/abc33333",
        "srn:e::1234:::iam:user/kef12344"
    ]
}

"Principal": {
    "Service": [
      "apigateway.samsungsdscloud.com"
    ]
}

Statement.Action

Statement.Action은 정책 검사에 평가될 액션을 정의합니다.

  • 대소문자를 구분하여 작성하세요.
  • 액션은 action definition에 정의되어 있는 액션 이름의 형식대로 작성하세요.
Caution
액션은 해당 리소스를 제공하는 서비스의 액션만 입력할 수 있습니다(단, 공통 기능에서 제공하는 태그 추가, 통합 자원 조회 등의 액션은 추가 가능).
"Action" : ["{action_expression}"]                               # single action
"Action" : ["{action_expression}", "{action_expression}", ... ]  # multiple actions

Statement.Resource

Statement.Resource는 정책이 적용되는 특정 리소스 또는 리소스 집합을 지정하는 SRN을 정의합니다.

  • 대소문자를 구분하여 작성하세요.
  • resource_expression은 와일드 카드("*") 또는 SRN 형식으로 작성하세요.
Caution
  • 리소스 기반 정책이 부여된 자원의 SRN이 반드시 포함되어야 하며, 해당 자원의 하위 자원이 있는 경우에는 하위 자원을 포함하여 작성할 수 있습니다.
  • 정책에 정의된 액션 정의(Action definition)에 기술된 자원에 한하여 Resources에 작성할 수 있으며, 정의되지 않은 자원의 경우에는 정책 평가 시 무시됩니다.
  • 하위 자원에도 와일드 카드(*)를 사용할 수 있습니다.
"Resource" : ["{resource_expression}"]                                 # single resource
"Resource" : ["{resource_expression}", "{resource_expression}", ... ]  # multiple resources
Reference

resource_expression에선 SRN 각 요소에서도 wildcard 형태로 표시할 수 있으며, 요소의 종류에 따라 지원 형태가 달라집니다.

  • wildcard 미지원 SRN 요소 SRN 요소 중 offering, account_id, service-type은 wildcard를 지원하지 않습니다.
"Resource" : ["srn:*::9b7653f6f47a42e38055934a0575a813:kr-west1::scp-compute:instance/d12937a6db0940499fdb0e18ad57b101"]   # offering wildcard notation (X)
"Resource" : ["srn:e::*:kr-west1::scp-compute:instance/d12937a6db0940499fdb0e18ad57b101"]                                  # account wildcard notation (X)
"Resource" : ["srn:e::9b7653f6f47a42e38055934a0575a813:kr-west1::*:instance/d12937a6db0940499fdb0e18ad57b101"]   # service type notation (X)
  • wildcard 지원 SRN 요소
    • SRN 요소 중 resource-type, resource-identifier, region은 전체 또는 부분에 대한 wildcard를 지원합니다.
    • 부분 wildcard의 경우에는 “foo , foo*, foo, fo” 와 같은 표현식으로 작성 할 수 있습니다.
# region
"Resource" : ["srn:e::9b7653f6f47a42e38055934a0575a813:*::scp-compute:instance/d12937a6db0940499fdb0e18ad57b101"]     # All (O)
"Resource" : ["srn:e::9b7653f6f47a42e38055934a0575a813:kr-*::scp-compute:instance/d12937a6db0940499fdb0e18ad57b101"]  # part (O)

# resource-type
"Resource" : ["srn:e::9b7653f6f47a42e38055934a0575a813:kr-west1::scp-compute:*/d12937a6db0940499fdb0e18ad57b101"]     # All (O)
"Resource" : ["srn:e::9b7653f6f47a42e38055934a0575a813:kr-west1::scp-compute:ins*/d12937a6db0940499fdb0e18ad57b101"]  # part (O)

# resource-identifier
"Resource" : ["srn:e::9b7653f6f47a42e38055934a0575a813:kr-west1::scp-compute:instance/*"]                             # All (O)
"Resource" : ["srn:e::9b7653f6f47a42e38055934a0575a813:kr-west1::scp-compute:instance/d12*101"]                       # part (O)

단일 자원일 경우, user 조회에 대한 action_definition resources 정의 형태

Color mode
kind: scp-iam:action-definition
service: iam
paths:
  /v1/users/{user_id}:
    get:
      resources:
      - "iam:user":
           resource_id: "path['user_id']"  # 사용자 조회 액션에서 지원되는 자원의 범위
kind: scp-iam:action-definition
service: iam
paths:
  /v1/users/{user_id}:
    get:
      resources:
      - "iam:user":
           resource_id: "path['user_id']"  # 사용자 조회 액션에서 지원되는 자원의 범위
For a single resource, an example of resources definition
Color mode
{
  "Version": "2024-07-01",
  "Statement": [
        {
            "Sid": "statement1",
            "Action": ["iam:showUser"], 
            "Effect": "Allow",
            "Resource": [ 
                    "*",  #  전체 자원에 대한 표현,
                    "srn:e:::::scp-iam:user/94c2ae8e7d5d471683a6135446183a12", # 특정 사용자 자원에 대한 표현 
                    "srn:e:::::scp-iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현 -> 사용자 조회 액션에서 해당 자원을 기술  경우 작성된 내용은 정책 평가  무시 된다.  
             ]  
        }
    ]
}
{
  "Version": "2024-07-01",
  "Statement": [
        {
            "Sid": "statement1",
            "Action": ["iam:showUser"], 
            "Effect": "Allow",
            "Resource": [ 
                    "*",  #  전체 자원에 대한 표현,
                    "srn:e:::::scp-iam:user/94c2ae8e7d5d471683a6135446183a12", # 특정 사용자 자원에 대한 표현 
                    "srn:e:::::scp-iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현 -> 사용자 조회 액션에서 해당 자원을 기술  경우 작성된 내용은 정책 평가  무시 된다.  
             ]  
        }
    ]
}
Example of defining a policy resource for a single resource

여러 자원일 경우, user 정책 조회에 대한 action_definition resources 정의 형태

서로 다른 여러 자원을 정의할 경우, 정책에 작성된 자원 유형을 정의하세요.

Caution
  • 정책 판단 시 액션 정의 파일에 정의된 자원을 기준으로 정책에 작성된 내용이 조건에 만족한 경우에만 성공으로 판단합니다.
  • 액션 정의 파일에 정의된 모든 자원이 정책에 작성되어 있지 않은 경우, 정책 조건에 맞지 않음으로 판단합니다.
kind: scp-iam:action-definition
service: iam
paths:
  /v1/user/{user_id}/policy/{policy_id}
    get:
      resources:
      - "iam:user"
         resource_id : "path['user_id']"
      - "iam:policy"
         resource_id : "path['policy_id']"
  • 정상: 특정 사용자의 특정 policy 예시
Color mode
{
  "Version": "2024-07-01",
  "Statement": [
        {
            "Sid": "statement1",
            "Action": ["iam:ShowUserPolicy"],
            "Effect": "Allow",
            "Resource": [
                    "srn:e:::::iam:user/94c2ae8e7d5d471683a6135446183a12",  # 특정 사용자 자원에 대한 표현
                    "srn:e:::::iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현
             ] 
        }
    ]
}
{
  "Version": "2024-07-01",
  "Statement": [
        {
            "Sid": "statement1",
            "Action": ["iam:ShowUserPolicy"],
            "Effect": "Allow",
            "Resource": [
                    "srn:e:::::iam:user/94c2ae8e7d5d471683a6135446183a12",  # 특정 사용자 자원에 대한 표현
                    "srn:e:::::iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현
             ] 
        }
    ]
}
Normal: Example of a specific policy for a specific user
  • 정상: 모든 사용자의 특정 policy 예시

    Color mode
    {
      "Version": "2024-07-01",
      "Statement": [
            {
                "Sid": "statement1",
                "Action": ["iam:ShowUserPolicy"],
                "Effect": "Allow",
                "Resource": [
                        "srn:e:::::iam:user/*",                                 # 모든 사용자 자원에 대한 표현
                        "srn:e:::::iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현
                 ] 
            }
        ]
    }
    {
      "Version": "2024-07-01",
      "Statement": [
            {
                "Sid": "statement1",
                "Action": ["iam:ShowUserPolicy"],
                "Effect": "Allow",
                "Resource": [
                        "srn:e:::::iam:user/*",                                 # 모든 사용자 자원에 대한 표현
                        "srn:e:::::iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현
                 ] 
            }
        ]
    }
    Normal: Example of a specific policy for all users

  • 비정상: user 자원 미기술 예시

    Color mode
    {
      "Version": "2024-07-01",
      "Statement": [
            {
                "Sid": "statement1",
                "Action": ["iam:ShowUserPolicy"],
                "Effect": "Allow",
                "Resource": [
                        "srn:e:::::iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현
                 ] 
            }
        ]
    }
    {
      "Version": "2024-07-01",
      "Statement": [
            {
                "Sid": "statement1",
                "Action": ["iam:ShowUserPolicy"],
                "Effect": "Allow",
                "Resource": [
                        "srn:e:::::iam:policy/c23fb561c689455993874fa5d5ed4a2f" # 특정 정책 자원에 대한 표현
                 ] 
            }
        ]
    }
    Abnormal: user resource not specified example

Statement.Condition

Statement.Condition은 정책 내에서 정책이 적용될 특정 대상에 대한 적용 조건을 정의합니다.

  • 대소문자를 구분하여 작성하세요.
  • 조건 연산자를 사용하여 정책에 정의된 자원의 속성 조건 키(또는 글로벌 조건 키), 값이 실제 요청(또는 자원의 속성)값과 비교하기 위한 조건 표현식을 작성하세요.
"Condition" : {
	"{qualifier:}{operator}" : {
    	"{condition-key}" : ["{condition-value}"],
	    "{condition-key2}" : ["{condition-value}"]
	}
}
ItemRequired or notCase-sensitiveExplanation
operatorRequiredOConditional operator
  • when two or more operators are defined, it operates as AND
condition-keyRequiredXPolicy condition key (global condition key, resource attribute condition key)
  • when two or more condition-keys are defined, it operates as AND
condition-valueRequiredDepends on the operator.policy condition value
qualifierSelectO
  • Qualifier, when there are two or more condition values extracted from the request context
  • Definition method for operand and comparison condition
Table. Description of each option item for Statement.Condition
Information

동일한 Condition Operator의 Condition Key에 Value가 2개 이상 정의된 경우, Value간 판단은 OR로 동작합니다. 단, Operator가 부정 연산자(Negative Operator) 유형인 경우에는 연산이 OR가 아닌 NOR로 동작합니다.

  • 긍정 연산자(Positive Operator) 유형 및 예시(userName이 “foo” 또는 “bar"이고 company가 “Samsung"인 경우)
    긍정 연산자(Positive Operator) 유형
"Condition": {
   "StringEquals": {
      "iam:userName": [  # When the user's name is foo or bar
          "foo", "bar"
      ],
      "iam:userCompany": [  # when the user's company is Samsung
          Samsung
      ]
   }
 }
  • 부정 연산자(Negative Operator) 유형 및 예시(IP가 1.1.1.1/24 와 2.2.2.2/24가 대역이 아닌 모든 IP)
    부정 연산자(Negative Operator) 유형
"Condition": {
   "NotIpAddress": {
      "scp:SourceIp": [  # when the request IP is neither 1.1.1.1 nor 2.2.2.2
          "1.1.1.1/24", "2.2.2.0/24"
      ]
   }
 }

조건 연산자(operator)

조건 연산자는 7가지(문자열, 숫자, 날짜, Bool, IP, SRN, Null) 연산자를 제공합니다.

  • 문자열 연산자 

    conditional operatorOperator typeExplanation
    StringEqualspositive operatorExact match, case-sensitive
    StringNotEqualsnegation operatormismatch
    StringEqualsIsIgnoreCasepositive operatorExact match, case insensitive
    StringNotEqualsIsIgnoreCasenegation operatorMismatch, case-insensitive
    StringLikepositive operatorCase-sensitive matching; multiple-character string matching (*) wildcard can be included in the value.
    StringNotLikenegation operatorCase sensitivity mismatch, wildcard that matches multiple characters (*) can be included in values
    Table. String operators

  • 숫자 연산자

    conditional operatorOperator Typesdescription
    NumericEqualspositive operatorMatch
    NumericNotEqualsnegation operatormismatch
    NumericLessThanpositive operatorMatch less than
    NumericLessThanEqualspositive operatoras follows
    NumericGreaterThanpositive operatorovermatch
    NumericGreaterThanEqualspositive operatorMatch above
    Table. Numeric operators

  • 날짜 연산자

    conditional operatorOperator typedescription
    DateEqualspositive operatorMatch specific date
    DateNotEqualsnegation operatormismatch
    DateLessThanpositive operatorMatch before a specific date/time
    DateLessThanEqualspositive operatorMatch on a specific date/time or earlier
    DateGreaterThanpositive operatorMatch after a specific date/time
    DateGreaterThanEqualspositive operatorMatch on a specific date/time or later
    Table. Date operators

  • Bool 연산자

    conditional operatorOperator Typesdescription
    Boolpositive operatorTrue, False match
    Table. Bool operator

  • IP 연산자

    conditional operatorOperator typedescription
    IpAddresspositive operatorspecified IP address or range
    NotIpAddressnegation operatorAll IP addresses except the specified IP address or range
    Table. IP operator

  • SRN 연산자

    conditional operatorOperator Typesdescription
    SrnEquals, SrnLikepositive operatorSRN match
    SrnNotEquals, SrnNotLikenegation operatorSRN mismatch
    Table. SRN operator

  • Null 연산자

    conditional operatorOperator typedescription
    Nullpositive operator
    • If the key is missing or the value is null \→ True
    • If the key exists and the value is not null \→ False
    Table. Null operator

조건 키(condition-key)

조건 키는 전역 조건 키과 자원 속성 키로 구분됩니다.

Reference
조건 키는 대소문자를 구분하지 않습니다.
전역 조건 키(Global condition key)

Samsung Cloud Platform에 사전 정의된 조건 키로써 요청 정보, 자원 공통 정보(ex-tag), 네트워크 정보 등의 데이터를 정의합니다.

condition keyData typesingular/pluraldescriptionexample
scp:UserIdstringsinglerequest user id“scp:UserId” : [“efda56a968cd45b2873d9bf5fab58e95”]
scp:UserNamestringsingleRequest user name“scp:UserName” : [“foo”]
scp:MultiFactorAuthPresentboolstringRequest via MFA authentication“scp:MultiFactorAuthPresent” : [“True”]
scp:RequestedRegionstringsinglerequest region“scp:RequestedRegion” : [“kr-west1”]
scp:RequestAttribute/{AttributeKey}stringsinglerequest attribute value(AttributeKey)
  • body
  • query
  • header
“scp:RequestAttribute/body[‘foo’]” : [“true”]
scp:TagKeysstringsingle / multiplerequest tag key“scp:TagKeys” : [“tag-key”]
scp:RequestTagstringsingleRequest tag key value“scp:RequestTag/tag-key” : [“tag-value”]
scp:ResourceTag/{TagKey}stringsingleResource tag key value“scp:ResourceTag/foo” : [“bab”]
scp:SourceIpip_addresssingleIP of the current requesting entity“scp:SourceIp” : [“1.1.1.1/24”]
scp:CurrentTimedatetimesingleRequest time (UTC, ISO 8601 format)“scp:CurrentTime” : [“2025-11-06T16:10:38Z”]
Table. Types and formats of supported global condition keys
자원 속성 키(Resource attribute key)

고유 자원에 대한 속성 키로써 자원의 속성값을 기준으로 조건값을 검사할 때 사용합니다.

{service}:{resource_type}{attribute_name}
Information
자원의 속성은 Resource definition에서 정의된 attributesabac:true인 대상의 속성에 한해서만 정의할 수 있으며 정의되지 않은 속성값을 입력할 경우, 해당 condition 정책은 무시됩니다(Not found).
  • 자원 속성명 사용 예시
"iam:userLastname"  (O) # attribute name defined in the resource (service: iam, resource: user, attribute_name : lastname)
"iam:userLASTNAME"  (O) # Property name defined in the resource (case-insensitive)
"iam:userLast_name" (X) # When it is not an attribute name defined in the resource ㅎ
"iam:userEmail"     (X) # when abac is false
"iam:state"         (X) # when the abac field is not defined
Color mode
kind: scp-resourcemanager:resource-definition
service_type: scp-iam
name: scp-iam:user
resources_uri: /v1/users
resource_type: user
display_name:
  ko: '사용자'
  en: 'User'
product_id: IAM
attributes:
  state:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.state
  firstname:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.first_name
    abac: true
  lastname:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.last_name
    abac: true
  email:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.email
    abac: false
kind: scp-resourcemanager:resource-definition
service_type: scp-iam
name: scp-iam:user
resources_uri: /v1/users
resource_type: user
display_name:
  ko: '사용자'
  en: 'User'
product_id: IAM
attributes:
  state:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.state
  firstname:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.first_name
    abac: true
  lastname:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.last_name
    abac: true
  email:
    type: string
    uri: /v1/users/{resource_id}
    method: GET
    jsonpath: $.email
    abac: false
scp-iam:user resource_definition example
Reference
  • 자원의 속성명은 Resource definition에서 정의된 attributes에 정의된 속성 데이터를 사용합니다.
  • Resource definition에 대한 자세한 내용은 Resource Definition 가이드를 참고하세요.
Condition Key 정의 예시
  • 전역 조건 키(Global condition key) 예시: 특정 정책 자원 태그의 키(Environment)의 값이 “Local” 또는 “Dev"인 경우에만 그룹 상세 조회를 허용하는 정책
Color mode
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Sid": "statement1",
      "Action": ["iam:showPolicy"],
      "Effect": "Allow",
      "Resource": ["*"],
      "Condition": {
          "StringEquals": {
            "scp:ResourceTag/Environment": [  # 전역 조건 키(scp:ResourceTag)를 사용한 정의 형태
              "Local", "Dev"
            ]
          }
      }      
    }
  ]
}
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Sid": "statement1",
      "Action": ["iam:showPolicy"],
      "Effect": "Allow",
      "Resource": ["*"],
      "Condition": {
          "StringEquals": {
            "scp:ResourceTag/Environment": [  # 전역 조건 키(scp:ResourceTag)를 사용한 정의 형태
              "Local", "Dev"
            ]
          }
      }      
    }
  ]
}
Example of a global condition key
  • 자원 속성 키(Resource attribute key) 예시
    Color mode
    {
      "Version": "2024-07-01",
      "Statement": [
        {
          "Sid": "statement1",
          "Action": ["server:showInstance"],
          "Effect": "Allow",
          "Resource": ["*"],
          "Condition" : {
               "StringEquals" : {
                   "virtual-servers:instanceFlavor" : ["m1.small"] # virtual-servers 서비스의 intance 리소스의 flavor 속성이 "m1.small" 경우
                }          
           }
        }
      ]
    }
    {
      "Version": "2024-07-01",
      "Statement": [
        {
          "Sid": "statement1",
          "Action": ["server:showInstance"],
          "Effect": "Allow",
          "Resource": ["*"],
          "Condition" : {
               "StringEquals" : {
                   "virtual-servers:instanceFlavor" : ["m1.small"] # virtual-servers 서비스의 intance 리소스의 flavor 속성이 "m1.small" 경우
                }          
           }
        }
      ]
    }
    Resource attribute key example

정책 조건값(condition-value)

조건 키에 대한 값을 정의합니다.

Reference
여러 개의 정책 조건값이 정의되어 있는 경우에는 각 조건값은 OR로 동작합니다.
"Condition" :  {
   "StringEquals" : {
        "scp:resourceTag/key1": ["value1", "value2", "value3"]    # If the resource's tag key is key1 and the value is value1, value2, or value3
 }

한정자(quailfier)

Condition key로부터 추출된 요청 컨텍스트값이 여러 개의 값을 가진인 경우에 동작 방법을 정의합니다.(요청 컨텍스트값이 1개일 경우에는 생략)
한정자는 ForAnyValue, ForAllValues로 구분되며 한정자를 작성하지 않을 경우, ForAnyValue가 기본값으로 정의됩니다.

  • ForAnyValue: 요청 컨텍스트에 추출된 값들이 Condition에 정의된 Operand와 1개 이상 일치할 경우 True
  • ForAllValues: 요청 컨텍스트에 추출된 값들이 Condition에 정의된 Operand 리스트의 하위 집합일 경우 True
{
  
  "Condition" :  {
       "ForAllValues:StringEquals" : {
            "scp:TagKeys": ["key1", "key2", "key3"]
        }
  }
}
한정자 동작 예시
  • “scp:TagKeys”로 부터 추출되는 요청값이 1개인 경우: 한정자와 관계없이 Operand별로 OR로 동작
  • “scp:TagKeys”로 부터 추출되는 요청값이 2개 이상인 경우: 한정자에 따라 결과 차이
Color mode
# 추출되는 요청 컨텍스트값이 ["key1", "key2", "key4"]  경우
Operand: ["key1", "key2", "key3"]  
   # 요청 컨텍스트값  key1 Operand에 포함되므로 True
   # 요청 컨텍스트값  key2 Operand에 포함되므로 True
   # 요청 컨텍스트값  key4 Operand에 포함되지 않으므로 False 

ForAnyValue는 3개의 요청 컨텍스트   1개라도 일치할 경우엔 True로 판단
ForAllValues는 3개의 요청 컨텍스트 값이 모두 True  경우에만 최종 True로 판단
# 추출되는 요청 컨텍스트값이 ["key1", "key2", "key4"]  경우
Operand: ["key1", "key2", "key3"]  
   # 요청 컨텍스트값  key1 Operand에 포함되므로 True
   # 요청 컨텍스트값  key2 Operand에 포함되므로 True
   # 요청 컨텍스트값  key4 Operand에 포함되지 않으므로 False 

ForAnyValue는 3개의 요청 컨텍스트   1개라도 일치할 경우엔 True로 판단
ForAllValues는 3개의 요청 컨텍스트 값이 모두 True  경우에만 최종 True로 판단
ForAnyValue, ForAllValues operation example
My Info.
Release Note