·
Last changedVersion:
This version passed the hardening gate. Hardening applied 10 targeted changes and preserved all other text. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 9. Review findings remaining: 1.
None
None
Expand | File | Group | Subtype | Severity | Status |
|---|
No findings available
0 findings
Your goal is to help me write high-quality Spring Boot applications by following established best practices.
pom.xml) or Gradle (build.gradle) for dependency management.spring-boot-starter-web, spring-boot-starter-data-jpa) to simplify dependency management. Pin a supported, patched Spring Boot release and let it manage starter versions, use fixed versions rather than dynamic version ranges, enable dependency locking or checksum verification, resolve dependencies only from trusted repositories or an internal mirror, and run dependency vulnerability scanning regularly.com.example.app.order, com.example.app.user) rather than by layer (e.g., com.example.app.controller, com.example.app.service).private final.@Component, @Service, @Repository, and @Controller/@RestController annotations appropriately to define beans.application.yml (or application.properties) for configuration. YAML is often preferred for its readability and hierarchical structure.@ConfigurationProperties to bind configuration to strongly-typed Java objects.application-dev.yml, application-prod.yml) to manage environment-specific configurations. Keep credentials out of profile files, reference values supplied by environment variables or a secret manager, and keep any file holding real secrets out of version control.@Valid, @NotNull, @Size) on DTOs to validate request payloads.@ControllerAdvice and @ExceptionHandler to provide consistent error responses. Return generic error messages to clients, keep stack traces, exception class names, SQL and internal paths out of responses, and log full details only on the server.@Service classes.@Transactional on service methods to manage database transactions declaratively. Apply it at the most granular level necessary.JpaRepository or CrudRepository for standard database operations. In production, set schema generation to validate or none and manage schema changes through versioned migration scripts.@Query or the JPA Criteria API. Pass user input only through named or positional bind parameters in @Query and through parameters and predicates in the Criteria API, and restrict dynamic sort or column names to an allowlist.private static final Logger logger = LoggerFactory.getLogger(MyClass.class);logger.info("Processing user {}...", userId);) instead of string concatenation to improve performance. Keep passwords, tokens, secrets and unnecessary personal data out of log messages, mask sensitive fields, and neutralize line breaks in user controlled values to prevent log forging.@SpringBootTest for integration tests that load the Spring application context.@WebMvcTest (for controllers) or @DataJpaTest (for repositories) to test specific parts of the application in isolation.Get started with chainctlchainctl skill install public/github/java-springboot:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/github/skills/java-springboot:latest
MIT
HARDENING.md
LICENSE
SKILL.md