기본적으로 인프라스트럭처-애즈-코드 (IaC)에서 사용되는 일부 파일 유형은 비활성화되어 있습니다. 예를 들어 브로커가 리포지토리에 IaC 파일에 액세스하도록 허용하려면 Kubernetes 구성 파일과 같은 파일에 환경 변수인 ACCEPT_IAC를 추가할 수 있습니다. tf,yaml,yml,json,tpl의 어떤 조합도 사용할 수 있습니다.
그렇지 않으면 accept.json을 편집하고 관련 IaC 특정 규칙을 추가하여 사용자 지정 허용 파일을 컨테이너에 로드할 수 있습니다. 사용자 지정 허용 파일(다른 폴더에서 가져온)을 사용하는 경우(ACCEPT 환경 변수를 사용함), ACCEPT_IAC 메커니즘을 사용할 수 없음에 주의하시기 바랍니다.
이러한 지침은 사용자 지정 허용 목록이 필요하며 Snyk이 스캔할 수 있는 파일에 Kubernetes 구성 파일을 추가하려는 경우입니다.
구성 작성
리포지토리의 특정 파일에 브로커에 액세스 권한을 부여해야 합니다. 이는 특정 API 권한이 필요합니다. 사용하는 소스 컨트롤 시스템에 따라이 API 권한은 약간 다를 수 있습니다. 다음 구성은 .yaml, .yml, .json 파일 확장자를 위한 것입니다. 이를 통해 브로커가 Kubernetes 및 CloudFormation 파일에 액세스할 수 있지만 필요에 따라 구성을 조정할 수 있습니다. 예를 들어 Terraform HCL 파일을 스캔하기 위해 .tf 파일에 대한 구성을 추가할 수 있습니다.
소스 컨트롤 시스템에 적합한 accept.json 샘플 파일을 브로커 리포지토리에서 다운로드합니다.
파일 이름을 accept.json로 변경하고 JSON 파일의 private 배열에 다음 규칙을 적절하게 추가합니다.
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/*.yaml",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2F*.yaml",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/*.yml",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2F*.yml",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/*.json",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2F*.json",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*/*.tpl",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/repos/:name/:repo/contents/:path*%2F*.tpl",
"origin": "https://${GITHUB_TOKEN}@${GITHUB_API}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*/*.yaml",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*%2F*.yaml",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*/*.yml",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*%2F*.yml",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*/*.json",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*%2F*.json",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*/*.tpl",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/projects/:project/repos/:repo/browse*%2F*.tpl",
"origin": "https://${BITBUCKET_API}",
"auth": {
"scheme": "basic",
"username": "${BITBUCKET_USERNAME}",
"password": "${BITBUCKET_PASSWORD}"
}
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*/*.yaml",
"origin": "https://${GITLAB}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*%2F*.yaml",
"origin": "https://${GITLAB}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*/*.yml",
"origin": "https://${GITLAB}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*%2F*.yml",
"origin": "https://${GITLAB}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*/*.json",
"origin": "https://${GITLAB}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*%2F*.json",
"origin": "https://${GITLAB}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*/*.tpl",
"origin": "https://${GITLAB}"
},
{
"//": "Infrastructure as Code 문제를 결정하는 데 사용됨",
"method": "GET",
"path": "/api/v4/projects/:project/repository/files*%2F*.tpl",
"origin": "https://${GITLAB}"
},