API de classification BlueXP
Les fonctionnalités de classification de BlueXP disponibles via l'interface utilisateur web sont également disponibles via l'API swagger.
Quatre catégories de classification BlueXP correspondent aux onglets de l'interface utilisateur :
-
Enquête
-
La conformité
-
La gouvernance
-
Configuration
Les API de la documentation swagger vous permettent de rechercher, d'agréger des données, de suivre vos analyses et de créer des actions telles que la copie, le déplacement, etc.
Présentation
L'API vous permet d'effectuer les fonctions suivantes :
-
Informations d'exportation
-
Tout ce qui est disponible dans l'interface utilisateur peut être exporté via l'API (à l'exception des rapports)
-
Les données sont exportées au format JSON (facile à analyser et à envoyer vers des applications tierces, telles que Splunk)
-
-
Créez des requêtes à l'aide des instructions « ET » et « OU », incluez et excluez des informations, etc.
Par exemple, vous pouvez localiser des fichiers sans informations personnelles identifiables (PII) spécifiques (fonctionnalité non disponible dans l'interface utilisateur). Vous pouvez également exclure des champs spécifiques pour l'opération d'exportation.
-
Effectuer des actions
-
Mettre à jour les informations d'identification CIFS
-
Afficher et annuler des actions
-
Ré-analyser les répertoires
-
Exporter les données
-
L'API est sécurisée et utilise la même méthode d'authentification que l'interface utilisateur. Vous trouverez des informations sur l'authentification dans : https://docs.netapp.com/us-en/bluexp-automation/platform/get_identifiers.html
Accès à la référence de l'API swagger
Pour entrer dans swagger, vous devez disposer de l'adresse IP de votre instance de classification BlueXP. Dans le cas d'un déploiement cloud, vous utiliserez l'adresse IP publique. Ensuite, vous devrez entrer dans ce terminal :
https://<classification_ip>/documentation
Exemple d'utilisation des API
L'exemple suivant montre un appel d'API pour copier des fichiers.
Vous devrez d'abord obtenir tous les champs et options pertinents pour un environnement de travail pour afficher tous les filtres dans l'onglet investigation.
curl -X GET "http://{classification_ip}/api/{classification_version} /search/options?data_mode=ALL_EXTRACTABLE" -H "accept: application/json" -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR……… " -H "x-agent-id: hOXsZNvnA5LsthwMILtjL9xZFYBQxAwMclients"
{
"options": [
{
"active_directory_affected": false,
"data_mode": "ALL_SCANNED",
"field": "string",
"is_rulable": true,
"name": "string",
"operators": [
"EQUALS"
],
"optional_values": [
{}
],
"secondary": {},
"server_data": false,
"type": "TEXT"
}
]
}
{
"options": [
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "POLICIES",
"name": "Policies",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "EXTRACTION_STATUS_RANGE",
"name": "Scan Analysis Status",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "SCAN_ANALYSIS_ERROR",
"name": "Scan Analysis Event",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "PUBLIC_ACCESS",
"name": "Open Permissions",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": true,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "USERS_PERMISSIONS_COUNT_RANGE",
"name": "Number of Users with Access",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": true,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "USER_GROUP_PERMISSIONS",
"name": "User / Group Permissions",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_OWNER",
"name": "File Owner",
"operators": [
"EQUALS",
"CONTAINS"
],
"server_data": true,
"type": "TEXT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "ENVIRONMENT_TYPE",
"name": "Working Environment Type",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "ENVIRONMENT",
"name": "Working Environment",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_SCANNED",
"field": "SCAN_TASK",
"name": "Storage Repository",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_PATH",
"name": "File / Directory Path",
"operators": [
"MULTI_CONTAINS",
"MULTI_EXCLUDE"
],
"server_data": true,
"type": "MULTI_TEXT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_DASHBOARD_EXTRACTABLE",
"field": "CATEGORY",
"name": "Category",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "PATTERN_SENSITIVITY_LEVEL",
"name": "Sensitivity Level",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "NUMBER_OF_IDENTIFIERS",
"name": "Number of identifiers",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "PATTERN_PERSONAL",
"name": "Personal Data",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "PATTERN_SENSITIVE",
"name": "Sensitive Personal Data",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "DATA_SUBJECT",
"name": "Data Subject",
"operators": [
"EQUALS",
"CONTAINS"
],
"server_data": true,
"type": "TEXT"
},
{
"active_directory_affected": false,
"data_mode": "DIRECTORIES",
"field": "DIRECTORY_TYPE",
"name": "Directory Type",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "FILE_TYPE",
"name": "File Type",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "FILE_SIZE_RANGE",
"name": "File Size",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_CREATION_RANGE_RETENTION",
"name": "Created Time",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "DISCOVERED_TIME_RANGE",
"name": "Discovered Time",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_LAST_MODIFICATION_RETENTION",
"name": "Last Modified",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_LAST_ACCESS_RANGE_RETENTION",
"name": "Last Accessed",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "FILES",
"field": "IS_DUPLICATE",
"name": "Duplicates",
"operators": [
"EQUALS",
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "FILES",
"field": "FILE_HASH",
"name": "File Hash",
"operators": [
"EQUALS",
"IN"
],
"server_data": true,
"type": "TEXT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "USER_DEFINED_STATUS",
"name": "Tags",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "ASSIGNED_TO",
"name": "Assigned to",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
}
]
}
Nous utiliserons cette réponse dans nos paramètres de demande pour filtrer les fichiers que nous voulons copier.
Vous pouvez appliquer une action à plusieurs éléments. Les types d'action pris en charge sont notamment : déplacer, supprimer, copier, attribuer à, FlexClone, exporter les données, renumériser et étiqueter.
Nous allons créer l'action de copie :
Cette API suivante est cette API d'action et elle vous permet de créer plusieurs actions.
curl -X POST "http:// {classification_ip}/api//{classification_version}/actions" -H "accept: application/json" -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR……… " -H "x-agent-id: hOXsZNvnA5LsthwMILtjL9xZFYBQxAwMclients " -H "Content-Type: application/json" -d "{ \"action_type\": \"COPY\", \"data_mode\": \"FILES\", \"policy_id\": 0, \"request_params\": { destination_nfs_path: "{ontap_ip}:/{share_name} " }, \"requested_query\":{"condition":"AND","rules":[{"field":"ENVIRONMENT_TYPE","operator":"IN","value":["ONPREM"]},{"field":"CATEGORY","operator":"IN","value":["21"]}]}}"
La réponse renvoie l'objet d'action, de sorte que vous pouvez utiliser les API GET et DELETE pour obtenir le statut de l'action ou pour l'annuler.
{
"action_type": "COPY",
"creation_time": "2023-08-08T12:37:21.705Z",
"data_mode": "FILES",
"end_time": "2023-08-08T12:37:21.705Z",
"estimated_time_to_complete": 0,
"id": 0,
"policy_id": 0,
"policy_name": "string",
"priority": 0,
"request_params": {},
"requested_query": {},
"result": {
"error_message": "string",
"failed": 0,
"in_progress": 0,
"succeeded": 0,
"total": 0
},
"start_time": "2023-08-08T12:37:21.705Z",
"status": "QUEUED",
"title": "string",
"user_id": "string"
}