【问题标题】:Using Chef Inspec is it possible to verify the strength of SSH keys?使用 Chef Inspec 是否可以验证 SSH 密钥的强度?
【发布时间】:2021-05-27 19:42:18
【问题描述】:

在执行命令ssh-keygen -lf /etc/ssh/ssh_host_dsa_key.pub 时,我得到一个输出,其中前几位数字代表密钥强度。有没有可能使用 Chef inspec 验证密钥强度的方法?

假设我得到 1024...... 作为上述命令的输出,我如何使用 Chef Inspec 检查它应该是 1024 而不是其他值?

【问题讨论】:

    标签: chef-infra inspec


    【解决方案1】:

    使用command resourcematchoutput。像下面这样的东西应该可以解决问题

    describe command('ssh-keygen -lf /etc/ssh/ssh_host_dsa_key.pub | awk '{print $1}) do
     its('exit_status') { should eq 0 }
     its('stdout') { should be >= 1024 }
    end
    

    【讨论】:

      猜你喜欢
      • 2014-05-13
      • 1970-01-01
      • 2021-04-11
      • 2013-03-17
      • 2017-04-09
      • 2019-02-15
      • 2018-01-12
      • 2017-04-28
      • 2023-03-03
      相关资源
      最近更新 更多