---
title: Manage Compliance Exceptions and Mitigations
description: View, edit, create, and delete exceptions and mitigations for compliance checks using the CLI.
---

[Skip to content](https://kb.opscompass.com/knowledge/manage-compliance-exceptions-and-mitigations#main-content)

[![Opscompass](https://kb.opscompass.com/hubfs/opscompass-logo-2024-web-small.svg)](https://opscompass.com)

- [Home](https://opscompass.com/)
- [Why Opscompass](https://opscompass.com/why-opscompass/)
- Product
  
  Show submenu for Product

    - [Inventory](https://opscompass.com/inventory/)
    - [Configuration Drift](https://opscompass.com/product/configuration-drift/)
    - [Compliance](https://opscompass.com/product/compliance/)
    - [Licenses](https://opscompass.com/solutions/licenses/)
- Solutions
  
  Show submenu for Solutions

    - [Hybrid and Multi-Cloud Visibility](https://opscompass.com/solutions/multi-cloud-visibility/)
- [About Us](https://opscompass.com/company/)

Open main navigation

Close main navigation

- [Home](https://opscompass.com/)
- [Why Opscompass](https://opscompass.com/why-opscompass/)
- Product
  
  Show submenu for Product

    - [Inventory](https://opscompass.com/inventory/)
    - [Configuration Drift](https://opscompass.com/product/configuration-drift/)
    - [Compliance](https://opscompass.com/product/compliance/)
    - [Licenses](https://opscompass.com/solutions/licenses/)
- Solutions
  
  Show submenu for Solutions

    - [Hybrid and Multi-Cloud Visibility](https://opscompass.com/solutions/multi-cloud-visibility/)
- [About Us](https://opscompass.com/company/)
- [Get a Demo](https://opscompass.com/demo/)

[Get a Demo](https://opscompass.com/demo/)

 What are you looking for?

- There are no suggestions because the search field is empty.

1. [Help Center](https://kb.opscompass.com/knowledge)
2. [Opscompass CLI](https://kb.opscompass.com/knowledge/opscompass-cli)
3. [Compliance](https://kb.opscompass.com/knowledge/opscompass-cli#compliance)

# Manage Compliance Exceptions and Mitigations

`get-upcoming-exception-info`

Retrieves the soon to be expiring compliance exception information for the specified company.  
Parameters:  
--company \[company\_slug\]  
--accounts (optional) \[account\_id\]  
--frameworkId (optional) \[compliance\_framework\_id\]

`list-compliance-exceptions`

Gets list of policy exceptions and mitigations  
Parameters:  
--company \[company\_slug\]  
--from-index (optional) \[number\] the record index to start at when fetching the next round of records (helps with fetching all records over multiple requests)  
--number-of-records (optional) \[number\] the number of records to fetch with one request  
--compliance-exception-sort: (optional) \[resource | check | type | created-at | expires-at | reason\] the column on which to sort records by  
--compliance-exception-sort-direction: (optional) \[asc | desc\] the direction to sort records by  
--search-text: (optional) \[string\] search columns by this text  
--type-filter: (optional) \[mitigation and/or policy\_exception\] filter results by type. Ex: --type-filter "policy\_exception, mitigation"  
--status-filter: (optional) \[active and/or expired\] filter results by status. Ex: --status-filter "expired, active"  
--expires-at-from: (optional) \[string\] the date at which to not show records before.  
Format: UTC, example: '2022-08-23T17:00:00Z' to filter by August 8th, 2022 at 17:00 UTC.  
--expires-at-to: (optional) \[string\] the date at which to not show records after.  
Format: UTC, example: '2022-08-23T17:00:00Z' to filter by August 8th, 2022 at 17:00 UTC.  
--check-ids-filter: (optional) \[string\] check ids to filter records by. Ex: --check-ids-filter "123, 456, 789"  
--resource-ids-filter: (optional) \[string\] resource ids to filter records by. Ex: --resource-ids-filter "123, 456, 789"  
--creator-ids-filter: (optional) \[string\] user ids to filter records by. Ex: --creator-ids-filter "123, 456, 789"

`update-compliance-exception`

Updates single compliance exception record (i.e. mitigations and policy exceptions)  
Parameters:  
--id \[record id\]  
--reason \[string\] the reason for the compliance exception  
--expiresAt \[string\] the date at which to expire. If you want to remove a compliance exception from the list, set the expiresAt to todays date.  
Format: UTC, example: '2022-08-23T17:00:00Z' to expire August 8th, 2022 at 17:00 UTC. To remove this field, pass in null.

`update-compliance-exceptions`

Updates multiple compliance exceptions (i.e. mitigations and policy exceptions)  
Parameters:  
--id \[record id\]  
--reason (optional) \[string\] the reason for the compliance exception  
--expiresAt (optional) \[string\] the date at which to expire. If you want to remove a compliance exception from the list, set the expiresAt to todays date.  
Format: UTC, example: '2022-08-23T17:00:00Z' to expire August 8th, 2022 at 17:00 UTC. To remove this field, pass in null.  
OR --json-updates \[stringified json objects with your updates\]  
For quick updates, you may use the above parameters  
e.g. Opscompass compliance update-compliance-exceptions --id 18 --reason "Valid exception reason" --id 3 --expires-at "09/15/2022"  
For larger updates, JavaScript Object Notation (JSON) may be used with the --json-updates flag  
e.g. Opscompass compliance update-compliance-exceptions --json-updates '\[{"id":"18","reason":"Valid exception reason"},{"id":"3","expiresAt":"2022-08-23T17:00:00Z"}\]'

`create-compliance-resource-check-exceptions`

Creates a new compliance resource check exception  
Parameters:  
--compliance-resource-check-id \[the compliance resource check id\]  
--compliance-exception-type \[string\] the type of compliance exception: 'mitigation' or 'policy\_exception'  
--reason \[string\] the reason for the compliance resource check exception  
--expires-at (optional) \[string\] the date at which to expire. If you want to remove a compliance exception from the list, set the expiresAt to todays date.  
Format: UTC, example: '2022-08-23T17:00:00Z' to expire August 8th, 2022 at 17:00 UTC.

- [About Opscompass](https://kb.opscompass.com/knowledge/about-opscompass#main-content)

    - [Company Information](https://kb.opscompass.com/knowledge/about-opscompass#company-information)
- [Getting Started](https://kb.opscompass.com/knowledge/getting-started#main-content)

    - [Logging In](https://kb.opscompass.com/knowledge/getting-started#logging-in)
    - [Connecting Cloud Accounts](https://kb.opscompass.com/knowledge/getting-started#connecting-cloud-accounts)
    - [Users and Teams](https://kb.opscompass.com/knowledge/getting-started#users-and-teams)
- [New Features](https://kb.opscompass.com/knowledge/new-features)
- [Opscompass CLI](https://kb.opscompass.com/knowledge/opscompass-cli#main-content)

    - [Getting Started](https://kb.opscompass.com/knowledge/opscompass-cli#getting-started)
    - [Resources and Inventory](https://kb.opscompass.com/knowledge/opscompass-cli#resources-and-inventory)
    - [Compliance](https://kb.opscompass.com/knowledge/opscompass-cli#compliance)
    - [Accounts](https://kb.opscompass.com/knowledge/opscompass-cli#accounts)
    - [Licensing](https://kb.opscompass.com/knowledge/opscompass-cli#licensing)
    - [Expiration](https://kb.opscompass.com/knowledge/opscompass-cli#expiration)
    - [Data Gathering](https://kb.opscompass.com/knowledge/opscompass-cli#data-gathering)
- [Opscompass FAQs](https://kb.opscompass.com/knowledge/opscompass-faqs#main-content)

    - [General](https://kb.opscompass.com/knowledge/opscompass-faqs#general)
- [Account Management](https://kb.opscompass.com/knowledge/account-management)
- [Compliance](https://kb.opscompass.com/knowledge/compliance)
- [Documents](https://kb.opscompass.com/knowledge/documents)
- [Drift](https://kb.opscompass.com/knowledge/drift)
- [Inventory](https://kb.opscompass.com/knowledge/inventory)
- [Licenses](https://kb.opscompass.com/knowledge/licenses#main-content)

    - [Oracle](https://kb.opscompass.com/knowledge/licenses#oracle)
    - [SQL Server](https://kb.opscompass.com/knowledge/licenses#sql-server)
- [Navigation and Dashboard](https://kb.opscompass.com/knowledge/navigation-and-dashboard)
- [Opscompass Integrations](https://kb.opscompass.com/knowledge/opscompass-integrations)
- [Understanding the Product](https://kb.opscompass.com/knowledge/understanding-the-product)
- [Tutorials](https://kb.opscompass.com/knowledge/tutorials#main-content)

    - [CLI](https://kb.opscompass.com/knowledge/tutorials#cli)

[![Opscompass](https://kb.opscompass.com/hubfs/opscompass-logo-2024-web-small.svg "Opscompass")](http://opscompass.com)

<https://opscompass.com/contact/> <https://www.linkedin.com/company/opscompass/>

Copyright © 2025, Opscompass