Chef InSpec can be used to test for system security and compliance by creating profiles of InSpec tests. Profiles allow complex compliance requirements to be tested across different teams and environments. The document demonstrates running the open source linux-baseline profile against a CentOS system using InSpec, remediating any failures using the corresponding Chef cookbook, and then wrapping the linux-baseline profile in a custom profile to skip a specific test.