diff --git a/src/commands/test-fips/cli.ts b/src/commands/test-fips/cli.ts new file mode 100644 index 000000000..29a2ca904 --- /dev/null +++ b/src/commands/test-fips/cli.ts @@ -0,0 +1,21 @@ +import { getFips, setFips } from 'crypto' + +import { Command } from 'clipanion' + +class TestFipsCommand extends Command { + public static paths = [['test-fips']] + + public static usage = Command.Usage({ + description: 'Test fips compliance of datadog-ci.', + }) + + public async execute() { + setFips(true) + const isFipsEnabled = getFips() + this.context.stdout.write(`FIPS ${isFipsEnabled === 1 ? 'enabled' : 'disabled'} (${isFipsEnabled})\n`) + + return 0 + } +} + +module.exports = [TestFipsCommand]