외부에 노출된 계정 AAD에서 확인하기 - Power Automate 활용하기

 계정이 노출되어 위험한 로그인을 시도한 사용자 확인하기

A.    위험한 로그인을 시도한 내용을 AAD에서 확인이 가능하다 그러나 이를 매번 찾아 들어가 확인하는 번거로움을 없애기 위해 power automate로 가능하나 이를 이행하기 위한 (http / API https://graph.microsoft.com/v1.0/identityProtection/riskyUsers)는 별도의 AAD 라이선스가 필요합니다.

Sharepoint 사이트에 엑셀파일을 날짜별로 생성하고 생성된 파일에 행을 추가하고 추가된 엑셀을 메일에 첨부하여 수신할 수 있는 Power Automate를 하고자 합니다.

1.     되풀이 예약을 선택합니다.



2.     변수 초기화 또는 구성으로 테넌트 / 클라이언트 ID / 보안 값을 설정 합니다.

3.     검색할 시작 시간과 끝 시간을 변수 초기화로 설정합니다.

4.     시작 시간 설정



5.     끝 시간 설정



4.     차후 단계에서 확보할 정보의 값들이 Object 단위이기 때문에 배열로 변경하여야 필터 또는 개별 항목으로 나열이 가능하기 때문에 Objecty에서 Array로 변경할 배열 초기화 설정을 하여야 합니다.


5.     GET https://graph.microsoft.com/v1.0/auditlogs/signins?$filter=(createDateTime ge

https://graph.microsoft.com/v1.0/auditLogs/signIns?$filter=(createdDateTime

ge @{formatDateTime(addDays(utcNow(),-1), 'yyyy-MM-dd')} and

((location/countryOrRegion eq 'US') or (location/countryOrRegion eq 'RU') or (location/countryOrRegion eq 'CN') or (location/countryOrRegion eq 'VN') or (location/countryOrRegion eq 'IT') or (location/countryOrRegion eq 'BR') or (location/countryOrRegion eq 'IR') or (location/countryOrRegion eq 'TR') or (location/countryOrRegion eq 'HU') or (location/countryOrRegion eq 'NP


새 단계 삽입 > 작업 추가 > JSON 구문 분석을 선택합니다.



{

    "type""object",

    "properties": {

        "@@odata.context": {

            "type""string"

        },

        "value": {

            "type""array",

            "items": {

                "type""object",

                "properties": {

                    "id": {

                        "type""string"

                    },

                    "createdDateTime": {

                        "type""string"

                    },

                    "userDisplayName": {

                        "type""string"

                    },

                    "userPrincipalName": {

                        "type""string"

                    },

                    "userId": {

                        "type""string"

                    },

                    "appId": {

                        "type""string"

                    },

                    "appDisplayName": {

                        "type""string"

                    },

                    "ipAddress": {

                        "type""string"

                    },

                    "clientAppUsed": {

                        "type""string"

                    },

                    "correlationId": {

                        "type""string"

                    },

                    "conditionalAccessStatus": {

                        "type""string"

                    },

                    "isInteractive": {

                        "type""boolean"

                    },

                    "riskDetail": {

                        "type""string"

                    },

                    "riskLevelAggregated": {

                        "type""string"

                    },

                    "riskLevelDuringSignIn": {

                        "type""string"

                    },

                    "riskState": {

                        "type""string"

                    },

                    "riskEventTypes": {

                        "type""array"

                    },

                    "riskEventTypes_v2": {

                        "type""array"

                    },

                    "resourceDisplayName": {

                        "type""string"

                    },

                    "resourceId": {

                        "type""string"

                    },

                    "status": {

                        "type""object",

                        "properties": {

                            "errorCode": {

                                "type""integer"

                            },

                            "failureReason": {

                                "type""string"

                            },

                            "additionalDetails": {}

                        }

                    },

                    "deviceDetail": {

                        "type""object",

                        "properties": {

                            "deviceId": {

                                "type""string"

                            },

                            "displayName": {

                                "type""string"

                            },

                            "operatingSystem": {

                                "type""string"

                            },

                            "browser": {

                                "type""string"

                            },

                            "isCompliant": {

                                "type""boolean"

                            },

                            "isManaged": {

                                "type""boolean"

                            },

                            "trustType": {

                                "type""string"

                            }

                        }

                    },

                    "location": {

                        "type""object",

                        "properties": {

                            "city": {

                                "type""string"

                            },

                            "state": {

                                "type""string"

                            },

                            "countryOrRegion": {

                                "type""string"

                            },

                            "geoCoordinates": {

                                "type""object",

                                "properties": {

                                    "altitude": {},

                                    "latitude": {},

                                    "longitude": {}

                                }

                            }

                        }

                    },

                    "appliedConditionalAccessPolicies": {

                        "type""array"

                    }

                },

                "required": [

                    "id",

                    "createdDateTime",

                    "userDisplayName",

                    "userPrincipalName",

                    "userId",

                    "appId",

                    "appDisplayName",

                    "ipAddress",

                    "clientAppUsed",

                    "correlationId",

                    "conditionalAccessStatus",

                    "isInteractive",

                    "riskDetail",

                    "riskLevelAggregated",

                    "riskLevelDuringSignIn",

                    "riskState",

                    "riskEventTypes",

                    "riskEventTypes_v2",

                    "resourceDisplayName",

                    "resourceId",

                    "status",

                    "deviceDetail",

                    "location",

                    "appliedConditionalAccessPolicies"

                ]

            }

        }

    }

}

 

6.     Sharepoint 사이트에 샘플 엑셀 파일을 생성하고 해당 파일에서 콘텐츠를 가져옵니다.

7.     매일 자동으로 만들어질 엑셀 파일을 설정합니다.



8.     테이블을 생성합니다.

     테이블 범위는 sheet명의 영역으로 설정하여도 되면 아래와 같이 영역만 설정하여도 된다. 테이블 이름과 열 이름들은 선택사항이지만 설정하는 것이 문제를 줄이는 방법입니다.

9.     JSON 구문 분석에서 생성된 값들을 필터링 합니다.

필터링 항목들은 각 회사의 기준에 따라 설정합니다.

notequals / notcontants / notstartsWith 등으로 합니다.

여러 개를 할 경우 @and를 활용합니다.



10.  각 항목들을 Object에서 Array로 변경하여야 하기 때문에 각각에 적용기능을 사용합니다. App Filter의 본문을 선택합니다.





        "value": {

            "type""array",

            "items": {

                "type""object",

                "properties": {

                    "id": {

                        "type""string"

                    },

                    "createdDateTime": {

                        "type""string"

                    },

                    "userDisplayName": {

                        "type""string"

                    },

                    "userPrincipalName": {

                        "type""string"

 

Items(‘각각에 적용’)?[‘createDateTime’]

Items(‘각각에 적용’)?[‘userDisplayName’]

Items(‘각각에 적용’)?[‘userPrincipalName’]

Items(‘각각에 적용’)?[‘location’]?[‘city’]

Items(‘각각에 적용’)?[‘location’]?[‘state’]

Items(‘각각에 적용’)?[‘location’]?[‘countryOrRegion’]

을 각각 입력하거나 선택합니다.





 



 



댓글

이 블로그의 인기 게시물

결재 프로세스 만들기

AAD에서 앱 등록하기-Power Automate 활용하기

o365 메시지 센터 메일로 받아 보기-Power Automate 활용하기